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-replication
5. Introduction
Introduction
A twist on CAP
Pick any Two?
ACID
Relational Database
Synchronous replication
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 2 / 29
6. Introduction
Introduction
A twist on CAP
Pick any Two?
ACID
Relational Database
Synchronous replication
Solution: Don’t have to pick
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 2 / 29
7. Introduction
Introduction
A twist on CAP
Pick any Two?
ACID
Relational Database
Synchronous replication
Solution: Don’t have to pick
Interdependency
CAP and latency
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 2 / 29
11. Introduction
RAS
Why Synchronous
Symmetry
Easier to manage and conceive
Build once, deploy everywhere!
Latency!
Do we need ACID?
Depends!
Concurrent workload
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 3 / 29
12. Introduction
RAS
Why Synchronous
Symmetry
Easier to manage and conceive
Build once, deploy everywhere!
Latency!
Do we need ACID?
Depends!
Concurrent workload
Relational database
Can it be a KV/document store?
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 3 / 29
13. Introduction
RAS
Why Synchronous
Symmetry
Easier to manage and conceive
Build once, deploy everywhere!
Latency!
Do we need ACID?
Depends!
Concurrent workload
Relational database
Can it be a KV/document store?
Everyone wants SQL though.
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 3 / 29
14. Introduction
RAS
Why Synchronous
Symmetry
Easier to manage and conceive
Build once, deploy everywhere!
Latency!
Do we need ACID?
Depends!
Concurrent workload
Relational database
Can it be a KV/document store?
Everyone wants SQL though.
Beats every other API!
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 3 / 29
15. Review
Contemporary systems
PXC/Galera
NDB Cluster
Google F1
Others - PostGreSQL, VoltDB, FoundationDB
Not talking of comparisons/benchmarks.
Apples and Pineapples!
(Since they are all clusters)
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 4 / 29
16. Review
Family of Synchronous Systems
Transactional replication
Overhead and workarounds
One-copy equivalence
NDB: 2 PC
Virtual Synchrony
Extended Virtual Synchrony: Galera
Multi-phase
Paxos: Google F1
Also 2PC
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 5 / 29
18. Review Architecture
Storage
Unbundling of translation and data
Different strategies
Spanner
CFS underneath
Provides guarantees in replication
Makes it more of a binary system
Hierarchical storage
NDB
Separatation of data and management nodes
Still a storage engine
Hybrid storage
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 7 / 29
19. Review Architecture
Storage
WSREP
Plugin system for Galera Provider
Provides the storage - InnoDB
More tightly bound
In-memory and ring-buffers
Transaction awareness
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 8 / 29
21. Review Architecture
Relational Database
NoSQL / NewSQL / OldSQL
New wine in old bottle?
Approach of NewSQL and SQL wrt. ACIDity.
Pros and Cons
Does it fit
Does NoSQL meet RAS
Adventures with eventual consistency
Strict definitions of it
Instrumentation
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 10 / 29
22. Review Architecture
Relational Database
Role of API
Presence of Layer
Nature of storage
API defines data model?
NoSQL access to SQL
ORM
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 11 / 29
23. Review Architecture
Degree of Synchronicity
Latency is a killer!
Amortization of latency
Does Synchronicity imply Causality?
Commutative writesets
Role of Applications/Architecture
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 12 / 29
25. Review Architecture
ACIDity
Does ACID require synchronous OR
Does 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 ACID
database?
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 14 / 29
27. Review Architecture
Locking
Conflicts and Deadlocks
Limiting factor: Amdahl’s
Scales 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
29. Review Architecture
Locking
Externalities
GPS clock - Google F1
Controlled conditions
Limitations
Lock Managers: Zookeeper, Chubby
Lamport timestamps!
A Zeitgeiber!
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 18 / 29
30. Review Architecture
Integration
Scaling the system upwards
Composable Transactions
XA Support
Extensibility
Adding other storage engines: PSA
Geographic Replication
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 19 / 29
31. Review Architecture
Sharding
Systems that support it
Issues of Quorum
Adding support externally
Spider Engine
Cluster of clusters
MySQL Fabric?
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 20 / 29
32. Review Architecture
Transition
From single node to a cluster
Idempotency of transactions
Change of mind
Integration with Async replication
Loss of key parts
Degree of ACIDity
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 21 / 29
33. Review Architecture
Operational usage
Resource Manager
Moving parts
Reduces the confusion
Backups
Impact on cluster operations
Logical backups
Physical backups
NoSQL interface
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 22 / 29
34. Review Architecture
Operational usage
Integration with other HA
Load balancers and Proxies
Fencing / STONITH
Resource Managers
Pacemaker
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 23 / 29
35. Review Architecture
Qualitative Analysis
Active analysis
System-centric
Convergence time
Passive analysis
Distributed tracing
Dangling reads
Client-centric
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 24 / 29
38. Epilogue
Limitations
None!
Silver bullet?
Where you may want Async
Where delay can help
Schema changes
Compromise on strictness/features
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 26 / 29
40. Epilogue
Further Reading
Is this a solved problem? May be not.
The Dangers of Replication and a Solution
Replication Using Group Communication Over a Partitioned
Network
Transaction Processing: Concepts and Techniques
F1: A Distributed SQL Database That Scales
Eventually Consistent: Not What You Were Expecting?
The Layer Concept
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 27 / 29
41. Epilogue
Related Talks
Percona XtraDB Cluster / Galera in Practice - 2014 edition
F1: Google’s Next Generation RDBMS
Galera Cluster New Features
Write Conflicts in Multi-Master Replication Topologies
Migrate an infrastructure to Galera Cluster
Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 28 / 29