SlideShare a Scribd company logo
1© 2019 All rights reserved.
Distributed SQL Databases
Deconstructed
Understanding Amazon Aurora, Google Spanner & the Spanner Derivatives
Karthik Ranganathan
Sid Choudhury
April 18, 2019
2© 2019 All rights reserved.
Introduction
Karthik Ranganathan
Co-Founder & CTO, YugaByte
Nutanix ♦ Facebook ♦ Microsoft
IIT Madras, University of Texas-Austin
@karthikr
Sid Choudhury
VP Product, YugaByte
AppDynamics ♦ Salesforce ♦ Oracle
IIT Kharagpur, University of Texas-Austin
@SidChoudhury
3© 2019 All rights reserved.
Types of Data Stores
This Talk’s Focus
OLAP OLTP
Write once, Read many
Few concurrent sessions
Long running, ad-hoc queries
Large table scans
Petabyte-scale data storage
Mixed reads & writes
Many concurrent sessions
Single-digit ms query latency
Point reads & short-range scans
Terabyte-scale data storage
4© 2019 All rights reserved.
Examples
Open Source
Proprietary
OLAP OLTP
NoSQL SQL SQLNoSQL
Google
BigTable
Amazon
Aurora
Google
Spanner
This Talk’s Focus
Google
BigQuery
5© 2019 All rights reserved.
Devs 😍 SQL
1. Query Flexibility 💪
– Model data once, change queries as business changes
– Balance modeling richness with performance needs
2. Rich Ecosystem 🔌
– Data modeling & query examples
– Developer IDEs & data visualization tools
– Easy to reuse & build integrations
3. Universal Standard for Data Access
– Learn once, use forever
6© 2019 All rights reserved.
Devs 😡 SQL
1. Large Dataset? 📈
– No horizontal write scalability
– Use manually sharded SQL or non-transactional NoSQL
2. Infrastructure Failures? 🚨
– No native failover & repair
– Use complex replication schemes
3. Multi-Region/Geo-Distributed App? 🌏
– Multi-master deployment is the only option
– Data loss w/ Last Writer Wins (LWW) conflict resolution
7© 2019 All rights reserved.
Distributed SQL = Keep 😍 & Remove 😡
1. SQL Features
– ACID, JOINs, foreign keys, serializable isolation
2. Horizontal Write Scalability
– Scale write throughput by adding/removing nodes
3. Fault Tolerance With High Availability
– Native failover & repair
4. Globally Consistent Writes
– Lower end user latency and tolerate region failures
5. Low Read Latency
– Strongly consistent (aka correct) reads
8© 2019 All rights reserved.
Distributed SQL Architectures - Aurora vs Spanner
Amazon Aurora Google Spanner
“A highly available MySQL and PostgreSQL-compatible
relational database service”
Available on AWS since 2015
“The first horizontally scalable, strongly consistent,
relational database service”
Available on Google Cloud since 2017
Shared Storage Shared Nothing
9© 2019 All rights reserved.
#1 SQL Features
10© 2019 All rights reserved.
Depth of SQL Support
✓ MySQL and PostgreSQL-compatible Subset of MySQL/PostgreSQL features
Amazon Aurora Google Spanner
11© 2019 All rights reserved.
Aurora vs Spanner
Feature Amazon Aurora Google Spanner
SQL Features ✓
Horizontal Write Scalability ✓
Fault Tolerance with HA ✓
Globally Consistent Writes ✓
Low Read Latency
12© 2019 All rights reserved.
#2 Horizontal Write Scalability
13© 2019 All rights reserved.
Amazon Aurora
Single Node SQL on Multi-Zone Distributed Storage
SQL APP
INSERT ROW
❌ Add Primary Instances for Write Scaling
✓ Add Read Replicas for Read Scaling
14© 2019 All rights reserved.
Google Spanner
Multi-Node SQL on Multi-Region Distributed Storage
SQL APP
INSERT ROW3
✓ Add Primary Instances for Write Scaling
✓ Add Read Replicas for Read Scaling
INSERT ROW1
15© 2019 All rights reserved.
Aurora vs Spanner
Feature Amazon Aurora Google Spanner
SQL Features ✓
Horizontal Write Scalability ❌ ✓
Fault Tolerance with HA
Globally Consistent Writes
Low Read Latency
16© 2019 All rights reserved.
#3 Fault Tolerance with HA
17© 2019 All rights reserved.
Amazon Aurora
Native Failover & Repair Through Primary Auto Election
SQL APP
✓ HA When Primary Instance
Fails
✓ HA When Read Replica Fails
INSERT ROW
18© 2019 All rights reserved.
Google Spanner
Native Failover & Repair Through Shard Leader Auto Election
SQL APP
INSERT ROW1
✓ HA When Any Primary Node
Fails
✓ HA When Read Replica Fails
INSERT ROW3
19© 2019 All rights reserved.
Aurora vs Spanner
Feature Amazon Aurora Google Spanner
SQL Features ✓
Horizontal Write Scalability ❌ ✓
Fault Tolerance with HA ✓ ✓
Globally Consistent Writes
Low Read Latency
20© 2019 All rights reserved.
#4 Globally Consistent Writes
21© 2019 All rights reserved.
Amazon Aurora
Multi-Master Last Writer Wins Conflict Resolution Leads to Inconsistencies
SQL APP
SET BALANCE = BALANCE - 10
SQL APP
SET BALANCE = BALANCE - 100
Asynchronous
Replication
Region 1 Region 2
22© 2019 All rights reserved.
Google Spanner
Purpose-Built for Globally Consistent Writes
SQL APP
SET BALANCE =
BALANCE - 10
SQL APP
SET BALANCE =
BALANCE - 100
23© 2019 All rights reserved.
Aurora vs Spanner
Feature Amazon Aurora Google Spanner
SQL Features ✓
Horizontal Write Scalability ❌ ✓
Fault Tolerance with HA ✓ ✓
Globally Consistent Writes ❌ ✓
Low Read Latency
24© 2019 All rights reserved.
#5 Low Read Latency
25© 2019 All rights reserved.
Amazon Aurora
Strongly Consistent Reads Served By Primary Instance
SQL APP
READ ROW
26© 2019 All rights reserved.
Google Spanner
Strongly Consistent Reads Served By Shard Leaders w/o Read Quorum
SQL APP
READ ROW1
27© 2019 All rights reserved.
Aurora vs Spanner
Feature Amazon Aurora Google Spanner
SQL Features ✓
Horizontal Write Scalability ❌ ✓
Fault Tolerance with HA ✓ ✓
Globally Consistent Writes ❌ ✓
Low Read Latency ✓ ✓
28© 2019 All rights reserved.
Battle of Architectures - Spanner Beats Aurora
No Performance & Availability Bottlenecks
Scale to Large Clusters while Remaining Highly Available
Built for Geo-Distributed Apps
Future Proofs Data Tier at Global Businesses
Complex to Engineer
Needs Clock Skew Tracking Across Instances
29© 2019 All rights reserved.
Analyzing Open Source
Spanner Derivatives
30© 2019 All rights reserved.
Spanner Brought to Life in Open Source
31© 2019 All rights reserved.
Design Principles
• CP in CAP Theorem
• Consistent
• Partition Tolerant
• HA on failures
(new leader elected in seconds)
• ACID Transactions
• Single-row linearizability
• Multi-row ACID
• Serializable
• Snapshot
• High Performance
• All layers in C++ to ensure high perf
• Run on large memory machines
• Optimized for SSDs
• Run Anywhere
• No external dependencies
• No atomic clocks
• Bare metal, VM and Kubernetes
32© 2019 All rights reserved.
Functional Architecture
DOCDB
Spanner-Inspired Distributed Document Store
CLOUD NEUTRAL
No Specialized Hardware Needed
YSQL
PostgreSQL-Compatible Distributed SQL API
tablet 1’
tablet 1’
33© 2019 All rights reserved.
Distributed SQL = Keep 😍 & Remove 😡
1. SQL Features
2. Replication Protocol
3. Clock Skew Tracking
4. Transactions Manager
34© 2019 All rights reserved.
Spanner vs. its Open Source Derivatives
Feature Google Spanner YugaByte DB CockroachDB TiDB
Cost Expensive Free Free Free
SQL API Compatibility
Replication Protocol
Clock Skew Tracking
Transaction Manager
Tunable Read Latency
Official Jepsen Tests
35© 2019 All rights reserved.
SQL API Compatibility
36© 2019 All rights reserved.
PostgreSQL Transformed into Distributed SQL
37© 2019 All rights reserved.
Depth of SQL Support
• Current
• Data Types
• Built-in Functions
• Expressions
• JSON Column Type
• Secondary Indexes
• JOINs
• Transactions
• Views
• Future
• Relational Integrity (Foreign Keys)
• Stored Procedures
• Triggers
• Foreign Data Wrappers
• And more ...
38© 2019 All rights reserved.
Spanner vs. its Open Source Derivatives
Feature Google Spanner YugaByte DB CockroachDB TiDB
Cost Expensive Free Free Free
SQL API Compatibility Proprietary PostgreSQL PostgreSQL MySQL
Replication Protocol
Clock Skew Tracking
Transaction Manager
Tunable Read Latency
Official Jepsen Tests
39© 2019 All rights reserved.
Replication Protocol
40© 2019 All rights reserved.
Every Table is Automatically Sharded
tablet 1’
… … …
… … …
… … …
… … …
… … …
SHARDING = AUTOMATIC PARTITIONING OF TABLES
41© 2019 All rights reserved.
Replication Done at Shard Level
tablet 1’
Tablet Peer 1 on Node X
Tablet #1
Tablet Peer 2 on Node Y
Tablet Peer 3 on Node Z
42© 2019 All rights reserved.
Replication uses a Consensus algorithm
tablet 1’
Raft Leader
Uses Raft Algorithm
First elect Tablet Leader
43© 2019 All rights reserved.
Writes in Raft Consensus
tablet 1’
Raft Leader
Writes processed by leader:
Send writes to all peers
Wait for majority to ack
Write
44© 2019 All rights reserved.
Reads in Raft Consensus
tablet 1’
Raft Leader
Reads handled by leader
Uses Leader Leases for performance
Read
45© 2019 All rights reserved.
Spanner vs. its Open Source Derivatives
Feature Google Spanner YugaByte DB CockroachDB TiDB
Cost Expensive Free Free Free
SQL API Compatibility Proprietary PostgreSQL PostgreSQL MySQL
Replication Protocol Paxos Raft Raft Raft
Clock Skew Tracking
Transaction Manager
Tunable Read Latency
Official Jepsen Tests
46© 2019 All rights reserved.
Transactions and Clock Skew
Tracking
47© 2019 All rights reserved.
Multi-Shard Transactions
tablet 1’
k1 and k2 may belong to different shards
BEGIN TXN
UPDATE k1
UPDATE k2
COMMIT
Belong to different Raft groups on completely different nodes
48© 2019 All rights reserved.
What do Distributed Transactions need?
tablet 1’
Updates should get written at the same physical time
Raft Leader Raft Leader
BEGIN TXN
UPDATE k1
UPDATE k2
COMMIT
But how will nodes agree on time?
49© 2019 All rights reserved.
Use a Physical Clock
tablet 1’
You would need an Atomic Clock or two lying around
Atomic Clocks are highly available,
globally synchronized clocks with tight error bounds
Most of my physical clocks are never synchronized
Jeez! I’m fresh out of those.
50© 2019 All rights reserved.
Hybrid Logical Clock or HLC
tablet 1’
Combine coarsely-synchronized physical clocks with Lamport
Clocks to track causal relationships
(physical component, logical component)
synchronized using NTP a monotonic counter
Nodes update HLC on each Raft exchange for things like
heartbeats, leader election and data replication
51© 2019 All rights reserved.
Spanner vs. its Open Source Derivatives
Feature Google Spanner YugaByte DB CockroachDB TiDB
Cost Expensive Free Free Free
SQL API Compatibility Proprietary PostgreSQL PostgreSQL MySQL
Replication Protocol Paxos Raft Raft Raft
Clock Skew Tracking
TrueTime Atomic
Clock
Hybrid Logical Clock +
Max Clock Skew
Hybrid Logical Clock
+ Max Clock Skew
Single Timestamp Gen
⇒ No Tracking Needed
Transaction Manager At Every Node At Every Node At Every Node
Special Node for
Timestamp Generation
Tunable Read Latency
Official Jepsen Tests
52© 2019 All rights reserved.
Miscellaneous
53© 2019 All rights reserved.
Spanner vs. its Open Source Derivatives
Feature Google Spanner YugaByte DB CockroachDB TiDB
Cost Expensive Free Free Free
SQL API Compatibility Proprietary PostgreSQL PostgreSQL MySQL
Replication Protocol Paxos Raft Raft Raft
Clock Skew Tracking
TrueTime Atomic
Clock
Hybrid Logical Clock +
Max Clock Skew
Hybrid Logical Clock
+ Max Clock Skew
Single Timestamp Gen
⇒ No Tracking Needed
Transaction Manager At Every Node At Every Node At Every Node
Special Node for
Timestamp Generation
Tunable Read Latency ✓ ✓ ❌ ❌
Official Jepsen Tests Unknown ✓ ✓ ❌
54© 2019 All rights reserved.
Read more at
blog.yugabyte.com
blog.yugabyte.com/distributed-postgresql-on-a-google-spanner-architecture-storage-layer
Storage Layer
blog.yugabyte.com/distributed-postgresql-on-a-google-spanner-architecture-query-layer
Query Layer
55© 2019 All rights reserved.
Questions?
Try it at docs.yugabyte.com/quick-start
Check us out on GitHub
https://github.com/YugaByte/yugabyte-db

More Related Content

What's hot

Snowflake Datawarehouse Architecturing
Snowflake Datawarehouse ArchitecturingSnowflake Datawarehouse Architecturing
Snowflake Datawarehouse Architecturing
Ishan Bhawantha Hewanayake
 
Introduction to apache spark
Introduction to apache spark Introduction to apache spark
Introduction to apache spark
Aakashdata
 
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudAmazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Noritaka Sekiyama
 
NoSQL databases - An introduction
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introduction
Pooyan Mehrparvar
 
CockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL DatabaseCockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL Database
C4Media
 
Data Engineer's Lunch #83: Strategies for Migration to Apache Iceberg
Data Engineer's Lunch #83: Strategies for Migration to Apache IcebergData Engineer's Lunch #83: Strategies for Migration to Apache Iceberg
Data Engineer's Lunch #83: Strategies for Migration to Apache Iceberg
Anant Corporation
 
Data Lakehouse, Data Mesh, and Data Fabric (r2)
Data Lakehouse, Data Mesh, and Data Fabric (r2)Data Lakehouse, Data Mesh, and Data Fabric (r2)
Data Lakehouse, Data Mesh, and Data Fabric (r2)
James Serra
 
Memory Management in Apache Spark
Memory Management in Apache SparkMemory Management in Apache Spark
Memory Management in Apache Spark
Databricks
 
The Apache Spark File Format Ecosystem
The Apache Spark File Format EcosystemThe Apache Spark File Format Ecosystem
The Apache Spark File Format Ecosystem
Databricks
 
Iceberg: a fast table format for S3
Iceberg: a fast table format for S3Iceberg: a fast table format for S3
Iceberg: a fast table format for S3
DataWorks Summit
 
Large Scale Lakehouse Implementation Using Structured Streaming
Large Scale Lakehouse Implementation Using Structured StreamingLarge Scale Lakehouse Implementation Using Structured Streaming
Large Scale Lakehouse Implementation Using Structured Streaming
Databricks
 
Iceberg + Alluxio for Fast Data Analytics
Iceberg + Alluxio for Fast Data AnalyticsIceberg + Alluxio for Fast Data Analytics
Iceberg + Alluxio for Fast Data Analytics
Alluxio, Inc.
 
The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesThe Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization Opportunities
Databricks
 
Apache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic DatasetsApache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic Datasets
Alluxio, Inc.
 
Best Practices for Building Your Data Lake on AWS
Best Practices for Building Your Data Lake on AWSBest Practices for Building Your Data Lake on AWS
Best Practices for Building Your Data Lake on AWS
Amazon Web Services
 
Making Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta LakeMaking Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta Lake
Databricks
 
Optimizing Delta/Parquet Data Lakes for Apache Spark
Optimizing Delta/Parquet Data Lakes for Apache SparkOptimizing Delta/Parquet Data Lakes for Apache Spark
Optimizing Delta/Parquet Data Lakes for Apache Spark
Databricks
 
The Future of Data Science and Machine Learning at Scale: A Look at MLflow, D...
The Future of Data Science and Machine Learning at Scale: A Look at MLflow, D...The Future of Data Science and Machine Learning at Scale: A Look at MLflow, D...
The Future of Data Science and Machine Learning at Scale: A Look at MLflow, D...
Databricks
 
Changing the game with cloud dw
Changing the game with cloud dwChanging the game with cloud dw
Changing the game with cloud dw
elephantscale
 
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
StreamNative
 

What's hot (20)

Snowflake Datawarehouse Architecturing
Snowflake Datawarehouse ArchitecturingSnowflake Datawarehouse Architecturing
Snowflake Datawarehouse Architecturing
 
Introduction to apache spark
Introduction to apache spark Introduction to apache spark
Introduction to apache spark
 
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudAmazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
 
NoSQL databases - An introduction
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introduction
 
CockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL DatabaseCockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL Database
 
Data Engineer's Lunch #83: Strategies for Migration to Apache Iceberg
Data Engineer's Lunch #83: Strategies for Migration to Apache IcebergData Engineer's Lunch #83: Strategies for Migration to Apache Iceberg
Data Engineer's Lunch #83: Strategies for Migration to Apache Iceberg
 
Data Lakehouse, Data Mesh, and Data Fabric (r2)
Data Lakehouse, Data Mesh, and Data Fabric (r2)Data Lakehouse, Data Mesh, and Data Fabric (r2)
Data Lakehouse, Data Mesh, and Data Fabric (r2)
 
Memory Management in Apache Spark
Memory Management in Apache SparkMemory Management in Apache Spark
Memory Management in Apache Spark
 
The Apache Spark File Format Ecosystem
The Apache Spark File Format EcosystemThe Apache Spark File Format Ecosystem
The Apache Spark File Format Ecosystem
 
Iceberg: a fast table format for S3
Iceberg: a fast table format for S3Iceberg: a fast table format for S3
Iceberg: a fast table format for S3
 
Large Scale Lakehouse Implementation Using Structured Streaming
Large Scale Lakehouse Implementation Using Structured StreamingLarge Scale Lakehouse Implementation Using Structured Streaming
Large Scale Lakehouse Implementation Using Structured Streaming
 
Iceberg + Alluxio for Fast Data Analytics
Iceberg + Alluxio for Fast Data AnalyticsIceberg + Alluxio for Fast Data Analytics
Iceberg + Alluxio for Fast Data Analytics
 
The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesThe Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization Opportunities
 
Apache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic DatasetsApache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic Datasets
 
Best Practices for Building Your Data Lake on AWS
Best Practices for Building Your Data Lake on AWSBest Practices for Building Your Data Lake on AWS
Best Practices for Building Your Data Lake on AWS
 
Making Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta LakeMaking Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta Lake
 
Optimizing Delta/Parquet Data Lakes for Apache Spark
Optimizing Delta/Parquet Data Lakes for Apache SparkOptimizing Delta/Parquet Data Lakes for Apache Spark
Optimizing Delta/Parquet Data Lakes for Apache Spark
 
The Future of Data Science and Machine Learning at Scale: A Look at MLflow, D...
The Future of Data Science and Machine Learning at Scale: A Look at MLflow, D...The Future of Data Science and Machine Learning at Scale: A Look at MLflow, D...
The Future of Data Science and Machine Learning at Scale: A Look at MLflow, D...
 
Changing the game with cloud dw
Changing the game with cloud dwChanging the game with cloud dw
Changing the game with cloud dw
 
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
 

Similar to Distributed SQL Databases Deconstructed

Scale Transactional Apps Across Multiple Regions with Low Latency
Scale Transactional Apps Across Multiple Regions with Low LatencyScale Transactional Apps Across Multiple Regions with Low Latency
Scale Transactional Apps Across Multiple Regions with Low Latency
Yugabyte
 
YugaByte + PKS CloudFoundry Meetup 10/15/2018
YugaByte + PKS CloudFoundry Meetup 10/15/2018YugaByte + PKS CloudFoundry Meetup 10/15/2018
YugaByte + PKS CloudFoundry Meetup 10/15/2018
AlanCaldera
 
Serverless Databases - Amazon DynamoDB and Amazon Aurora Serverless - Demo
Serverless Databases - Amazon DynamoDB and Amazon Aurora Serverless - DemoServerless Databases - Amazon DynamoDB and Amazon Aurora Serverless - Demo
Serverless Databases - Amazon DynamoDB and Amazon Aurora Serverless - Demo
Amazon Web Services
 
AWS Meetup - Sydney - February
AWS Meetup - Sydney - February AWS Meetup - Sydney - February
AWS Meetup - Sydney - February
markghiasy
 
Build data-driven, high-performance, internet-scale applications with AWS dat...
Build data-driven, high-performance, internet-scale applications with AWS dat...Build data-driven, high-performance, internet-scale applications with AWS dat...
Build data-driven, high-performance, internet-scale applications with AWS dat...
Amazon Web Services
 
Building Efficient Pipelines in Apache Spark
Building Efficient Pipelines in Apache SparkBuilding Efficient Pipelines in Apache Spark
Building Efficient Pipelines in Apache Spark
Jeremy Beard
 
How-to-Choose-the-Right-Database-to-Build-High-Performance-Internet-Scale-App...
How-to-Choose-the-Right-Database-to-Build-High-Performance-Internet-Scale-App...How-to-Choose-the-Right-Database-to-Build-High-Performance-Internet-Scale-App...
How-to-Choose-the-Right-Database-to-Build-High-Performance-Internet-Scale-App...
Amazon Web Services
 
What's new in Amazon Aurora - ADB203 - Chicago AWS Summit
What's new in Amazon Aurora - ADB203 - Chicago AWS SummitWhat's new in Amazon Aurora - ADB203 - Chicago AWS Summit
What's new in Amazon Aurora - ADB203 - Chicago AWS Summit
Amazon Web Services
 
Aurora Deep Dive | AWS Floor28
Aurora Deep Dive | AWS Floor28Aurora Deep Dive | AWS Floor28
Aurora Deep Dive | AWS Floor28
Amazon Web Services
 
Amazon Aurora and AWS Database Migration Service
Amazon Aurora and AWS Database Migration ServiceAmazon Aurora and AWS Database Migration Service
Amazon Aurora and AWS Database Migration Service
Amazon Web Services
 
Running Stateful Apps on Kubernetes
Running Stateful Apps on KubernetesRunning Stateful Apps on Kubernetes
Running Stateful Apps on Kubernetes
Yugabyte
 
[REPEAT 1] Deep Dive on Amazon Aurora with MySQL Compatibility (DAT304-R1) - ...
[REPEAT 1] Deep Dive on Amazon Aurora with MySQL Compatibility (DAT304-R1) - ...[REPEAT 1] Deep Dive on Amazon Aurora with MySQL Compatibility (DAT304-R1) - ...
[REPEAT 1] Deep Dive on Amazon Aurora with MySQL Compatibility (DAT304-R1) - ...
Amazon Web Services
 
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech TalksIntroducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
Amazon Web Services
 
Advanced Database Patterns for Kubernetes
Advanced Database Patterns for KubernetesAdvanced Database Patterns for Kubernetes
Advanced Database Patterns for Kubernetes
EDB
 
Breaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdf
Amazon Web Services
 
Going Deep on Amazon Aurora Serverless (DAT427-R1) - AWS re:Invent 2018
Going Deep on Amazon Aurora Serverless (DAT427-R1) - AWS re:Invent 2018Going Deep on Amazon Aurora Serverless (DAT427-R1) - AWS re:Invent 2018
Going Deep on Amazon Aurora Serverless (DAT427-R1) - AWS re:Invent 2018
Amazon Web Services
 
Oracle DBMS vs Amazon RDS vs Amazon Aurora PostgreSQL principali similitudini...
Oracle DBMS vs Amazon RDS vs Amazon Aurora PostgreSQL principali similitudini...Oracle DBMS vs Amazon RDS vs Amazon Aurora PostgreSQL principali similitudini...
Oracle DBMS vs Amazon RDS vs Amazon Aurora PostgreSQL principali similitudini...
Amazon Web Services
 
Scale Up and Modernize Your Database with Amazon Relational Database Service ...
Scale Up and Modernize Your Database with Amazon Relational Database Service ...Scale Up and Modernize Your Database with Amazon Relational Database Service ...
Scale Up and Modernize Your Database with Amazon Relational Database Service ...
Amazon Web Services
 
Immersion Day - Como gerenciar seu catálogo de dados e processo de transform...
Immersion Day -  Como gerenciar seu catálogo de dados e processo de transform...Immersion Day -  Como gerenciar seu catálogo de dados e processo de transform...
Immersion Day - Como gerenciar seu catálogo de dados e processo de transform...
Amazon Web Services LATAM
 
Deep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL UniverseDeep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL Universe
Jignesh Shah
 

Similar to Distributed SQL Databases Deconstructed (20)

Scale Transactional Apps Across Multiple Regions with Low Latency
Scale Transactional Apps Across Multiple Regions with Low LatencyScale Transactional Apps Across Multiple Regions with Low Latency
Scale Transactional Apps Across Multiple Regions with Low Latency
 
YugaByte + PKS CloudFoundry Meetup 10/15/2018
YugaByte + PKS CloudFoundry Meetup 10/15/2018YugaByte + PKS CloudFoundry Meetup 10/15/2018
YugaByte + PKS CloudFoundry Meetup 10/15/2018
 
Serverless Databases - Amazon DynamoDB and Amazon Aurora Serverless - Demo
Serverless Databases - Amazon DynamoDB and Amazon Aurora Serverless - DemoServerless Databases - Amazon DynamoDB and Amazon Aurora Serverless - Demo
Serverless Databases - Amazon DynamoDB and Amazon Aurora Serverless - Demo
 
AWS Meetup - Sydney - February
AWS Meetup - Sydney - February AWS Meetup - Sydney - February
AWS Meetup - Sydney - February
 
Build data-driven, high-performance, internet-scale applications with AWS dat...
Build data-driven, high-performance, internet-scale applications with AWS dat...Build data-driven, high-performance, internet-scale applications with AWS dat...
Build data-driven, high-performance, internet-scale applications with AWS dat...
 
Building Efficient Pipelines in Apache Spark
Building Efficient Pipelines in Apache SparkBuilding Efficient Pipelines in Apache Spark
Building Efficient Pipelines in Apache Spark
 
How-to-Choose-the-Right-Database-to-Build-High-Performance-Internet-Scale-App...
How-to-Choose-the-Right-Database-to-Build-High-Performance-Internet-Scale-App...How-to-Choose-the-Right-Database-to-Build-High-Performance-Internet-Scale-App...
How-to-Choose-the-Right-Database-to-Build-High-Performance-Internet-Scale-App...
 
What's new in Amazon Aurora - ADB203 - Chicago AWS Summit
What's new in Amazon Aurora - ADB203 - Chicago AWS SummitWhat's new in Amazon Aurora - ADB203 - Chicago AWS Summit
What's new in Amazon Aurora - ADB203 - Chicago AWS Summit
 
Aurora Deep Dive | AWS Floor28
Aurora Deep Dive | AWS Floor28Aurora Deep Dive | AWS Floor28
Aurora Deep Dive | AWS Floor28
 
Amazon Aurora and AWS Database Migration Service
Amazon Aurora and AWS Database Migration ServiceAmazon Aurora and AWS Database Migration Service
Amazon Aurora and AWS Database Migration Service
 
Running Stateful Apps on Kubernetes
Running Stateful Apps on KubernetesRunning Stateful Apps on Kubernetes
Running Stateful Apps on Kubernetes
 
[REPEAT 1] Deep Dive on Amazon Aurora with MySQL Compatibility (DAT304-R1) - ...
[REPEAT 1] Deep Dive on Amazon Aurora with MySQL Compatibility (DAT304-R1) - ...[REPEAT 1] Deep Dive on Amazon Aurora with MySQL Compatibility (DAT304-R1) - ...
[REPEAT 1] Deep Dive on Amazon Aurora with MySQL Compatibility (DAT304-R1) - ...
 
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech TalksIntroducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
 
Advanced Database Patterns for Kubernetes
Advanced Database Patterns for KubernetesAdvanced Database Patterns for Kubernetes
Advanced Database Patterns for Kubernetes
 
Breaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdf
 
Going Deep on Amazon Aurora Serverless (DAT427-R1) - AWS re:Invent 2018
Going Deep on Amazon Aurora Serverless (DAT427-R1) - AWS re:Invent 2018Going Deep on Amazon Aurora Serverless (DAT427-R1) - AWS re:Invent 2018
Going Deep on Amazon Aurora Serverless (DAT427-R1) - AWS re:Invent 2018
 
Oracle DBMS vs Amazon RDS vs Amazon Aurora PostgreSQL principali similitudini...
Oracle DBMS vs Amazon RDS vs Amazon Aurora PostgreSQL principali similitudini...Oracle DBMS vs Amazon RDS vs Amazon Aurora PostgreSQL principali similitudini...
Oracle DBMS vs Amazon RDS vs Amazon Aurora PostgreSQL principali similitudini...
 
Scale Up and Modernize Your Database with Amazon Relational Database Service ...
Scale Up and Modernize Your Database with Amazon Relational Database Service ...Scale Up and Modernize Your Database with Amazon Relational Database Service ...
Scale Up and Modernize Your Database with Amazon Relational Database Service ...
 
Immersion Day - Como gerenciar seu catálogo de dados e processo de transform...
Immersion Day -  Como gerenciar seu catálogo de dados e processo de transform...Immersion Day -  Como gerenciar seu catálogo de dados e processo de transform...
Immersion Day - Como gerenciar seu catálogo de dados e processo de transform...
 
Deep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL UniverseDeep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL Universe
 

Recently uploaded

BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
vrstrong314
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 

Recently uploaded (20)

BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 

Distributed SQL Databases Deconstructed

  • 1. 1© 2019 All rights reserved. Distributed SQL Databases Deconstructed Understanding Amazon Aurora, Google Spanner & the Spanner Derivatives Karthik Ranganathan Sid Choudhury April 18, 2019
  • 2. 2© 2019 All rights reserved. Introduction Karthik Ranganathan Co-Founder & CTO, YugaByte Nutanix ♦ Facebook ♦ Microsoft IIT Madras, University of Texas-Austin @karthikr Sid Choudhury VP Product, YugaByte AppDynamics ♦ Salesforce ♦ Oracle IIT Kharagpur, University of Texas-Austin @SidChoudhury
  • 3. 3© 2019 All rights reserved. Types of Data Stores This Talk’s Focus OLAP OLTP Write once, Read many Few concurrent sessions Long running, ad-hoc queries Large table scans Petabyte-scale data storage Mixed reads & writes Many concurrent sessions Single-digit ms query latency Point reads & short-range scans Terabyte-scale data storage
  • 4. 4© 2019 All rights reserved. Examples Open Source Proprietary OLAP OLTP NoSQL SQL SQLNoSQL Google BigTable Amazon Aurora Google Spanner This Talk’s Focus Google BigQuery
  • 5. 5© 2019 All rights reserved. Devs 😍 SQL 1. Query Flexibility 💪 – Model data once, change queries as business changes – Balance modeling richness with performance needs 2. Rich Ecosystem 🔌 – Data modeling & query examples – Developer IDEs & data visualization tools – Easy to reuse & build integrations 3. Universal Standard for Data Access – Learn once, use forever
  • 6. 6© 2019 All rights reserved. Devs 😡 SQL 1. Large Dataset? 📈 – No horizontal write scalability – Use manually sharded SQL or non-transactional NoSQL 2. Infrastructure Failures? 🚨 – No native failover & repair – Use complex replication schemes 3. Multi-Region/Geo-Distributed App? 🌏 – Multi-master deployment is the only option – Data loss w/ Last Writer Wins (LWW) conflict resolution
  • 7. 7© 2019 All rights reserved. Distributed SQL = Keep 😍 & Remove 😡 1. SQL Features – ACID, JOINs, foreign keys, serializable isolation 2. Horizontal Write Scalability – Scale write throughput by adding/removing nodes 3. Fault Tolerance With High Availability – Native failover & repair 4. Globally Consistent Writes – Lower end user latency and tolerate region failures 5. Low Read Latency – Strongly consistent (aka correct) reads
  • 8. 8© 2019 All rights reserved. Distributed SQL Architectures - Aurora vs Spanner Amazon Aurora Google Spanner “A highly available MySQL and PostgreSQL-compatible relational database service” Available on AWS since 2015 “The first horizontally scalable, strongly consistent, relational database service” Available on Google Cloud since 2017 Shared Storage Shared Nothing
  • 9. 9© 2019 All rights reserved. #1 SQL Features
  • 10. 10© 2019 All rights reserved. Depth of SQL Support ✓ MySQL and PostgreSQL-compatible Subset of MySQL/PostgreSQL features Amazon Aurora Google Spanner
  • 11. 11© 2019 All rights reserved. Aurora vs Spanner Feature Amazon Aurora Google Spanner SQL Features ✓ Horizontal Write Scalability ✓ Fault Tolerance with HA ✓ Globally Consistent Writes ✓ Low Read Latency
  • 12. 12© 2019 All rights reserved. #2 Horizontal Write Scalability
  • 13. 13© 2019 All rights reserved. Amazon Aurora Single Node SQL on Multi-Zone Distributed Storage SQL APP INSERT ROW ❌ Add Primary Instances for Write Scaling ✓ Add Read Replicas for Read Scaling
  • 14. 14© 2019 All rights reserved. Google Spanner Multi-Node SQL on Multi-Region Distributed Storage SQL APP INSERT ROW3 ✓ Add Primary Instances for Write Scaling ✓ Add Read Replicas for Read Scaling INSERT ROW1
  • 15. 15© 2019 All rights reserved. Aurora vs Spanner Feature Amazon Aurora Google Spanner SQL Features ✓ Horizontal Write Scalability ❌ ✓ Fault Tolerance with HA Globally Consistent Writes Low Read Latency
  • 16. 16© 2019 All rights reserved. #3 Fault Tolerance with HA
  • 17. 17© 2019 All rights reserved. Amazon Aurora Native Failover & Repair Through Primary Auto Election SQL APP ✓ HA When Primary Instance Fails ✓ HA When Read Replica Fails INSERT ROW
  • 18. 18© 2019 All rights reserved. Google Spanner Native Failover & Repair Through Shard Leader Auto Election SQL APP INSERT ROW1 ✓ HA When Any Primary Node Fails ✓ HA When Read Replica Fails INSERT ROW3
  • 19. 19© 2019 All rights reserved. Aurora vs Spanner Feature Amazon Aurora Google Spanner SQL Features ✓ Horizontal Write Scalability ❌ ✓ Fault Tolerance with HA ✓ ✓ Globally Consistent Writes Low Read Latency
  • 20. 20© 2019 All rights reserved. #4 Globally Consistent Writes
  • 21. 21© 2019 All rights reserved. Amazon Aurora Multi-Master Last Writer Wins Conflict Resolution Leads to Inconsistencies SQL APP SET BALANCE = BALANCE - 10 SQL APP SET BALANCE = BALANCE - 100 Asynchronous Replication Region 1 Region 2
  • 22. 22© 2019 All rights reserved. Google Spanner Purpose-Built for Globally Consistent Writes SQL APP SET BALANCE = BALANCE - 10 SQL APP SET BALANCE = BALANCE - 100
  • 23. 23© 2019 All rights reserved. Aurora vs Spanner Feature Amazon Aurora Google Spanner SQL Features ✓ Horizontal Write Scalability ❌ ✓ Fault Tolerance with HA ✓ ✓ Globally Consistent Writes ❌ ✓ Low Read Latency
  • 24. 24© 2019 All rights reserved. #5 Low Read Latency
  • 25. 25© 2019 All rights reserved. Amazon Aurora Strongly Consistent Reads Served By Primary Instance SQL APP READ ROW
  • 26. 26© 2019 All rights reserved. Google Spanner Strongly Consistent Reads Served By Shard Leaders w/o Read Quorum SQL APP READ ROW1
  • 27. 27© 2019 All rights reserved. Aurora vs Spanner Feature Amazon Aurora Google Spanner SQL Features ✓ Horizontal Write Scalability ❌ ✓ Fault Tolerance with HA ✓ ✓ Globally Consistent Writes ❌ ✓ Low Read Latency ✓ ✓
  • 28. 28© 2019 All rights reserved. Battle of Architectures - Spanner Beats Aurora No Performance & Availability Bottlenecks Scale to Large Clusters while Remaining Highly Available Built for Geo-Distributed Apps Future Proofs Data Tier at Global Businesses Complex to Engineer Needs Clock Skew Tracking Across Instances
  • 29. 29© 2019 All rights reserved. Analyzing Open Source Spanner Derivatives
  • 30. 30© 2019 All rights reserved. Spanner Brought to Life in Open Source
  • 31. 31© 2019 All rights reserved. Design Principles • CP in CAP Theorem • Consistent • Partition Tolerant • HA on failures (new leader elected in seconds) • ACID Transactions • Single-row linearizability • Multi-row ACID • Serializable • Snapshot • High Performance • All layers in C++ to ensure high perf • Run on large memory machines • Optimized for SSDs • Run Anywhere • No external dependencies • No atomic clocks • Bare metal, VM and Kubernetes
  • 32. 32© 2019 All rights reserved. Functional Architecture DOCDB Spanner-Inspired Distributed Document Store CLOUD NEUTRAL No Specialized Hardware Needed YSQL PostgreSQL-Compatible Distributed SQL API tablet 1’ tablet 1’
  • 33. 33© 2019 All rights reserved. Distributed SQL = Keep 😍 & Remove 😡 1. SQL Features 2. Replication Protocol 3. Clock Skew Tracking 4. Transactions Manager
  • 34. 34© 2019 All rights reserved. Spanner vs. its Open Source Derivatives Feature Google Spanner YugaByte DB CockroachDB TiDB Cost Expensive Free Free Free SQL API Compatibility Replication Protocol Clock Skew Tracking Transaction Manager Tunable Read Latency Official Jepsen Tests
  • 35. 35© 2019 All rights reserved. SQL API Compatibility
  • 36. 36© 2019 All rights reserved. PostgreSQL Transformed into Distributed SQL
  • 37. 37© 2019 All rights reserved. Depth of SQL Support • Current • Data Types • Built-in Functions • Expressions • JSON Column Type • Secondary Indexes • JOINs • Transactions • Views • Future • Relational Integrity (Foreign Keys) • Stored Procedures • Triggers • Foreign Data Wrappers • And more ...
  • 38. 38© 2019 All rights reserved. Spanner vs. its Open Source Derivatives Feature Google Spanner YugaByte DB CockroachDB TiDB Cost Expensive Free Free Free SQL API Compatibility Proprietary PostgreSQL PostgreSQL MySQL Replication Protocol Clock Skew Tracking Transaction Manager Tunable Read Latency Official Jepsen Tests
  • 39. 39© 2019 All rights reserved. Replication Protocol
  • 40. 40© 2019 All rights reserved. Every Table is Automatically Sharded tablet 1’ … … … … … … … … … … … … … … … SHARDING = AUTOMATIC PARTITIONING OF TABLES
  • 41. 41© 2019 All rights reserved. Replication Done at Shard Level tablet 1’ Tablet Peer 1 on Node X Tablet #1 Tablet Peer 2 on Node Y Tablet Peer 3 on Node Z
  • 42. 42© 2019 All rights reserved. Replication uses a Consensus algorithm tablet 1’ Raft Leader Uses Raft Algorithm First elect Tablet Leader
  • 43. 43© 2019 All rights reserved. Writes in Raft Consensus tablet 1’ Raft Leader Writes processed by leader: Send writes to all peers Wait for majority to ack Write
  • 44. 44© 2019 All rights reserved. Reads in Raft Consensus tablet 1’ Raft Leader Reads handled by leader Uses Leader Leases for performance Read
  • 45. 45© 2019 All rights reserved. Spanner vs. its Open Source Derivatives Feature Google Spanner YugaByte DB CockroachDB TiDB Cost Expensive Free Free Free SQL API Compatibility Proprietary PostgreSQL PostgreSQL MySQL Replication Protocol Paxos Raft Raft Raft Clock Skew Tracking Transaction Manager Tunable Read Latency Official Jepsen Tests
  • 46. 46© 2019 All rights reserved. Transactions and Clock Skew Tracking
  • 47. 47© 2019 All rights reserved. Multi-Shard Transactions tablet 1’ k1 and k2 may belong to different shards BEGIN TXN UPDATE k1 UPDATE k2 COMMIT Belong to different Raft groups on completely different nodes
  • 48. 48© 2019 All rights reserved. What do Distributed Transactions need? tablet 1’ Updates should get written at the same physical time Raft Leader Raft Leader BEGIN TXN UPDATE k1 UPDATE k2 COMMIT But how will nodes agree on time?
  • 49. 49© 2019 All rights reserved. Use a Physical Clock tablet 1’ You would need an Atomic Clock or two lying around Atomic Clocks are highly available, globally synchronized clocks with tight error bounds Most of my physical clocks are never synchronized Jeez! I’m fresh out of those.
  • 50. 50© 2019 All rights reserved. Hybrid Logical Clock or HLC tablet 1’ Combine coarsely-synchronized physical clocks with Lamport Clocks to track causal relationships (physical component, logical component) synchronized using NTP a monotonic counter Nodes update HLC on each Raft exchange for things like heartbeats, leader election and data replication
  • 51. 51© 2019 All rights reserved. Spanner vs. its Open Source Derivatives Feature Google Spanner YugaByte DB CockroachDB TiDB Cost Expensive Free Free Free SQL API Compatibility Proprietary PostgreSQL PostgreSQL MySQL Replication Protocol Paxos Raft Raft Raft Clock Skew Tracking TrueTime Atomic Clock Hybrid Logical Clock + Max Clock Skew Hybrid Logical Clock + Max Clock Skew Single Timestamp Gen ⇒ No Tracking Needed Transaction Manager At Every Node At Every Node At Every Node Special Node for Timestamp Generation Tunable Read Latency Official Jepsen Tests
  • 52. 52© 2019 All rights reserved. Miscellaneous
  • 53. 53© 2019 All rights reserved. Spanner vs. its Open Source Derivatives Feature Google Spanner YugaByte DB CockroachDB TiDB Cost Expensive Free Free Free SQL API Compatibility Proprietary PostgreSQL PostgreSQL MySQL Replication Protocol Paxos Raft Raft Raft Clock Skew Tracking TrueTime Atomic Clock Hybrid Logical Clock + Max Clock Skew Hybrid Logical Clock + Max Clock Skew Single Timestamp Gen ⇒ No Tracking Needed Transaction Manager At Every Node At Every Node At Every Node Special Node for Timestamp Generation Tunable Read Latency ✓ ✓ ❌ ❌ Official Jepsen Tests Unknown ✓ ✓ ❌
  • 54. 54© 2019 All rights reserved. Read more at blog.yugabyte.com blog.yugabyte.com/distributed-postgresql-on-a-google-spanner-architecture-storage-layer Storage Layer blog.yugabyte.com/distributed-postgresql-on-a-google-spanner-architecture-query-layer Query Layer
  • 55. 55© 2019 All rights reserved. Questions? Try it at docs.yugabyte.com/quick-start Check us out on GitHub https://github.com/YugaByte/yugabyte-db