author: yang zhang[sosp’ 13] presentator: jianxiong gao

17
Transaction chains: achieving serializability with low-latency in geo-distributed storage systems Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

Upload: kellie-covel

Post on 14-Dec-2015

222 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

Transaction chains: achieving serializability with low-latency in geo-distributed storage systems

Author: Yang Zhang[SOSP’ 13]Presentator: Jianxiong Gao

Page 2: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

• Shards• Derived Tables

• Secondary Indices• Materialized Join Views• Geo-Replicas

Geo-distributed NatureLarge-scale Web applications

Geo-distributed storage

Replication

Page 3: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

Transaction in database management

• Recovery from failure• Isolation among transactions

Page 4: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

?Low latency

Key/value only

Limited forms of transaction

General transaction

Prior workStrictserializable

Serializable

Eventual

Variousnon-serializable

High latency

Provably high latency according

to CAP

Spanner [OSDI’12]

Dynamo [SOSP’07]

COPS [SOSP’11]

Walter [SOSP’11]

Eiger [NSDI’13]

Lynx[SOSP’13]

Page 5: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

Transaction in database managementwhile maintaining low latency

• Recovery from failure• If the first hop of a chain commits, then all hops eventually commit• Users are only allowed to abort a chain in the first hop• Log chains durably at the first hop• Logs replicated to a nearby datacenter• Re-execute stalled chains upon failure recovery

• Isolation among transactions• Home geo-replica• Sequence number vectors

Page 6: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

Sequence Number Vectors Event A: Go through (P1 – P3 – P2)Event B: Go through (P1 – P2 )

Page 7: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

What are hops?Serializability

Defination: Serializability of a schedule means equivalence (in the outcome, the database state, data values) to a serial schedule (i.e., sequential with no transaction overlap in time) with the same transactions.

Ordering 1 Ordering 2

Transactions

Page 8: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

Serializable Example

Time

Serializable Strict serializable

Transaction 1: Tbid

Transaction 2: Tadd

Transaction 3: Tread

Page 9: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

What are hops?

Alice’s Bids

Alice Book $100 Bob

Datacenter-1 Datacenter-2

AliceBob Camer

a$100

Bob’s Items

2. Update highest bid on Bob’s Items

Operation: Alice bids on Bob’s camera

1. Insert bid to Alice’s Bids

Page 10: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

What are hops?Chopping

When can we chop?

• S-edge: Connecting unchopped transactions• C-edge: Connecting vertices write to the same item.

Page 11: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

What are hops?• Serializable when no SC-cycles. Shasha[Transactions on Database Systems’ 95]• Solution: Remove C-edges.

Page 12: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

System Chains• Secondary Index• Join View• Geo-replication

Subchains either commuteOrhas origin ordering

Page 13: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

Experimental setup

us-west

europe

us-east

82ms

153m

s

102m

s

Lynx protoype:• In-memory

database• Local disk logging

only.

Page 14: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

Results: Response Time

Follo

w-u

ser

Post

-twee

t

Follo

w-u

ser

Post

-twee

t

Read-

timel

ine

0

50

100

150

200

250

300

174

252

3.2 3.1 3.1

Late

ncy

(m

s)

Chain completion

Page 15: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

Result: Throughput

Follow-User Post-Tweet Read-Timeline0

200000

400000

600000

800000

1000000

1200000

1400000

1600000

184000 173000

1350000

Mil

lion

ops/

sec

Page 16: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

Other thoughts & ComentsCan we always chop?Too many derived table?Actual transaction time not reduced. More experiments?

Page 17: Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao

Thanks!Graphs and parts of slides accredit to author

of the paper: Yang Zhang.