acidic clusters: review of current relation databases with synchronous replication

42
ACIDic Clusters Review of current relational databases with synchronous replication. Raghavendra Prabhu [email protected] Percona LLC 2nd April, 2014 Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 1 / 29

Upload: raghavendra-prabhu

Post on 07-May-2015

746 views

Category:

Engineering


5 download

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-replication

TRANSCRIPT

Page 1: 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

Page 2: ACIDic Clusters: Review of current relation databases with synchronous replication

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 42: ACIDic Clusters: Review of current relation databases with synchronous replication

Epilogue

Summary

QuestionsTheories

Raghavendra Prabhu (Percona) ACIDic Clusters 2nd April, 2014 29 / 29