Big Data Technology Incremental Processing using Distributed Transactions

Similar documents
TRANSACTIONS AND ABSTRACTIONS

TRANSACTIONS OVER HBASE

CSE 530A ACID. Washington University Fall 2013

Percolator. Large-Scale Incremental Processing using Distributed Transactions and Notifications. D. Peng & F. Dabek

Omid, Reloaded: Scalable and Highly-Available Transaction Processing

Transaction Management & Concurrency Control. CS 377: Database Systems

Distributed Transactions in Hadoop's HBase and Google's Bigtable

TRANSACTION MANAGEMENT

CSE 344 MARCH 5 TH TRANSACTIONS

Distributed computing: index building and use

Webinar Series TMIP VISION

Shen PingCAP 2017

Concurrency Control in Distributed Systems. ECE 677 University of Arizona

Introduction to Data Management CSE 344

Database Systems CSE 414

Database Replication in Tashkent. CSEP 545 Transaction Processing Sameh Elnikety

Topics in Reliable Distributed Systems

CSE 344 MARCH 25 TH ISOLATION

Outline. Database Tuning. Ideal Transaction. Concurrency Tuning Goals. Concurrency Tuning. Nikolaus Augsten. Lock Tuning. Unit 8 WS 2013/2014

Distributed PostgreSQL with YugaByte DB

Transaction Processing: Concurrency Control ACID. Transaction in SQL. CPS 216 Advanced Database Systems. (Implicit beginning of transaction)

Transaction Processing: Concurrency Control. Announcements (April 26) Transactions. CPS 216 Advanced Database Systems

Introduction to Data Management CSE 344

Distributed Data Analytics Transactions

Introduction to Data Management CSE 344

What are Transactions? Transaction Management: Introduction (Chap. 16) Major Example: the web app. Concurrent Execution. Web app in execution (CS636)

Apache Cassandra - A Decentralized Structured Storage System

Data Modeling and Databases Ch 14: Data Replication. Gustavo Alonso, Ce Zhang Systems Group Department of Computer Science ETH Zürich

Transaction Management: Introduction (Chap. 16)

Reference types in Clojure. April 2, 2014

Distributed Systems. 12. Concurrency Control. Paul Krzyzanowski. Rutgers University. Fall 2017

5/17/17. Announcements. Review: Transactions. Outline. Review: TXNs in SQL. Review: ACID. Database Systems CSE 414.

Introduction to Data Management CSE 344

Database Systems CSE 414

Distributed Data Management Transactions

CMPT 354: Database System I. Lecture 11. Transaction Management

Database Management and Tuning

Database Systems CSE 414

TiDB: NewSQL over HBase.

Databases. Laboratorio de sistemas distribuidos. Universidad Politécnica de Madrid (UPM)

Introduction to Big Data. NoSQL Databases. Instituto Politécnico de Tomar. Ricardo Campos

Example: Transfer Euro 50 from A to B

HAWQ: A Massively Parallel Processing SQL Engine in Hadoop

High Performance Transactions in Deuteronomy

Lock Tuning. Concurrency Control Goals. Trade-off between correctness and performance. Correctness goals. Performance goals.

Putting it together. Data-Parallel Computation. Ex: Word count using partial aggregation. Big Data Processing. COS 418: Distributed Systems Lecture 21

TRANSACTION PROPERTIES

How do we build TiDB. a Distributed, Consistent, Scalable, SQL Database

Heckaton. SQL Server's Memory Optimized OLTP Engine

CSE 444: Database Internals. Lectures 13 Transaction Schedules

Concurrency Control Goals

Transactions. 1. Transactions. Goals for this lecture. Today s Lecture

The Power of Snapshots Stateful Stream Processing with Apache Flink

MillWheel:Fault Tolerant Stream Processing at Internet Scale. By FAN Junbo

Time Series Storage with Apache Kudu (incubating)

A transaction is a sequence of one or more processing steps. It refers to database objects such as tables, views, joins and so forth.

CompSci 516 Database Systems

Chapter 22. Transaction Management


Last Class Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications

Database Management Systems CSEP 544. Lecture 9: Transactions and Recovery

DATABASE TRANSACTIONS. CS121: Relational Databases Fall 2017 Lecture 25

Rethinking Serializable Multi-version Concurrency Control. Jose Faleiro and Daniel Abadi Yale University

Consistency in Distributed Systems

CSC 261/461 Database Systems Lecture 20. Spring 2017 MW 3:25 pm 4:40 pm January 18 May 3 Dewey 1101

Concurrency Control In Distributed Main Memory Database Systems. Justin A. DeBrabant

Distributed computing: index building and use

Information Systems (Informationssysteme)

LazyBase: Trading freshness and performance in a scalable database

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

VOLTDB + HP VERTICA. page

T ransaction Management 4/23/2018 1

Fault Tolerance. Goals: transparent: mask (i.e., completely recover from) all failures, or predictable: exhibit a well defined failure behavior

Introduction to Databases, Fall 2005 IT University of Copenhagen. Lecture 10: Transaction processing. November 14, Lecturer: Rasmus Pagh

Introduction to Data Management CSE 344

PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL)

Motivating Example. Motivating Example. Transaction ROLLBACK. Transactions. CSE 444: Database Internals

Are You OPTIMISTIC About Concurrency?

Data Access 3. Managing Apache Hive. Date of Publish:

Seminar 3. Transactions. Concurrency Management in MS SQL Server

Transaction Management: Concurrency Control, part 2

Locking for B+ Trees. Transaction Management: Concurrency Control, part 2. Locking for B+ Trees (contd.) Locking vs. Latching

CS5412: DIVING IN: INSIDE THE DATA CENTER

CSE 544 Principles of Database Management Systems. Alvin Cheung Fall 2015 Lecture 14 Distributed Transactions

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

Unit 10.5 Transaction Processing: Concurrency Zvi M. Kedem 1

ZooKeeper & Curator. CS 475, Spring 2018 Concurrent & Distributed Systems

Main-Memory Databases 1 / 25

DIVING IN: INSIDE THE DATA CENTER

10. Replication. CSEP 545 Transaction Processing Philip A. Bernstein. Copyright 2003 Philip A. Bernstein. Outline

CSE 344 Final Review. August 16 th

Using the SDACK Architecture to Build a Big Data Product. Yu-hsin Yeh (Evans Ye) Apache Big Data NA 2016 Vancouver

Chapter 24 NOSQL Databases and Big Data Storage Systems

Intro to Big Data on AWS Igor Roiter Big Data Cloud Solution Architect

How Oracle Does It. No Read Locks

S-Store: Streaming Meets Transaction Processing

Atomic Transac1ons. Atomic Transactions. Q1: What if network fails before deposit? Q2: What if sequence is interrupted by another sequence?

Database Tuning and Physical Design: Execution of Transactions

PNUTS and Weighted Voting. Vijay Chidambaram CS 380 D (Feb 8)

Transactions. ACID Properties of Transactions. Atomicity - all or nothing property - Fully performed or not at all

Transcription:

Big Data Technology Incremental Processing using Distributed Transactions Eshcar Hillel Yahoo! Ronny Lempel Outbrain *Based on slides by Edward Bortnikov and Ohad Shacham

Roadmap Previous classes Stream processing This class Sieve/Percolator content management platform Omid - Distributed transaction processing Notifications mechanism CS236620 Big Data Technology 2

Search and Technology Evolution Late 1990 s Relatively static Web Okay to have new content searchable within hours or days Crawl the Web. Store content. Index in big batches. Technology: Map-Reduce. Late 2000 s Super-dynamic Web, Mobile, Social Content expected to become searchable within minutes Ingest multiple content streams. Index instantly. Technology: Stream Processing. KV-Stores. Transactions. CS236620 Big Data Technology 3

Lambda Architecture Source: https://www.mapr.com/developercentral/lambda-architecture CS236620 Big Data Technology 4

Queries Search in the Dynamic World Indexing Pipeline Mail feed Document store Content Processing CS236620 Big Data Technology Real-Time Search Index Serving 5

Zooming In on Indexing Pipelines Process a stream of documents arriving uncoordinated Produce a collection of artifacts (features) for each document required for fast retrieval and relevance ranking Each document is processed independently processing might affect other documents (example?) Traverse a series of topologies (dataflow) intermediate results stored for reliability CS236620 Big Data Technology 6

Sieve Architecture Crawl Docproc Link Analysis Queue Crawl schedule Content Links Queue Serving Apache HBase (storage)` Scalable distributed Hadoop KV-store Apache Storm (compute) Scalable distributed stream processing platform CS236620 Big Data Technology 7

Percolator Architecture CS236620 Big Data Technology 8

Technologies Stream processing: series of observers each completes a task, and creates more work to downstream observers Storm topologies Data storage: Key-Value Stores (NoSQL) are a natural fit Bigtable (Google/proprietary) HBase (Apache/open source) End-to-end consistency: transactional processing layer Percolator (Google/proprietary) Omid (Apache/open source) CS236620 Big Data Technology 9

Why Transactions? Multiple processing threads transform the repository concurrently Transactions make it easier for the programmer to reason about the state of the repository Both in terms of fault tolerance (atomicity) and consistency (isolation) Better performance than ad-hoc (incorrect?) solutions CS236620 Big Data Technology 10

Back to Web Indexing - Zooming In on Tasks Document processing Read page content from the store Compute search index features Update computed features Link processing Read outgoing links for a page Update reference for all linked-to pages begin commit begin commit CS236620 Big Data Technology 11

ACID Transactions Multiple data accesses in a single logical operation Atomic All or nothing no partial effect observable Consistent The DB transitions from one valid state to another Isolated Appear to execute in isolation Durable Committed data cannot disappear CS236620 Big Data Technology 12

Consistency Take I Serializability Transactions appear to execute serially Each one logically happens at a single point in time Popular implementation 2-phase commit prepare phase - acquire locks, read set validation commit phase commit, update values, release locks CS236620 Big Data Technology 13

Critique and Remedy Serializability is Deadlock-prone Serializability is Expensive Up to 50% time wasted on locking (bad utilization) Why pay for consistency in low-contention environments? Remedy: Exploit Multi-Version Concurrency Control (MVCC) Let concurrent operations work on multiple data versions Execute optimistically, reconcile at the end Fortunately, MVCC is implemented by modern KV-stores CS236620 Big Data Technology 14

Consistency Take II Snapshot Isolation Transaction is applied to a logical snapshot of the database Two synchronization points Read snapshot (RS) all reads consistent for RS Write snapshot (WS) all writes applied at WS (WS > RS) Consistency guarantee: no WW conflicts No external writes to T s write set between T.RS and T.WS à Read-only transactions always succeed CS236620 Big Data Technology 15

Snapshot Isolation - Implementation Begin RS ß timestamp() Read(X) Read the latest version of X with timestamp RS Write Tentatively write changes Commit Validate the conflicts; abort if validation fails Writes take effect (atomically with validation) CS236620 Big Data Technology 16

Snapshot Isolation Example TxId Temporal Overlap Spatial Overlap (Write Set) T1 T2 K1 K3 K2 K4 T3 K3 K4 T4 K1 K2 K3 K4 CS236620 Big Data Technology 17

Omid Open Source project, incepted by Yahoo Transactional API over HBase Can be used directly or by SQL-over-HBase platforms Scalable, Highly Available Service Database-neutral Architecture Works with any MVCC-friendly KV-store CS236620 Big Data Technology 18

Omid Architecture Client Begin/Commit/Rollback Results/Timestamp Transaction Status Oracle Read/Write Get commit info Atomic commit Data store Data store Data store Commit table CS236620 Big Data Technology 19

Omid Architecture Client Begin t1 Transaction Status Oracle Write (k1, v1, t1) Read Write (k, last (k2, committed v2, t1) t < t1) Data store Data store Data store Commit table (k1, v1, t1) (k2, v2, t1) CS236620 Big Data Technology 20

Omid Architecture Client Commit: t1, {k1, k2} t2 Transaction Status Oracle Write (t1, t2) Data store Data store Data store Commit table (k1, v1, t1) (k2, v2, t1) (t1, t2) CS236620 Big Data Technology 21

Omid Architecture Client Transaction Status Oracle Read (k1, t3) Read (t1) Data store Data store Data store Commit table (k1, v1, t1) (k2, v2, t1) (t1, t2) CS236620 Big Data Technology 22

Omid Architecture Client t2 Transaction Status Oracle Write (k1, v1, t1, t2) Remove (t1) Write (k2, v2, t1, t2) Data store Data store Data store Commit table (k1, v1, t1) t1, t2) (k2, v2, t1) t1, t2) (t1, t2) CS236620 Big Data Technology 23

Omid Architecture Client Transaction Status Oracle Read (k1, t3) Data store (k1, v1, t1, t2) Data store Data store Commit table (k2, v2, t1, t2) CS236620 Big Data Technology 24

Omid Architecture Client Begin/Commit/Rollback Results/Timestamp Transaction Status Oracle Single point of failure Read/Write Get commit info Atomic commit Data store Data store Data store Commit table CS236620 Big Data Technology 25

High Availability Primary-backup solution Guarantee clients get the right answer Clients write data only when their TSO is the leader Use leases Check locally before and after write to the CT Invalidate pending txs from previous epochs CS236620 Big Data Technology 26

Scalability The TSO and the CT scale independently CT Scalability Commit writes aggressively batched for throughput Concurrent write to Hbase horizontal scalability TSO Scalability Conflict detection the main bottleneck Novel concurrent algorithm, scales vertically to 5M txn/sec CS236620 Big Data Technology 27

Notifications Stream processing workers scan data to identify changes Invoke corresponding observer (topology) Perform txs Store intermediate results Again, workers identify changes triggers downstream observers CS236620 Big Data Technology 28

Notification and Acknowledgment Columns Dirty column notification set if observers must be triggered Very sparse columns Key Val n ack k184637 xxx 1 Randomized distributed scan over notification column in-memory columns k298493 xxx 1 ts:yyyy k827164 xxx 1 CS236620 Big Data Technology 29

Bus Clumping Randomized scanner tend to clump Reduces effective parallelism Creates contention in kv-store servers Solution Obtain a lightweight lock per scanned row Upon failure, jump to a random point in table CS236620 Big Data Technology 30

Summary Transactions important use case in stream processing Snapshot Isolation scalable consistency model Omid an open-source TP system for Hbase Battle-tested, Web-scale, HA CS236620 Big Data Technology 31

Further Reading Percolator CS236620 Big Data Technology 32

Next Class A/B testing CS236620 Big Data Technology 33