Distributed Systems and Databases of the Globe Unite! The Cloud, the Edge and Blockchains
Amr El Abbadi
University of California, Santa Barbara
Divy Agrawal, Mohammad Amiri, Sujaya Maiyya, Faisal Nawab (UCSC),
Victor Zakhary.
OPODIS 2018 1
Distributed Systems and Databases of the Globe Unite! The Cloud, the - - PowerPoint PPT Presentation
Distributed Systems and Databases of the Globe Unite! The Cloud, the Edge and Blockchains Amr El Abbadi University of California, Santa Barbara Divy Agrawal , Mohammad Amiri, Sujaya Maiyya, Faisal Nawab (UCSC), Victor Zakhary. OPODIS 2018 1
Distributed Systems and Databases of the Globe Unite! The Cloud, the Edge and Blockchains
Amr El Abbadi
University of California, Santa Barbara
Divy Agrawal, Mohammad Amiri, Sujaya Maiyya, Faisal Nawab (UCSC),
Victor Zakhary.
OPODIS 2018 1
Commit Protocols 2PC
State Machine Replication and Consensus Protocols Paxos
OPODIS 2018 2
Storage Tier Abstract Replication PAXOS Application Execution Tier Transactions 2PL+2PC
Application Access Tier
Datacenter A Datacenter B Datacenter Z
OPODIS 2018 3
OPODIS 2018 4
OPODIS 2018 5
Paxos: No failure Case
Leader Election Fault‐Tolerant Agreement
Proposer Majority
6
Decision
Leader
Asynchronous
OPODIS 2018
Paxos: Failure Case
Leader Election Fault‐Tolerant Agreement
A
Majority
OPODIS 2018 7
Decision Also, Value Discovery in case agreement has been reached.
Atomic Commitment
OPODIS 2018 8
Two Phase Commit: No Failure Case:
Value Discovery Decision
Coordinator All cohorts
OPODIS 2018 9
Make decision Fault‐tolerant by storing on disk
Three Phase Commit
OPODIS 2018 10
Value Discovery Fault‐Tolerant Agreement Decision
Coordinator
All Majority
Cohorts
Three Phase Commit: Termination
termination protocol
OPODIS 2018 11
Leader Election & Value Discovery Fault‐Tolerant Agreement Decision Leader
Majority
Cohorts
Majority
Common phases observed?
OPODIS 2018 12
Consensus & Commitment (C&C) Framework
Leader Election Value Discovery Fault‐tolerant Agreement Decision
OPODIS 2018 13
Paxos Atomic Commitment (PAC)
OPODIS 2018 14
Leader Election & Value Discovery Fault‐Tolerant Agreement Decision Leader
Majority
Cohorts
All
2PC/State Machine Replication (SMR)
15
Fault‐Tolerant Persistence Coordinator Cohorts Replicas Replicas Fault‐Tolerant Persistence
OPODIS 2018
Leader Leader
2PC/State Machine Replication (SMR)
16
Value Discovery Fault‐Tolerant Persistence Coordinator Leader Decision Cohort Leader Replicas Replicas Fault‐Tolerant Persistence
OPODIS 2018
Majority Majority Majority
Generalized‐PAC (G‐PAC)
Coordinator all identical replicas
[Zhang SOSP 2015] and Janus [Mu OSDI 2016]
17 OPODIS 2018
G‐PAC (Generalized Paxos Atomic Commit)
18
Leader Election + Value Discovery Fault‐Tolerant Agreement Decision Coordinator Majority Cohort 1 Replicas Cohort 2 Replicas All
A majority of replicas from ALL cohorts A majority of replicas from a majority of cohorts
OPODIS 2018
Consensus & Commitment (C&C) Framework
as propose new protocols
Leader Election Value Discovery Fault‐tolerant Agreement Decision
OPODIS 2018 19
OPODIS 2018 20
The future of web/cloud applications
21/46 OPODIS 2018
The Cloud
100 of milliseconds to seconds
22/46 OPODIS 2018
OPODIS 2018 23
24/46 OPODIS 2018
We are making the world a better place through Paxos algorithms
OPODIS 2018 25
Flexible Paxos [Howard et. al. OPODIS 2016]
too conservative
1 2 3 4 5 6 7 Majority quorum Majority quorum
OPODIS 2018 26
Flexible Paxos
Replication Quorums must intersect.
intersect with every Replication Quorum
1 2 3 4 5 6 7 Leader Election Quorum Replication Quorum
OPODIS 2018 27
OPODIS 2018 28
Beirut 2018
exclusive set
edge nodes
An edge‐aware Paxos
Zone 1 Zone 2 Zone 3 Zone 4
OPODIS 2018
Leader Zone
30
Paxos
nodes Edge Paxos
within all zones.
An edge‐aware, mobile Paxos
Zone 1 Zone 2 Zone 3 Zone 4 Leader Election Local replication Local replication Local replication
OPODIS 2018 31
OPODIS 2018 32
Expanding Quorums
quorums
phase
expands to intersect the announced Intent Replication Quorums
OPODIS 2018 33
Expanding Quorums example
Zone 1 Zone 2 Zone 3 Zone 4 Leader Election {intent: zone 1} Local replication Local replication Local replication Leader Election {intent: zone 5} Leader Election expansion
OPODIS 2018
Zone 5
34
35/46
OPODIS 2018
Allowing for Mobility: Leader Handoff
Zone A Zone B Zone C
Leader
relinquish() ‐ current state ‐ slots []
Leader
OPODIS 2018 36
OPODIS 2018 37
new guises.
commitment, etc
OPODIS 2018 38
Origins of Blockchain: Traditional Banking Systems
OPODIS 2018 39
Bitcoin
OPODIS 2018 40
Traditional Banking Systems
Private and Public Digital signatures
Blockchain (basically a linked list!)
OPODIS 2018 41
A Bitcoin Big Picture
SignatureAlice‐Bob Signature…‐Alice Pk‐Bob Sk‐Alice Sign() Pk‐Diana Sign() Sk‐Bob SignatureBob‐Diana Pk‐…. Sign() Sk‐Diana
…….
OPODIS 2018 42
Double Spending
SignatureAlice‐Bob Pk‐Diana SignatureAlice‐Bob Sign() Sk‐Bob Pk‐Marty SignatureBob‐Diana Sk‐Bob SignatureBob‐Marty Sign()
I took her car I took his ring
OPODIS 2018 43
Double Spending Prevention
OPODIS 2018 44
The Ledger (or log)
Blocks are connected through hash‐pointers (SHA‐256)
Hash() Hash() Hash()
OPODIS 2018 45
Making Progress
Consensus
OPODIS 2018 46
Mining Details: Block Creation
TX1 TX2 TXn .
. .
TX1 TX2 TXn .
. .
TX1 TX2 TXn .
. . OPODIS 2018 47
Can Network Nodes Use Consensus?
OPODIS 2018 48
All participants should be known a priori
OPODIS 2018 49
Nakamoto’s Consensus: Proof of Work (PoW)
OPODIS 2018 50
Mining Details: Mining
TX1 TX2 TXn .
. .
TX1 TX2 TXn .
. .
TX1 TX2 TXn .
. .
TX1 TX2 TXn .
.
TXreward Transactions Header Version Previous Block Hash Merkle Tree Root Hash Time Stamp Current Target Bits Nonce
SHA256( ) < D
OPODIS 2018 51
Mining Big Picture
OPODIS 2018 52
Forks: Double Spending
Bob tries to double spend the same coin twice in two transactions
OPODIS 2018 53
Permissioned Blockchain
goal but which do not fully trust each other.
OPODIS 2018 54
Atomic Swaps
up worse off
https://bitcointalk.org/index.php?topic=193281.msg2224949#msg2224949 (2013)
OPODIS 2018 55
Atomic Swap Example
Bob Alice
OPODIS 2018 56
Atomic Swap Example
Bob Alice
s and h
OPODIS 2018 57
Atomic Swap Example
Bob Alice s and h T1 Move X bitcoins to Bob if Bob provides secret s | h = H(s) Bitcoin blockchain T1
OPODIS 2018 58
Atomic Swap Example
Bob Alice s Alice’s X bitcoins are locked in T1’s smart contract Bitcoin blockchain T1 Ethereum blockchain T2 Move Y Ethereum to Alice if Alice provides secret s | h = H(s) T2
OPODIS 2018 59
Atomic Swap Example
Bob Alice s Alice’s X bitcoins are locked in T1’s smart contract Bitcoin blockchain T1 Ethereum blockchain Bob’s Y Ethereum are locked in T2’s smart contract T2
OPODIS 2018 60
Atomic Swap Example
Bob Alice s Alice’s X bitcoins are locked in T1’s smart contract Bitcoin blockchain T1 Ethereum blockchain Bob’s Y Ethereum are locked in T2’s smart contract T2
OPODIS 2018 61
Atomic Swap Example
Bob Alice s Alice’s X bitcoins are locked in T1’s smart contract Bitcoin blockchain T1 Ethereum blockchain Bob’s Y Ethereum are locked in T2’s smart contract T2 s
OPODIS 2018 62
Atomic Swap Example
Bob Alice s Alice’s X bitcoins are locked in T1’s smart contract Bitcoin blockchain T1 Ethereum blockchain Bob’s Y Ethereum are locked in T2’s smart contract T2 s
OPODIS 2018 63
Atomic Swap Example: What can go wrong?
OPODIS 2018 64
Atomic Swap Example: Timelocks
Bob Alice T1: Move X bitcoins to Bob if Bob provides secret s | h = H(s) T2: Move Y Ethereum to Alice if Alice provides secret s | h = H(s) T3: Refund T1 to Alice if Bob does not execute T1 before 48 hours T4: Refund T2 to Bob if Alice does not execute T2 before 24 hours How to determine the time period of a timelock?
OPODIS 2018 65
Timelocks
Bob Alice
OPODIS 2018 66
Atomic Swap Modeling [Herlihy, PODC 2018]
a second party to confirm that the contract has been published
Security and Privacy Data Management Distributed Systems
68/46 OPODIS 2018
Economics