ACIDic Clusters: Review of current relation databases with synchronous replication
-
Upload
raghavendra-prabhu -
Category
Engineering
-
view
746 -
download
5
description
Transcript of ACIDic Clusters: Review of current relation databases with synchronous replication
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
Outline
1 Introduction
2 ReviewArchitecture
3 Epilogue
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 1 / 29
Outline
1 Introduction
2 ReviewArchitecture
3 Epilogue
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 1 / 29
Outline
1 Introduction
2 ReviewArchitecture
3 Epilogue
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 1 / 29
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Review Architecture
ACIDity
ACIDity test?
MVCCStrong relation with Synchronous Replication
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 13 / 29
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
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
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
Review Architecture
Locking
Pessimistic LockingPerformanceNetwork Overhead
More roundtripsPipeline/Batching
Hybrid approachSwitching
Granularity of Locking
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 17 / 29
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
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
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
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
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
Review Architecture
Operational usage
Integration with other HALoad balancers and ProxiesFencing / STONITHResource Managers
Pacemaker
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 23 / 29
Review Architecture
Qualitative Analysis
Active analysisSystem-centricConvergence time
Passive analysisDistributed tracingDangling readsClient-centric
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 24 / 29
Review Architecture
Qualitative Analysis
GuaranteesLatency and stalenessMonotonic readsCausalityk|delta - atomicity
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 25 / 29
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
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
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
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
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
Epilogue
Summary
QuestionsTheories
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 29 / 29