acidic clusters: review of current relation databases with synchronous replication
DESCRIPTION
These are the slides from the talk given at Percona Live 2014 MySQL Conference and Expo (PLMCE): http://www.percona.com/live/mysql-conference-2014/sessions/acidic-clusters-review-current-relational-databases-synchronous-replicationTRANSCRIPT
![Page 1: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/1.jpg)
ACIDic ClustersReview of current relational databases with synchronous replication.
Raghavendra [email protected]
Percona LLC
2nd April, 2014
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 1 / 29
![Page 2: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/2.jpg)
Outline
1 Introduction
2 ReviewArchitecture
3 Epilogue
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 1 / 29
![Page 3: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/3.jpg)
Outline
1 Introduction
2 ReviewArchitecture
3 Epilogue
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 1 / 29
![Page 4: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/4.jpg)
Outline
1 Introduction
2 ReviewArchitecture
3 Epilogue
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 1 / 29
![Page 5: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/5.jpg)
Introduction
Introduction
A twist on CAP
Pick any Two?
ACID
Relational Database
Synchronous replication
Solution: Don’t have to pickInterdependencyCAP and latency
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 2 / 29
![Page 6: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/6.jpg)
Introduction
Introduction
A twist on CAP
Pick any Two?
ACID
Relational Database
Synchronous replication
Solution: Don’t have to pick
InterdependencyCAP and latency
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 2 / 29
![Page 7: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/7.jpg)
Introduction
Introduction
A twist on CAP
Pick any Two?
ACID
Relational Database
Synchronous replication
Solution: Don’t have to pickInterdependencyCAP and latency
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 2 / 29
![Page 8: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/8.jpg)
Introduction
RAS
Why Synchronous
SymmetryEasier to manage and conceiveBuild once, deploy everywhere!
Latency!
Do we need ACID?
Depends!Concurrent workload
Relational databaseCan it be a KV/document store?Everyone wants SQL though.Beats every other API!
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 3 / 29
![Page 9: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/9.jpg)
Introduction
RAS
Why SynchronousSymmetry
Easier to manage and conceiveBuild once, deploy everywhere!
Latency!
Do we need ACID?
Depends!Concurrent workload
Relational databaseCan it be a KV/document store?Everyone wants SQL though.Beats every other API!
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 3 / 29
![Page 10: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/10.jpg)
Introduction
RAS
Why SynchronousSymmetry
Easier to manage and conceiveBuild once, deploy everywhere!
Latency!
Do we need ACID?
Depends!Concurrent workload
Relational databaseCan it be a KV/document store?Everyone wants SQL though.Beats every other API!
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 3 / 29
![Page 11: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/11.jpg)
Introduction
RAS
Why SynchronousSymmetry
Easier to manage and conceiveBuild once, deploy everywhere!
Latency!
Do we need ACID?
Depends!Concurrent workload
Relational databaseCan it be a KV/document store?Everyone wants SQL though.Beats every other API!
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 3 / 29
![Page 12: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/12.jpg)
Introduction
RAS
Why SynchronousSymmetry
Easier to manage and conceiveBuild once, deploy everywhere!
Latency!
Do we need ACID?
Depends!Concurrent workload
Relational databaseCan it be a KV/document store?
Everyone wants SQL though.Beats every other API!
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 3 / 29
![Page 13: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/13.jpg)
Introduction
RAS
Why SynchronousSymmetry
Easier to manage and conceiveBuild once, deploy everywhere!
Latency!
Do we need ACID?
Depends!Concurrent workload
Relational databaseCan it be a KV/document store?Everyone wants SQL though.
Beats every other API!
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 3 / 29
![Page 14: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/14.jpg)
Introduction
RAS
Why SynchronousSymmetry
Easier to manage and conceiveBuild once, deploy everywhere!
Latency!
Do we need ACID?
Depends!Concurrent workload
Relational databaseCan it be a KV/document store?Everyone wants SQL though.Beats every other API!
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 3 / 29
![Page 15: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/15.jpg)
Review
Contemporary systems
PXC/GaleraNDB ClusterGoogle F1Others - PostGreSQL, VoltDB, FoundationDBNot talking of comparisons/benchmarks.Apples and Pineapples!(Since they are all clusters)
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 4 / 29
![Page 16: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/16.jpg)
Review
Family of Synchronous Systems
Transactional replicationOverhead and workaroundsOne-copy equivalenceNDB: 2 PC
Virtual SynchronyExtended Virtual Synchrony: Galera
Multi-phasePaxos: Google F1Also 2PC
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 5 / 29
![Page 17: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/17.jpg)
Review Architecture
Layers
NecessityStrengthsDegrees of freedom
Monolithic v/s Layered
Monolithic - GaleraLayered - F1/Spanner, NDB(?)
ImplicationsFailuresDebugging
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 6 / 29
![Page 18: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/18.jpg)
Review Architecture
Storage
Unbundling of translation and dataDifferent strategies
SpannerCFS underneathProvides guarantees in replicationMakes it more of a binary system
Hierarchical storageNDB
Separatation of data and management nodesStill a storage engineHybrid storage
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 7 / 29
![Page 19: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/19.jpg)
Review Architecture
Storage
WSREPPlugin system for Galera Provider
Provides the storage - InnoDBMore tightly boundIn-memory and ring-buffers
Transaction awareness
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 8 / 29
![Page 20: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/20.jpg)
Review Architecture
Storage
StatelessnessVirtual Synchrony
Causality
Loose/Tight BindingConsequences
Co-ordination issueFlexibilityTransitive support of featuresUncoupled relation
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 9 / 29
![Page 21: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/21.jpg)
Review Architecture
Relational Database
NoSQL / NewSQL / OldSQLNew wine in old bottle?Approach of NewSQL and SQL wrt. ACIDity.
Pros and ConsDoes it fit
Does NoSQL meet RASAdventures with eventual consistencyStrict definitions of itInstrumentation
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 10 / 29
![Page 22: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/22.jpg)
Review Architecture
Relational Database
Role of APIPresence of LayerNature of storageAPI defines data model?
NoSQL access to SQLORM
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 11 / 29
![Page 23: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/23.jpg)
Review Architecture
Degree of Synchronicity
Latency is a killer!Amortization of latency
Does Synchronicity imply Causality?Commutative writesetsRole of Applications/Architecture
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 12 / 29
![Page 24: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/24.jpg)
Review Architecture
ACIDity
ACIDity test?
MVCCStrong relation with Synchronous Replication
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 13 / 29
![Page 25: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/25.jpg)
Review Architecture
ACIDity
Does ACID require synchronous ORDoes Synchronous demand ACIDity?
Reconciliation requires it.Can be very expensive without it.Rollbacks need to be handled correctly.Cost of this.
is ACID possible without Relational semantics?Can filesystems with replication work without substrate of ACIDdatabase?
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 14 / 29
![Page 26: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/26.jpg)
Review Architecture
Locking
Optimistic ConcurrencyReduce communication
WWW/HTTPSoftware Transactional Memory
Lock elisionMore natural to Databases
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 15 / 29
![Page 27: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/27.jpg)
Review Architecture
Locking
Conflicts and DeadlocksLimiting factor: Amdahl’sScales with number of nodes and size of transactions
=> Not linearly - quadratic and quinary in some cases=> Cannot be strictly bound - other factors=> Only a strict lower bound
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 16 / 29
![Page 28: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/28.jpg)
Review Architecture
Locking
Pessimistic LockingPerformanceNetwork Overhead
More roundtripsPipeline/Batching
Hybrid approachSwitching
Granularity of Locking
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 17 / 29
![Page 29: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/29.jpg)
Review Architecture
Locking
ExternalitiesGPS clock - Google F1Controlled conditionsLimitationsLock Managers: Zookeeper, Chubby
Lamport timestamps!A Zeitgeiber!
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 18 / 29
![Page 30: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/30.jpg)
Review Architecture
Integration
Scaling the system upwardsComposable TransactionsXA SupportExtensibility
Adding other storage engines: PSA
Geographic Replication
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 19 / 29
![Page 31: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/31.jpg)
Review Architecture
Sharding
Systems that support itIssues of QuorumAdding support externally
Spider EngineCluster of clustersMySQL Fabric?
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 20 / 29
![Page 32: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/32.jpg)
Review Architecture
Transition
From single node to a clusterIdempotency of transactionsChange of mindIntegration with Async replicationLoss of key parts
Degree of ACIDity
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 21 / 29
![Page 33: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/33.jpg)
Review Architecture
Operational usage
Resource ManagerMoving partsReduces the confusion
BackupsImpact on cluster operationsLogical backupsPhysical backupsNoSQL interface
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 22 / 29
![Page 34: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/34.jpg)
Review Architecture
Operational usage
Integration with other HALoad balancers and ProxiesFencing / STONITHResource Managers
Pacemaker
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 23 / 29
![Page 35: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/35.jpg)
Review Architecture
Qualitative Analysis
Active analysisSystem-centricConvergence time
Passive analysisDistributed tracingDangling readsClient-centric
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 24 / 29
![Page 36: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/36.jpg)
Review Architecture
Qualitative Analysis
GuaranteesLatency and stalenessMonotonic readsCausalityk|delta - atomicity
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 25 / 29
![Page 37: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/37.jpg)
Epilogue
Limitations
None!
Silver bullet?Where you may want AsyncWhere delay can helpSchema changesCompromise on strictness/features
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 26 / 29
![Page 38: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/38.jpg)
Epilogue
Limitations
None!Silver bullet?Where you may want AsyncWhere delay can helpSchema changesCompromise on strictness/features
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 26 / 29
![Page 39: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/39.jpg)
Epilogue
Further Reading
Is this a solved problem?
May be not.The Dangers of Replication and a SolutionReplication Using Group Communication Over a PartitionedNetworkTransaction Processing: Concepts and TechniquesF1: A Distributed SQL Database That ScalesEventually Consistent: Not What You Were Expecting?The Layer Concept
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 27 / 29
![Page 40: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/40.jpg)
Epilogue
Further Reading
Is this a solved problem? May be not.The Dangers of Replication and a SolutionReplication Using Group Communication Over a PartitionedNetworkTransaction Processing: Concepts and TechniquesF1: A Distributed SQL Database That ScalesEventually Consistent: Not What You Were Expecting?The Layer Concept
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 27 / 29
![Page 41: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/41.jpg)
Epilogue
Related Talks
Percona XtraDB Cluster / Galera in Practice - 2014 editionF1: Google’s Next Generation RDBMSGalera Cluster New FeaturesWrite Conflicts in Multi-Master Replication TopologiesMigrate an infrastructure to Galera Cluster
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 28 / 29
![Page 42: ACIDic Clusters: Review of current relation databases with synchronous replication](https://reader034.vdocuments.us/reader034/viewer/2022042613/554a5c53b4c905572f8b5028/html5/thumbnails/42.jpg)
Epilogue
Summary
QuestionsTheories
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 29 / 29