SlideShare a Scribd company logo
1 of 73
Download to read offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Chayan Biswas
cbbiswas@amazon.com
Sr. Product Manager, Amazon Aurora
SRV308
Deep Dive on Amazon Aurora
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
• Aurora overview
• Performance improvements
• Availability improvements
• Recent innovations
• Upcoming features
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
“Intuit invests significantly to own and operate high-end
commercial databases underpinning our business. Until now,
there just wasn’t a real alternative to obtain the reliability and
performance our customers need. Amazon Aurora is a game-
changer for us: providing the performance and availability
features that rival expensive on-premises databases and
SANs at a significantly lower price point. The Amazon RDS
management capabilities on top of Amazon Aurora will allow
us to focus our resources and energy on what matters most –
building great applications and delighting our customers.”
Troy Otillio, Director, Public Cloud, Intuit
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon Aurora?
Datab ase reimag in ed for th e c lou d
 Speed and availability of high-end commercial databases
 Simplicity and cost-effectiveness of open-source databases
 Drop-in compatibility with MySQL and PostgreSQL
 Simple pay-as-you-go pricing
Delivered as a managed service
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Re-imagining the relational database
1
2
3
Scale out, distributed architecture
Service-oriented architecture leveraging AWS services
Automate administrative tasks – fully managed service
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scale out, distributed architecture
▪ Purpose-built log-structured distributed
storage system designed for databases
▪ Storage volume is striped across hundreds
of storage nodes distributed over three
different Availability Zones
▪ Six copies of data, two copies in each
Availability Zone to protect against AZ+1
failures
▪ Plan to apply same principles to other
layers of the stack
Master Replica
Availability
Zone 1
Shared storage volume
Availability
Zone 2
Availability
Zone 3
Storage nodes with SSDs
SQL
Transactions
Caching
SQL
Transactions
Caching
SQL
Transactions
Caching
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Leveraging AWS services
AWS Lambda
Amazon S3
IAM
Amazon
CloudWatch
Invoke Lambda functions from stored procedures/triggers
Load data from/ Select into Amazon S3,
store snapshots and backups in Amazon S3
Use IAM roles to manage database access control
Upload systems metrics and database logs
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Automate administrative tasks
Schema design
Query construction
Query optimization
Automatic failover
Backup & recovery
Isolation & security
Industry compliance
Push-button scaling
Automated patching
Advanced monitoring
Routine maintenance
Takes care of your time-consuming database management tasks,
freeing you to focus on your applications and business
You
AWS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aurora is used by
¾ of the top 100
AWS customers
Fastest growing
service in AWS history
Aurora customer adoption
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Who is moving to Aurora and why?
Customers using
open-source engines
▪ Higher performance – up to 5x
▪ Better availability and durability
▪ Reduces cost – up to 60%
▪ Easy migration; no application change
▪ One tenth of the cost; no licenses
▪ Integration with cloud ecosystem
▪ Comparable performance and availability
▪ Migration tooling and services
Customers using
Commercial engines
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AMAZON AURORA IS FAST…
5x faster than MySQL; 3x faster than PostgreSQL
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aurora MySQL performance
WRITE PERFORMANCE READ PERFORMANCE
MySQL SysBench results; R4.16XL: 64 cores / 488-GB RAM
Aurora read/write throughput compared to MySQL 5.6
based on open standard benchmarks.
Aurora MySQL 5.6
0
100000
200000
300000
400000
500000
600000
700000
0
50000
100000
150000
200000
250000
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aurora PostgreSQL performance
0
5000
10000
15000
20000
25000
30000
35000
40000
45000
10 15 20 25 30 35 40 45 50 55 60
Throughput,tps
Minutes
pgbench throughput over time, 150 GiB, 1024 clients
Aurora PostgreSQL PostgreSQL (single-AZ)
W h i l e r u n n i n g p g b e n c h a t l o a d , t h ro u g h p u t i s 3 x m o re c o n s i s t e n t
t h a n Po s t g re S Q L
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How did we achieve this?
Do fewer I/Os
Minimize network packets
Cache prior results
Offload the database engine
DO LESS WORK
Process asynchronously
Reduce latency path
Use lock-free data structures
Batch operations together
BE MORE EFFICIENT
DATABASES ARE ALL ABOUT I/O
NETWORK-ATTACHED STORAGE IS ALL ABOUT PACKETS/SECOND
HIGH-THROUGHPUT PROCESSING IS ALL ABOUT CONTEXT SWITCHES
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aurora I/O profile
BINLOG DATA DOUBLE-WRITELOG FRM FILES
TYPE OF WRITE
MYSQL WITH REPLICA
Amazon EBS
mirror
Amazon EBS
mirror
AZ 1 AZ 2
Amazon S3
Amazon EBSAmazon EBS
Primary
Instance
Replica
Instance
1
2
3
4
5
AZ 1 AZ 3
Primary
Instance
Amazon S3
AZ 2
Replica
Instance
ASYNC
4/6 QUORUM
DISTRIBUT
ED WRITES
Replica
Instance
AMAZON AURORA
780K transactions
7,388K I/Os per million txns (excludes mirroring, standby)
Average 7.4 I/Os per transaction
MySQL I/O profile for 30 min Sysbench run
27,378K transactions 35X MORE
0.95 I/Os per transaction (6X amplification) 7.7X LESS
Aurora I/O profile for 30 min Sysbench run
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
I/O traffic in Aurora (storage node)
LOG RECORDS
Primary
Instance
INCOMING QUEUE
STORAGE NODE
Amazon S3 Backup
1
2
3
4
5
6
7
8
UPDATE
QUEUE
ACK
HOT
LOG
DATA
BLOCKS
POINT IN TIME
SNAPSHOT
GC
SCRUB
COALESCE
SORT
GROUP
PEER TO PEER GOSSIPPeer
Storage
Nodes
All steps are asynchronous
Only steps 1 and 2 are in foreground latency path
Input queue is 46x less than MySQL (unamplified, per node)
Favor latency-sensitive operations
Use disk space to buffer against spikes in activity
OBSERVATIONS
I/O FLOW
① Receive record and add to in-memory queue
② Persist record and ACK
③ Organize records and identify gaps in log
④ Gossip with peers to fill in holes
⑤ Coalesce log records into new data block versions
⑥ Periodically stage log and new block versions to Amazon S3
⑦ Periodically garbage collect old versions
⑧ Periodically validate CRC codes on blocks
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Performance enhancements in Aurora
► Adaptive thread pool
► Smart thread scheduler
► Asynchronous group commit
► Latch-free lock manager
► Lock compression
► Latch-free read views
DML throughput
Query execution
► Hash joins
► Batched scans
► Fast B-Tree inserts
► Z-order spatial indexes
► Smart read-node selector
► Logical read ahead
► NUMA aware scheduler
► Highly concurrent catalog
► Asynchronous key prefetch
DDL and Ops
► Instant schema update
► Faster index build
► High-performance auditing
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aurora lock management
Scan
Delete
Scan
Delete
Insert
Scan Scan
Insert
Delete
Scan
Insert
Insert
MySQL lock manager Aurora lock manager
▪ Same locking semantics as MySQL
▪ Concurrent access to lock chains
Needed to support many concurrent sessions, high update throughput
▪ Multiple scanners in individual lock chains
▪ Lock-free deadlock detection
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Asynchronous key prefetch
Latency improvement factor vs. Batched Key Access (BKA) join
algorithm. Decision support benchmark, R3.8xlarge
14.57
-
2.00
4.00
6.00
8.00
10.00
12.00
14.00
16.00
Query-1
Query-2
Query-3
Query-4
Query-5
Query-6
Query-7
Query-8
Query-9
Query-10
Query-11
Query-12
Query-13
Query-14
Query-15
Query-16
Query-17
Query-18
Query-19
Query-20
Query-21
Query-22
Cold buffer
Works for queries using Batched Key
Access (BKA) join algorithm + Multi-Range
Read (MRR) Optimization
Performs a secondary to primary index
lookup during JOIN evaluation
Uses background thread to
asynchronously load pages into memory
AKP used in queries 2, 5, 8, 9, 11, 13, 17, 18, 19, 20, 21
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Batched scans
Standard MySQL processes rows one-at-a-time
resulting in high overhead due to:
▪ Repeated function calls
▪ Locking and latching
▪ Cursor store and restore
▪ InnoDB to MySQL format conversion
Amazon Aurora scan tuples from the InnoDB
buffer pool in batches for
▪ Table full scans
▪ Index full scans
▪ Index range scans Latency improvement factor vs. Batched Key Access (BKA) join
algorithm Decision support benchmark, R3.8xlarge
1.78X
-
0.20
0.40
0.60
0.80
1.00
1.20
1.40
1.60
1.80
2.00
Query-1
Query-2
Query-3
Query-4
Query-5
Query-6
Query-7
Query-8
Query-9
Query-10
Query-11
Query-12
Query-13
Query-14
Query-15
Query-16
Query-17
Query-18
Query-19
Query-20
Query-21
Query-22
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
WHAT ABOUT AVAILABILITY?
“Performance only matters if your database is up”
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
6-way replicated storage
S u r vives catastrop h ic failu res
Six copies across three Availability Zones
4 out 6 write quorum; 3 out of 6 read quorum
Peer-to-peer replication for repairs
Volume striped across hundreds of storage nodes
SQL
Transaction
AZ 1 AZ 2 AZ 3
Caching
SQL
Transaction
AZ 1 AZ 2 AZ 3
Caching
Read and write availabilityRead availability
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why 6 copies are necessary – survive AZ+1 failure
▪ In a large fleet, always some failuresAZ 1 AZ 2 AZ 3
Quorum
break on
AZ failure
2/3 read
2/3 write
AZ 1 AZ 2 AZ 3
Quorum
survives
AZ failure
3/6 read
4/6 write
▪ AZ failures have ”shared fate”
▪ Need to tolerate AZ+1 failures and still
be able to repair
▪ For 3 AZs, requires 6 copies
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Up to 15 promotable read replicas
Master
Read
Replica
Read
Replica
Read
Replica
Shared distributed storage volume
Reader end-point
► Up to 15 promotable read replicas across multiple Availability Zones
► Re-do log-based replication leads to low replica lag – typically < 10ms
► Reader end point with load balancing and automatic scaling
Availability enhancements in Aurora
► Instant redo crash recovery
► Survivable cache
► Fast failover, incl. driver support
Unplanned unavailability
Planned unavailability ► Zero-downtime patching
Business continuity
planning
► Continuous automated backup
► Point-in-Time-Restore
► Backtrack
► Cross-region read replicas
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Instant crash recovery
TRADITIONAL DATABASE
Have to replay logs since the last checkpoint
Typically 5 minutes between checkpoints
Single-threaded in MySQL; requires a large
number of disk accesses
AMAZON AURORA
Underlying storage replays redo records on
demand as part of a disk read
Parallel, distributed, asynchronous
No replay for startup
Checkpointed Data Redo Log
Crash at T0 requires
a re-application of the
SQL in the redo log since
last checkpoint
T0 T0
Crash at T0 will result in redo logs being applied
to each segment on demand, in parallel,
asynchronously
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Crash recovery in Aurora
CRASH
Log records Gaps
Volume Complete
LSN (VCL)
AT CRASH
IMMEDIATELY AFTER CRASH RECOVERY
Consistency Point
LSN (CPL)
Consistency Point
LSN (CPL)
▪ Instance opens all storage nodes for the
volume
▪ Volume Complete LSN (VCL) is the highest
point where all records have met quorum
▪ Consistency Point LSN (CPL) is the highest
commit record below VCL.
▪ Everything past CPL is deleted at crash recovery
▪ Removes the need for 2PC at each commit spanning
storage nodes.
▪ No redo or undo processing is required before the
database is opened for processing
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Database failover time
0.00%
5.00%
10.00%
15.00%
20.00%
25.00%
30.00%
35.00%
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35
0 - 5s – 30% of failovers
0.00%
5.00%
10.00%
15.00%
20.00%
25.00%
30.00%
35.00%
40.00%
45.00%
50.00%
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35
5 - 10s – 40% of failovers
0%
10%
20%
30%
40%
50%
60%
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35
10 - 20s – 25% of failovers
0%
5%
10%
15%
20%
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35
20 - 30s – 5% of failovers
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Zero downtime patching
Networking
state
Application
state
Storage Service
App
state
Net
state
App
state
Net
state
BeforeZDP
New DB
Engine
Old DB
Engine
New DB
Engine
Old DB
Engine
WithZDP
User sessions terminate
during patching
User sessions remain
active through patching
Storage Service
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
RECENT INNOVATIONS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Fast database cloning
Clone database without copying data
▪ Creation of a clone is nearly instantaneous
▪ Data copy happens only on write – when original
and cloned volume data differ
Example use cases
▪ Clone a production DB to run tests
▪ Reorganize a database
▪ Save a point in time snapshot for analysis without
impacting production system.
PRODUCTION DATABASE
CLONE CLONE
CLONE
DEV/TEST
APPLICATIONS
BENCHMARKS
PRODUCTION
APPLICATIONS
PRODUCTION
APPLICATIONS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Database backtrack
Backtrack brings the database to a point in time without requiring restore from backups
• Backtracking from an unintentional DML or DDL operation
• Backtrack is not destructive. You can backtrack multiple times to find the right point in time
t0 t1 t2
t0 t1
t2
t3 t4
t3
t4
Rewind to t1
Rewind to t3
Invisible Invisible
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How does backtrack work?
We keep periodic snapshot of each segment; we also preserve the redo logs
For backtrack, we identify the appropriate segment snapshots
Apply log streams to segment snapshots in parallel and asynchronously
SEGMENT
SNAPSHOT
LOG
RECORDS
RECOVERY
POINT
SEGMENT 1
SEGMENT 2
SEGMENT 3
TIME
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Online DDL: MySQL vs. Amazon Aurora
▪ Full Table copy in the background
▪ Rebuilds all indexes – can take hours or days
▪ DDL operation impacts DML throughput
▪ Table lock applied to apply DML changes
INDEX
LEAFLEAFLEAF LEAF
INDEX
ROOT
table name operation column-name time-stamp
Table 1
Table 2
Table 3
add-col
add-col
add-col
column-abc
column-qpr
column-xyz
t1
t2
t3
▪ Use schema versioning to decode the block.
▪ Modify-on-write primitive to upgrade to latest schema
▪ Currently support add NULLable column at end of table
▪ Add column anywhere and with default coming soon.
MySQL Aurora
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Online DDL performance
On r3.large
On r3.8xlarge
Aurora MySQL 5.6 MySQL 5.7
10GB table 0.27 sec 3,960 sec 1,600 sec
50GB table 0.25 sec 23,400 sec 5,040 sec
100GB table 0.26 sec 53,460 sec 9,720 sec
Aurora MySQL 5.6 MySQL 5.7
10GB table 0.06 sec 900 sec 1,080 sec
50GB table 0.08 sec 4,680 sec 5,040 sec
100GB table 0.15 sec 14,400 sec 9,720 sec
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Performance Insights
Dashboard showing load on DB
• Easy
• Powerful
Identifies source of bottlenecks
• Top SQL
Adjustable time frame
• Hour, day, week , month
• Up to 35 days of data
Max CPU
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Upcoming Aurora features
• Serverless
• Global physical replication
• Multi-master
• Parallel query
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AURORA SERVERLESS
Databases are at the heart of your applications
Unlike compute, databases are very hard to scale
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Provision to Peak
+ Handles spikes in usage
- Costs more
Sizing a relational database is hard
Provision to Average
+ Costs less
- May not meet usage
demands
Most companies choose to provision to peak
What if you could have a relational database that
• Starts up on demand, shuts down when not in use?
• Seamlessly scales with no servers to manage?
• Is billed per second for the database capacity you use?
• Is compatible with existing database applications?
Introducing Amazon Aurora Serverless
On-demand, automatically scaling database for applications with variable workloads
Aurora Serverless Use Cases
• Infrequently used applications (e.g., low-
volume blog site)
• Applications with variable load - peaks of
activity that are hard to predict (e.g.,
news site)
• Development or test databases not
needed on nights or weekends
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aurora Serverless Architecture
• All data is kept in highly
available storage volume
• Instance handles database
operations
• Application talks to a
MySQL compatible
endpoint
• Fleet of routers manage,
queue and route database
traffic
DATABASE
STORAGE
APPLICATION APPLICATION
Traditional Database Aurora Serverless
INSTANCE
DATABASE
STORAGE
INSTANCE
DATABASE
TRAFFIC
ROUTERS
DATABASE TRAFFIC
ROUTERS
Automatic Scaling Up and Down
• Aurora monitors the application
load on the database (CPU,
memory, connections)
• When scaling thresholds are
reached, instance auto-scales up or
down (usually under 5 seconds)
• Scaling operations are transparent
to the application
• You can configure minimum and
maximum capacity for scaling
DATABASE STORAGE
INSTANCE
WARM POOL
NEW
INSTANCE
APPLICATION
Automatic Pause and Resume
• If wanted, instances are
removed after a period of
inactivity
• While database is paused, you
only pay for storage
• A database request triggers
instance provisioning (usually
around 20 seconds)
• Applications don’t need to
know when database is paused
INSTANCE
DATABASE
STORAGE
APPLICATION
WARM POOL
DATABASE TRAFFIC ROUTERS
Aurora Serverless Pricing
• You pay for capacity your database consumes while it is active
• Database capacity is measured in Aurora Capacity Units
(ACUs)
• Flat rate per second of ACU usage, with a minimum of 5
minutes of usage each time the database is activated
• Storage and I/O are billed the same as with Aurora instances
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GLOBAL PHYSICAL REPLICATION
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Global replication - logical
Faster d isaster recover y an d en h an c ed d ata locality
Promote read replica to a master
for faster recovery in the event of
disaster
Bring data close to your
customer’s applications in
different regions
Promote to a master for easy
migration
AZ 1 AZ 3
Primary
Instance
AZ 2
Aurora
Replica
Aurora
Replica
ReplicationServer
ReplicationAgent
Aurora
Replica
(optional
)
Region 1: Primary Aurora Cluster Region 2: Read Replica Cluster
AZ 1
Async
.
REDO LOG FRM FILES
TYPE OF WRITE
Global Physical Replication
• Replication server streams redo logs and data pages from the primary instance to the replication agent.
• Replication agent applies the redo logs to the storage nodes and updates read replica buffer pool.
• Server/agent are responsible for restoring replication through page transfers in the event of network
interruptions – primary database remains unaffected.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Highlights
• Dedicated replication infrastructure
ensures unconstrained database
performance
• Consistently fast, low-lag, and high-
performance replication
• Global-scale replication in seconds or
less
• Recovery in under a minute
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AURORA MULTI-MASTER
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Single-region Multi-Master: Use cases
Continuous write
availability
• Mission-critical workload needing continuous write availability
(e.g., reservation system)
• Sharded application that want to limit blast radius of an instance
failure (e.g., e-commerce)
• Write-intensive application needing more than 200K writes/sec of
r4.16xlarge (e.g., gaming)
• Applications in hyper-growth businesses needing to future-proof
DB platform choice
Write scale-out
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Continuous write availability
SHARED STORAGE
M1 M2 M_n
App
Instance level
endpoint
Instance level
endpoint
Instance level
endpoint
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Continuous write availability
SHARED STORAGE
M1 M2 M_n
M1 failure;
transactions abort
App
Other nodes continue to
operate as before
Connections
terminated
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Continuous write availability
SHARED STORAGE
M1 M2 M_nM1 recovers
independently
App
Other nodes continue to
operate as before
Redistribute connections from
failed node to other nodes
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Continuous write availability
SHARED STORAGE
M1 M2 M_n
M1 recovery
complete
App
Other nodes continue to
operate
Add new
connections
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Continuous write availability
SHARED STORAGE
M1 M2 M_n
M1 recovery
complete
App
Other nodes continue to
operate
Add new
connections
AZ1 AZ2 AZ3
Uninterrupted read/write availability to the multi-master cluster even
through AZ failure
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Distributed Lock Manager
GLOBAL
RESOURCE
MANAGER
SQL
TRANSACTIONS
CACHING
LOGGING
SQL
TRANSACTIONS
CACHING
LOGGING
SHARED DISK CLUSTER
STORAGE
APPLICATION
LOCKING PROTOCOL MESSAGES
SHARED STORAGE
M1 M2 M3
M1 M1 M1M2 M3 M2
Cons
Heavyweight cache coherency traffic, on per-lock basis
Networking can be expensive
Negative scaling when hot blocks
Pros
All data available to all nodes
Easy to build applications
Similar cache coherency as in multi-processors
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Consensus with two phase or Paxos commit
DATA
RANGE #1
DATA
RANGE #2
DATA
RANGE #4
DATA
RANGE #3
DATA
RANGE #5
L
L L
L
L
SHARED NOTHING
SQL
TRANSACTIONS
CACHING
LOGGING
SQL
TRANSACTIONS
CACHING
LOGGING
APPLICATION
STORAGE STORAGE
Cons
Heavyweight commit and membership change protocols
Range partitioning can result in hot partitions, not just hot
blocks. Re-partitioning expensive.
Cross partition operations expensive. Better at small requests
Pros
Query broken up and sent to data node
Less coherence traffic – just for commits
Can scale to many nodes
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
“Blue”
Master
“Orange”
Master
P1 P2
Aurora instance Aurora instance
Aurora storage
Write scale-out in Aurora – conflict resolution w/ distrib. ledger
The database nodes know transaction
orders from that node
Operation
Implied txn
sequence
1 Write (BT1, P1) BT1
3 Write (BT1, P2) BT1 → BT2
4 Commit (BT1) BT2
5 Commit (BT2) -
Blue Master transaction = BT1, BT2
Orange Master transaction = -
BT1 BT2
BT1 → BT22 Write (BT2, P1)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Write scale-out in Aurora – conflict resolution w/ distrib. ledger
The database nodes know transaction
orders from that node
3 Commit (OT1) BT1
“Blue”
Master
“Orange”
Master
P1 P2
Aurora instance Aurora instance
Aurora storage
4 Commit (BT1) -
2 Write (OT1, P2) BT1, OT1
Blue Master transaction = BT1
Orange Master transaction = OT1
BT1 OT1 Implied txn
sequence
1 Write (BT1, P1) BT1
Operation
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Write scale-out in Aurora – conflict resolution w/ distrib. ledger
P1 P2
Aurora instance Aurora instance
Aurora storage
“Blue”
Master
“Orange”
Master
2 Commit (BT1) -
4 Commit (OT1) -
The storage nodes know transaction
orders applied at that node
3 Write (OT1, P1) OT1
Blue Master transaction = BT1
Orange Master transaction = OT1
BT1 OT1 Implied txn
sequence
1 Write (BT1, P1) BT1
Operation
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Write scale-out in Aurora – conflict resolution w/ distrib. ledger
We only have conflicts when data changed
at both multiple database nodes AND
multiple storage nodes ➔ Much less
coordination required
P1 P2
Aurora instance Aurora instance
Aurora storage
“Blue”
Master
“Orange”
Master
2 Write (OT1, P2) BT1, OT1
3 Write (BT1, P2)
4 Write (OT2, P1)
OT1 → BT1
5 Commit (OT1) OT1 BT1✅ x
Blue Master transaction = BT1
Orange Master transaction = OT1
BT1 OT1
OT1 → BT1
Implied txn
sequence
1 Write (BT1, P1) BT1
Operation
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Multi-region Multi-Master – uses x-region physical replication
REGION 1 REGION 2
HEAD NODES HEAD NODES
MULTI-AZ STORAGE VOLUME MULTI-AZ STORAGE VOLUME
LOCAL PARTITION REMOTE PARTITION
Cross-region replication happens at in the storage layer,
and based on physical redo (no binlog)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Multi-region Multi-Master
Write accepted locally
Optimistic concurrency control – no distributed lock
manager, no chatty lock management protocol
REGION 1 REGION 2
HEAD NODES HEAD NODES
MULTI-AZ STORAGE VOLUME MULTI-AZ STORAGE VOLUME
LOCAL PARTITION LOCAL PARTITIONREMOTE PARTITION REMOTE PARTITION
Conflicts handled hierarchically – at head nodes,
at storage nodes, at AZ and region level arbitrators
Near-linear performance scaling when there is no
or low levels of conflicts
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AURORA PARALLEL QUERY
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Parallel query processing
Aurora storage has thousands of CPUs
▪ Presents opportunity to push down and parallelize query
processing using the storage fleet
▪ Moving processing close to data reduces network traffic and
latency
However, there are significant challenges
▪ Data stored in storage node is not range partitioned –
require full scans
▪ Data may be in flight
▪ Read views may not allow viewing most recent data
▪ Not all functions can be pushed down to storage nodes
DATABASE NODE
STORAGE NODES
PUSH DOWN
PREDICATES
AGGREGATE
RESULTS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Parallel Query: Use cases
Orders of magnitude
faster queries
Analytic workloads on OLTP
working set
• Analyze real-time data
• Avoid building ETL pipelines for ad
hoc queries
• A large number of concurrent
analytic queries
Reduced contention
with OLTP workload
Parallelism increases
with data size
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Parallel query performance
3.41
42.18
15.77
120.03
75.47
47.23
2.17
4.13
23.5 22.61
182.02
104.87
1.13
1
2
4
8
16
32
64
128
256
“We noticed query time reduce from 32 minutes to 3 minutes.” – preview customer
(online media company)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Processing at head node
STORAGE NODES
OPTIMIZER
EXECUTOR
INNODB
NETWORK STORAGE DRIVER
AGGREGATOR
APPLICATION
PARTIAL
RESULTS
STREAM
RESULTS
IN-FLIGHT
DATA
PQ CONTEXT
PQ PLAN
Query Optimizer produces PQ Plan and
creates PQ context based on leaf page
discovery
PQ request is sent to storage node along with
PQ context
Storage node produces
▪ Partial results streams with processed
stable rows
▪ Raw stream of unprocessed rows with
pending undos
Head node aggregates these data streams to
produce final results
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Processing at storage node
Each storage node runs up to 16 PQ
processes, each associated with a parallel
query
PQ process receives PQ context
▪ List of pages to scan
▪ Read view and projections
▪ Expression evaluation byte code
PQ process makes two passes through the
page list
▪ Pass 1: Filter evaluation on InnoDB
formatted raw data
▪ Pass 2: Expression evaluation on
MySQL formatted data
PQ PROCESS
PQ PROCESS
Up to 16
TO/FROM HEAD NODE
STORAGE
NODE PROCESS
PAGE LISTS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Submit session feedback
1. Tap the Schedule icon.
2. Select the session you attended.
3. Tap Session Evaluation to submit your
feedback.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!

More Related Content

What's hot

(SPOT301) AWS Innovation at Scale | AWS re:Invent 2014
(SPOT301) AWS Innovation at Scale | AWS re:Invent 2014(SPOT301) AWS Innovation at Scale | AWS re:Invent 2014
(SPOT301) AWS Innovation at Scale | AWS re:Invent 2014Amazon Web Services
 
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...Amazon Web Services
 
AWS Black Belt Online Seminar 2017 Amazon Aurora
AWS Black Belt Online Seminar 2017 Amazon AuroraAWS Black Belt Online Seminar 2017 Amazon Aurora
AWS Black Belt Online Seminar 2017 Amazon AuroraAmazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
AWS Black Belt Online Seminar 2017 Amazon ElastiCacheAWS Black Belt Online Seminar 2017 Amazon ElastiCache
AWS Black Belt Online Seminar 2017 Amazon ElastiCacheAmazon Web Services Japan
 
AWS EMR Cost optimization
AWS EMR Cost optimizationAWS EMR Cost optimization
AWS EMR Cost optimizationSANG WON PARK
 
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 TalksAmazon Web Services
 
20190320 AWS Black Belt Online Seminar Amazon EBS
20190320 AWS Black Belt Online Seminar Amazon EBS20190320 AWS Black Belt Online Seminar Amazon EBS
20190320 AWS Black Belt Online Seminar Amazon EBSAmazon Web Services Japan
 
20190319 AWS Black Belt Online Seminar Amazon FSx for Windows Server
20190319 AWS Black Belt Online Seminar Amazon FSx for Windows Server20190319 AWS Black Belt Online Seminar Amazon FSx for Windows Server
20190319 AWS Black Belt Online Seminar Amazon FSx for Windows ServerAmazon Web Services Japan
 
AWS Black Belt Online Seminar Amazon Elastic Block Store (EBS)
AWS Black Belt Online Seminar Amazon Elastic Block Store (EBS) AWS Black Belt Online Seminar Amazon Elastic Block Store (EBS)
AWS Black Belt Online Seminar Amazon Elastic Block Store (EBS) Amazon Web Services Japan
 
日本のお客様におけるAmazon Auroraへの移行・検証事例と技術ポイント
日本のお客様におけるAmazon Auroraへの移行・検証事例と技術ポイント日本のお客様におけるAmazon Auroraへの移行・検証事例と技術ポイント
日本のお客様におけるAmazon Auroraへの移行・検証事例と技術ポイントAmazon Web Services Japan
 
Introduction to Block and File storage on AWS
Introduction to Block and File storage on AWSIntroduction to Block and File storage on AWS
Introduction to Block and File storage on AWSAmazon Web Services
 
AWS Black Belt Online Seminar 2018 AWS Certificate Manager
AWS Black Belt Online Seminar 2018 AWS Certificate ManagerAWS Black Belt Online Seminar 2018 AWS Certificate Manager
AWS Black Belt Online Seminar 2018 AWS Certificate ManagerAmazon Web Services Japan
 
AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)
AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)
AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)Amazon Web Services
 
20190226 AWS Black Belt Online Seminar Amazon WorkSpaces
20190226 AWS Black Belt Online Seminar Amazon WorkSpaces20190226 AWS Black Belt Online Seminar Amazon WorkSpaces
20190226 AWS Black Belt Online Seminar Amazon WorkSpacesAmazon Web Services Japan
 
Getting Started with Amazon Aurora
Getting Started with Amazon AuroraGetting Started with Amazon Aurora
Getting Started with Amazon AuroraAmazon Web Services
 

What's hot (20)

Deep Dive on Amazon Aurora
Deep Dive on Amazon AuroraDeep Dive on Amazon Aurora
Deep Dive on Amazon Aurora
 
(SPOT301) AWS Innovation at Scale | AWS re:Invent 2014
(SPOT301) AWS Innovation at Scale | AWS re:Invent 2014(SPOT301) AWS Innovation at Scale | AWS re:Invent 2014
(SPOT301) AWS Innovation at Scale | AWS re:Invent 2014
 
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
 
Introduction to Amazon Aurora
Introduction to Amazon AuroraIntroduction to Amazon Aurora
Introduction to Amazon Aurora
 
Google Cloud Spanner Preview
Google Cloud Spanner PreviewGoogle Cloud Spanner Preview
Google Cloud Spanner Preview
 
AWS Black Belt Online Seminar 2017 Amazon Aurora
AWS Black Belt Online Seminar 2017 Amazon AuroraAWS Black Belt Online Seminar 2017 Amazon Aurora
AWS Black Belt Online Seminar 2017 Amazon Aurora
 
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
AWS Black Belt Online Seminar 2017 Amazon ElastiCacheAWS Black Belt Online Seminar 2017 Amazon ElastiCache
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
 
AWS EMR Cost optimization
AWS EMR Cost optimizationAWS EMR Cost optimization
AWS EMR Cost optimization
 
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
 
20190320 AWS Black Belt Online Seminar Amazon EBS
20190320 AWS Black Belt Online Seminar Amazon EBS20190320 AWS Black Belt Online Seminar Amazon EBS
20190320 AWS Black Belt Online Seminar Amazon EBS
 
AWS Black Belt Online Seminar Amazon Aurora
AWS Black Belt Online Seminar Amazon AuroraAWS Black Belt Online Seminar Amazon Aurora
AWS Black Belt Online Seminar Amazon Aurora
 
20190319 AWS Black Belt Online Seminar Amazon FSx for Windows Server
20190319 AWS Black Belt Online Seminar Amazon FSx for Windows Server20190319 AWS Black Belt Online Seminar Amazon FSx for Windows Server
20190319 AWS Black Belt Online Seminar Amazon FSx for Windows Server
 
AWS Black Belt Online Seminar Amazon Elastic Block Store (EBS)
AWS Black Belt Online Seminar Amazon Elastic Block Store (EBS) AWS Black Belt Online Seminar Amazon Elastic Block Store (EBS)
AWS Black Belt Online Seminar Amazon Elastic Block Store (EBS)
 
日本のお客様におけるAmazon Auroraへの移行・検証事例と技術ポイント
日本のお客様におけるAmazon Auroraへの移行・検証事例と技術ポイント日本のお客様におけるAmazon Auroraへの移行・検証事例と技術ポイント
日本のお客様におけるAmazon Auroraへの移行・検証事例と技術ポイント
 
Introduction to Block and File storage on AWS
Introduction to Block and File storage on AWSIntroduction to Block and File storage on AWS
Introduction to Block and File storage on AWS
 
AWS Black Belt Online Seminar 2018 AWS Certificate Manager
AWS Black Belt Online Seminar 2018 AWS Certificate ManagerAWS Black Belt Online Seminar 2018 AWS Certificate Manager
AWS Black Belt Online Seminar 2018 AWS Certificate Manager
 
20211109 bleaの使い方(基本編)
20211109 bleaの使い方(基本編)20211109 bleaの使い方(基本編)
20211109 bleaの使い方(基本編)
 
AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)
AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)
AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)
 
20190226 AWS Black Belt Online Seminar Amazon WorkSpaces
20190226 AWS Black Belt Online Seminar Amazon WorkSpaces20190226 AWS Black Belt Online Seminar Amazon WorkSpaces
20190226 AWS Black Belt Online Seminar Amazon WorkSpaces
 
Getting Started with Amazon Aurora
Getting Started with Amazon AuroraGetting Started with Amazon Aurora
Getting Started with Amazon Aurora
 

Similar to Amazon Aurora: Deep Dive - SRV308 - Chicago AWS Summit

Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018Amazon Web Services
 
Amazon Aurora - Rajeev Chakrabarti
Amazon Aurora - Rajeev ChakrabartiAmazon Aurora - Rajeev Chakrabarti
Amazon Aurora - Rajeev ChakrabartiAmazon Web Services
 
What's New in Amazon Aurora (DAT204-R1) - AWS re:Invent 2018
What's New in Amazon Aurora (DAT204-R1) - AWS re:Invent 2018What's New in Amazon Aurora (DAT204-R1) - AWS re:Invent 2018
What's New in Amazon Aurora (DAT204-R1) - AWS re:Invent 2018Amazon 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 ServiceAmazon 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 SummitAmazon Web Services
 
[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
 
Deep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Deep Dive - Amazon Relational Database Services_AWSPSSummit_SingaporeDeep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Deep Dive - Amazon Relational Database Services_AWSPSSummit_SingaporeAmazon Web Services
 
Migrating Your Oracle & SQL Server Databases to Amazon Aurora (DAT318) - AWS ...
Migrating Your Oracle & SQL Server Databases to Amazon Aurora (DAT318) - AWS ...Migrating Your Oracle & SQL Server Databases to Amazon Aurora (DAT318) - AWS ...
Migrating Your Oracle & SQL Server Databases to Amazon Aurora (DAT318) - AWS ...Amazon Web Services
 
Deep Dive on Amazon Aurora with PostgreSQL Compatibility (DAT305-R1) - AWS re...
Deep Dive on Amazon Aurora with PostgreSQL Compatibility (DAT305-R1) - AWS re...Deep Dive on Amazon Aurora with PostgreSQL Compatibility (DAT305-R1) - AWS re...
Deep Dive on Amazon Aurora with PostgreSQL Compatibility (DAT305-R1) - AWS re...Amazon Web Services
 
Amazon Aurora (MySQL, Postgres)
Amazon Aurora (MySQL, Postgres)Amazon Aurora (MySQL, Postgres)
Amazon Aurora (MySQL, Postgres)AWS Germany
 
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...Amazon Web Services
 
DAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL PerformanceDAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL PerformanceAmazon Web Services
 

Similar to Amazon Aurora: Deep Dive - SRV308 - Chicago AWS Summit (20)

Amazon Aurora_Deep Dive
Amazon Aurora_Deep DiveAmazon Aurora_Deep Dive
Amazon Aurora_Deep Dive
 
Amazon Aurora
Amazon AuroraAmazon Aurora
Amazon Aurora
 
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
 
Amazon Aurora
Amazon AuroraAmazon Aurora
Amazon Aurora
 
Amazon Aurora - Rajeev Chakrabarti
Amazon Aurora - Rajeev ChakrabartiAmazon Aurora - Rajeev Chakrabarti
Amazon Aurora - Rajeev Chakrabarti
 
What's New in Amazon Aurora (DAT204-R1) - AWS re:Invent 2018
What's New in Amazon Aurora (DAT204-R1) - AWS re:Invent 2018What's New in Amazon Aurora (DAT204-R1) - AWS re:Invent 2018
What's New in Amazon Aurora (DAT204-R1) - AWS re:Invent 2018
 
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
 
Aurora Deep Dive | AWS Floor28
Aurora Deep Dive | AWS Floor28Aurora Deep Dive | AWS Floor28
Aurora Deep Dive | AWS Floor28
 
Amazon Aurora
Amazon AuroraAmazon Aurora
Amazon Aurora
 
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
 
[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) - ...
 
Deep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Deep Dive - Amazon Relational Database Services_AWSPSSummit_SingaporeDeep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Deep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
 
Amazon Aurora
Amazon AuroraAmazon Aurora
Amazon Aurora
 
Amazon Aurora: Database Week SF
Amazon Aurora: Database Week SFAmazon Aurora: Database Week SF
Amazon Aurora: Database Week SF
 
Migrating Your Oracle & SQL Server Databases to Amazon Aurora (DAT318) - AWS ...
Migrating Your Oracle & SQL Server Databases to Amazon Aurora (DAT318) - AWS ...Migrating Your Oracle & SQL Server Databases to Amazon Aurora (DAT318) - AWS ...
Migrating Your Oracle & SQL Server Databases to Amazon Aurora (DAT318) - AWS ...
 
Managed Relational Databases
Managed Relational DatabasesManaged Relational Databases
Managed Relational Databases
 
Deep Dive on Amazon Aurora with PostgreSQL Compatibility (DAT305-R1) - AWS re...
Deep Dive on Amazon Aurora with PostgreSQL Compatibility (DAT305-R1) - AWS re...Deep Dive on Amazon Aurora with PostgreSQL Compatibility (DAT305-R1) - AWS re...
Deep Dive on Amazon Aurora with PostgreSQL Compatibility (DAT305-R1) - AWS re...
 
Amazon Aurora (MySQL, Postgres)
Amazon Aurora (MySQL, Postgres)Amazon Aurora (MySQL, Postgres)
Amazon Aurora (MySQL, Postgres)
 
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
 
DAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL PerformanceDAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL Performance
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Amazon Aurora: Deep Dive - SRV308 - Chicago AWS Summit

  • 1. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Chayan Biswas cbbiswas@amazon.com Sr. Product Manager, Amazon Aurora SRV308 Deep Dive on Amazon Aurora
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda • Aurora overview • Performance improvements • Availability improvements • Recent innovations • Upcoming features
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. “Intuit invests significantly to own and operate high-end commercial databases underpinning our business. Until now, there just wasn’t a real alternative to obtain the reliability and performance our customers need. Amazon Aurora is a game- changer for us: providing the performance and availability features that rival expensive on-premises databases and SANs at a significantly lower price point. The Amazon RDS management capabilities on top of Amazon Aurora will allow us to focus our resources and energy on what matters most – building great applications and delighting our customers.” Troy Otillio, Director, Public Cloud, Intuit
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is Amazon Aurora? Datab ase reimag in ed for th e c lou d  Speed and availability of high-end commercial databases  Simplicity and cost-effectiveness of open-source databases  Drop-in compatibility with MySQL and PostgreSQL  Simple pay-as-you-go pricing Delivered as a managed service
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Re-imagining the relational database 1 2 3 Scale out, distributed architecture Service-oriented architecture leveraging AWS services Automate administrative tasks – fully managed service
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scale out, distributed architecture ▪ Purpose-built log-structured distributed storage system designed for databases ▪ Storage volume is striped across hundreds of storage nodes distributed over three different Availability Zones ▪ Six copies of data, two copies in each Availability Zone to protect against AZ+1 failures ▪ Plan to apply same principles to other layers of the stack Master Replica Availability Zone 1 Shared storage volume Availability Zone 2 Availability Zone 3 Storage nodes with SSDs SQL Transactions Caching SQL Transactions Caching SQL Transactions Caching
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Leveraging AWS services AWS Lambda Amazon S3 IAM Amazon CloudWatch Invoke Lambda functions from stored procedures/triggers Load data from/ Select into Amazon S3, store snapshots and backups in Amazon S3 Use IAM roles to manage database access control Upload systems metrics and database logs
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Automate administrative tasks Schema design Query construction Query optimization Automatic failover Backup & recovery Isolation & security Industry compliance Push-button scaling Automated patching Advanced monitoring Routine maintenance Takes care of your time-consuming database management tasks, freeing you to focus on your applications and business You AWS
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aurora is used by ¾ of the top 100 AWS customers Fastest growing service in AWS history Aurora customer adoption
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Who is moving to Aurora and why? Customers using open-source engines ▪ Higher performance – up to 5x ▪ Better availability and durability ▪ Reduces cost – up to 60% ▪ Easy migration; no application change ▪ One tenth of the cost; no licenses ▪ Integration with cloud ecosystem ▪ Comparable performance and availability ▪ Migration tooling and services Customers using Commercial engines
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AMAZON AURORA IS FAST… 5x faster than MySQL; 3x faster than PostgreSQL
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aurora MySQL performance WRITE PERFORMANCE READ PERFORMANCE MySQL SysBench results; R4.16XL: 64 cores / 488-GB RAM Aurora read/write throughput compared to MySQL 5.6 based on open standard benchmarks. Aurora MySQL 5.6 0 100000 200000 300000 400000 500000 600000 700000 0 50000 100000 150000 200000 250000
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aurora PostgreSQL performance 0 5000 10000 15000 20000 25000 30000 35000 40000 45000 10 15 20 25 30 35 40 45 50 55 60 Throughput,tps Minutes pgbench throughput over time, 150 GiB, 1024 clients Aurora PostgreSQL PostgreSQL (single-AZ) W h i l e r u n n i n g p g b e n c h a t l o a d , t h ro u g h p u t i s 3 x m o re c o n s i s t e n t t h a n Po s t g re S Q L
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How did we achieve this? Do fewer I/Os Minimize network packets Cache prior results Offload the database engine DO LESS WORK Process asynchronously Reduce latency path Use lock-free data structures Batch operations together BE MORE EFFICIENT DATABASES ARE ALL ABOUT I/O NETWORK-ATTACHED STORAGE IS ALL ABOUT PACKETS/SECOND HIGH-THROUGHPUT PROCESSING IS ALL ABOUT CONTEXT SWITCHES
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aurora I/O profile BINLOG DATA DOUBLE-WRITELOG FRM FILES TYPE OF WRITE MYSQL WITH REPLICA Amazon EBS mirror Amazon EBS mirror AZ 1 AZ 2 Amazon S3 Amazon EBSAmazon EBS Primary Instance Replica Instance 1 2 3 4 5 AZ 1 AZ 3 Primary Instance Amazon S3 AZ 2 Replica Instance ASYNC 4/6 QUORUM DISTRIBUT ED WRITES Replica Instance AMAZON AURORA 780K transactions 7,388K I/Os per million txns (excludes mirroring, standby) Average 7.4 I/Os per transaction MySQL I/O profile for 30 min Sysbench run 27,378K transactions 35X MORE 0.95 I/Os per transaction (6X amplification) 7.7X LESS Aurora I/O profile for 30 min Sysbench run
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. I/O traffic in Aurora (storage node) LOG RECORDS Primary Instance INCOMING QUEUE STORAGE NODE Amazon S3 Backup 1 2 3 4 5 6 7 8 UPDATE QUEUE ACK HOT LOG DATA BLOCKS POINT IN TIME SNAPSHOT GC SCRUB COALESCE SORT GROUP PEER TO PEER GOSSIPPeer Storage Nodes All steps are asynchronous Only steps 1 and 2 are in foreground latency path Input queue is 46x less than MySQL (unamplified, per node) Favor latency-sensitive operations Use disk space to buffer against spikes in activity OBSERVATIONS I/O FLOW ① Receive record and add to in-memory queue ② Persist record and ACK ③ Organize records and identify gaps in log ④ Gossip with peers to fill in holes ⑤ Coalesce log records into new data block versions ⑥ Periodically stage log and new block versions to Amazon S3 ⑦ Periodically garbage collect old versions ⑧ Periodically validate CRC codes on blocks
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Performance enhancements in Aurora ► Adaptive thread pool ► Smart thread scheduler ► Asynchronous group commit ► Latch-free lock manager ► Lock compression ► Latch-free read views DML throughput Query execution ► Hash joins ► Batched scans ► Fast B-Tree inserts ► Z-order spatial indexes ► Smart read-node selector ► Logical read ahead ► NUMA aware scheduler ► Highly concurrent catalog ► Asynchronous key prefetch DDL and Ops ► Instant schema update ► Faster index build ► High-performance auditing
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aurora lock management Scan Delete Scan Delete Insert Scan Scan Insert Delete Scan Insert Insert MySQL lock manager Aurora lock manager ▪ Same locking semantics as MySQL ▪ Concurrent access to lock chains Needed to support many concurrent sessions, high update throughput ▪ Multiple scanners in individual lock chains ▪ Lock-free deadlock detection
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Asynchronous key prefetch Latency improvement factor vs. Batched Key Access (BKA) join algorithm. Decision support benchmark, R3.8xlarge 14.57 - 2.00 4.00 6.00 8.00 10.00 12.00 14.00 16.00 Query-1 Query-2 Query-3 Query-4 Query-5 Query-6 Query-7 Query-8 Query-9 Query-10 Query-11 Query-12 Query-13 Query-14 Query-15 Query-16 Query-17 Query-18 Query-19 Query-20 Query-21 Query-22 Cold buffer Works for queries using Batched Key Access (BKA) join algorithm + Multi-Range Read (MRR) Optimization Performs a secondary to primary index lookup during JOIN evaluation Uses background thread to asynchronously load pages into memory AKP used in queries 2, 5, 8, 9, 11, 13, 17, 18, 19, 20, 21
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Batched scans Standard MySQL processes rows one-at-a-time resulting in high overhead due to: ▪ Repeated function calls ▪ Locking and latching ▪ Cursor store and restore ▪ InnoDB to MySQL format conversion Amazon Aurora scan tuples from the InnoDB buffer pool in batches for ▪ Table full scans ▪ Index full scans ▪ Index range scans Latency improvement factor vs. Batched Key Access (BKA) join algorithm Decision support benchmark, R3.8xlarge 1.78X - 0.20 0.40 0.60 0.80 1.00 1.20 1.40 1.60 1.80 2.00 Query-1 Query-2 Query-3 Query-4 Query-5 Query-6 Query-7 Query-8 Query-9 Query-10 Query-11 Query-12 Query-13 Query-14 Query-15 Query-16 Query-17 Query-18 Query-19 Query-20 Query-21 Query-22
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. WHAT ABOUT AVAILABILITY? “Performance only matters if your database is up”
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 6-way replicated storage S u r vives catastrop h ic failu res Six copies across three Availability Zones 4 out 6 write quorum; 3 out of 6 read quorum Peer-to-peer replication for repairs Volume striped across hundreds of storage nodes SQL Transaction AZ 1 AZ 2 AZ 3 Caching SQL Transaction AZ 1 AZ 2 AZ 3 Caching Read and write availabilityRead availability
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why 6 copies are necessary – survive AZ+1 failure ▪ In a large fleet, always some failuresAZ 1 AZ 2 AZ 3 Quorum break on AZ failure 2/3 read 2/3 write AZ 1 AZ 2 AZ 3 Quorum survives AZ failure 3/6 read 4/6 write ▪ AZ failures have ”shared fate” ▪ Need to tolerate AZ+1 failures and still be able to repair ▪ For 3 AZs, requires 6 copies
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Up to 15 promotable read replicas Master Read Replica Read Replica Read Replica Shared distributed storage volume Reader end-point ► Up to 15 promotable read replicas across multiple Availability Zones ► Re-do log-based replication leads to low replica lag – typically < 10ms ► Reader end point with load balancing and automatic scaling
  • 25. Availability enhancements in Aurora ► Instant redo crash recovery ► Survivable cache ► Fast failover, incl. driver support Unplanned unavailability Planned unavailability ► Zero-downtime patching Business continuity planning ► Continuous automated backup ► Point-in-Time-Restore ► Backtrack ► Cross-region read replicas
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Instant crash recovery TRADITIONAL DATABASE Have to replay logs since the last checkpoint Typically 5 minutes between checkpoints Single-threaded in MySQL; requires a large number of disk accesses AMAZON AURORA Underlying storage replays redo records on demand as part of a disk read Parallel, distributed, asynchronous No replay for startup Checkpointed Data Redo Log Crash at T0 requires a re-application of the SQL in the redo log since last checkpoint T0 T0 Crash at T0 will result in redo logs being applied to each segment on demand, in parallel, asynchronously
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Crash recovery in Aurora CRASH Log records Gaps Volume Complete LSN (VCL) AT CRASH IMMEDIATELY AFTER CRASH RECOVERY Consistency Point LSN (CPL) Consistency Point LSN (CPL) ▪ Instance opens all storage nodes for the volume ▪ Volume Complete LSN (VCL) is the highest point where all records have met quorum ▪ Consistency Point LSN (CPL) is the highest commit record below VCL. ▪ Everything past CPL is deleted at crash recovery ▪ Removes the need for 2PC at each commit spanning storage nodes. ▪ No redo or undo processing is required before the database is opened for processing
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Database failover time 0.00% 5.00% 10.00% 15.00% 20.00% 25.00% 30.00% 35.00% 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 0 - 5s – 30% of failovers 0.00% 5.00% 10.00% 15.00% 20.00% 25.00% 30.00% 35.00% 40.00% 45.00% 50.00% 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 5 - 10s – 40% of failovers 0% 10% 20% 30% 40% 50% 60% 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 10 - 20s – 25% of failovers 0% 5% 10% 15% 20% 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 20 - 30s – 5% of failovers
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Zero downtime patching Networking state Application state Storage Service App state Net state App state Net state BeforeZDP New DB Engine Old DB Engine New DB Engine Old DB Engine WithZDP User sessions terminate during patching User sessions remain active through patching Storage Service
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. RECENT INNOVATIONS
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Fast database cloning Clone database without copying data ▪ Creation of a clone is nearly instantaneous ▪ Data copy happens only on write – when original and cloned volume data differ Example use cases ▪ Clone a production DB to run tests ▪ Reorganize a database ▪ Save a point in time snapshot for analysis without impacting production system. PRODUCTION DATABASE CLONE CLONE CLONE DEV/TEST APPLICATIONS BENCHMARKS PRODUCTION APPLICATIONS PRODUCTION APPLICATIONS
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Database backtrack Backtrack brings the database to a point in time without requiring restore from backups • Backtracking from an unintentional DML or DDL operation • Backtrack is not destructive. You can backtrack multiple times to find the right point in time t0 t1 t2 t0 t1 t2 t3 t4 t3 t4 Rewind to t1 Rewind to t3 Invisible Invisible
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How does backtrack work? We keep periodic snapshot of each segment; we also preserve the redo logs For backtrack, we identify the appropriate segment snapshots Apply log streams to segment snapshots in parallel and asynchronously SEGMENT SNAPSHOT LOG RECORDS RECOVERY POINT SEGMENT 1 SEGMENT 2 SEGMENT 3 TIME
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Online DDL: MySQL vs. Amazon Aurora ▪ Full Table copy in the background ▪ Rebuilds all indexes – can take hours or days ▪ DDL operation impacts DML throughput ▪ Table lock applied to apply DML changes INDEX LEAFLEAFLEAF LEAF INDEX ROOT table name operation column-name time-stamp Table 1 Table 2 Table 3 add-col add-col add-col column-abc column-qpr column-xyz t1 t2 t3 ▪ Use schema versioning to decode the block. ▪ Modify-on-write primitive to upgrade to latest schema ▪ Currently support add NULLable column at end of table ▪ Add column anywhere and with default coming soon. MySQL Aurora
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Online DDL performance On r3.large On r3.8xlarge Aurora MySQL 5.6 MySQL 5.7 10GB table 0.27 sec 3,960 sec 1,600 sec 50GB table 0.25 sec 23,400 sec 5,040 sec 100GB table 0.26 sec 53,460 sec 9,720 sec Aurora MySQL 5.6 MySQL 5.7 10GB table 0.06 sec 900 sec 1,080 sec 50GB table 0.08 sec 4,680 sec 5,040 sec 100GB table 0.15 sec 14,400 sec 9,720 sec
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Performance Insights Dashboard showing load on DB • Easy • Powerful Identifies source of bottlenecks • Top SQL Adjustable time frame • Hour, day, week , month • Up to 35 days of data Max CPU
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Upcoming Aurora features • Serverless • Global physical replication • Multi-master • Parallel query
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AURORA SERVERLESS
  • 39. Databases are at the heart of your applications Unlike compute, databases are very hard to scale
  • 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Provision to Peak + Handles spikes in usage - Costs more Sizing a relational database is hard Provision to Average + Costs less - May not meet usage demands Most companies choose to provision to peak
  • 41. What if you could have a relational database that • Starts up on demand, shuts down when not in use? • Seamlessly scales with no servers to manage? • Is billed per second for the database capacity you use? • Is compatible with existing database applications? Introducing Amazon Aurora Serverless On-demand, automatically scaling database for applications with variable workloads
  • 42. Aurora Serverless Use Cases • Infrequently used applications (e.g., low- volume blog site) • Applications with variable load - peaks of activity that are hard to predict (e.g., news site) • Development or test databases not needed on nights or weekends
  • 43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aurora Serverless Architecture • All data is kept in highly available storage volume • Instance handles database operations • Application talks to a MySQL compatible endpoint • Fleet of routers manage, queue and route database traffic DATABASE STORAGE APPLICATION APPLICATION Traditional Database Aurora Serverless INSTANCE DATABASE STORAGE INSTANCE DATABASE TRAFFIC ROUTERS
  • 44. DATABASE TRAFFIC ROUTERS Automatic Scaling Up and Down • Aurora monitors the application load on the database (CPU, memory, connections) • When scaling thresholds are reached, instance auto-scales up or down (usually under 5 seconds) • Scaling operations are transparent to the application • You can configure minimum and maximum capacity for scaling DATABASE STORAGE INSTANCE WARM POOL NEW INSTANCE APPLICATION
  • 45. Automatic Pause and Resume • If wanted, instances are removed after a period of inactivity • While database is paused, you only pay for storage • A database request triggers instance provisioning (usually around 20 seconds) • Applications don’t need to know when database is paused INSTANCE DATABASE STORAGE APPLICATION WARM POOL DATABASE TRAFFIC ROUTERS
  • 46. Aurora Serverless Pricing • You pay for capacity your database consumes while it is active • Database capacity is measured in Aurora Capacity Units (ACUs) • Flat rate per second of ACU usage, with a minimum of 5 minutes of usage each time the database is activated • Storage and I/O are billed the same as with Aurora instances
  • 47. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. GLOBAL PHYSICAL REPLICATION
  • 48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Global replication - logical Faster d isaster recover y an d en h an c ed d ata locality Promote read replica to a master for faster recovery in the event of disaster Bring data close to your customer’s applications in different regions Promote to a master for easy migration
  • 49. AZ 1 AZ 3 Primary Instance AZ 2 Aurora Replica Aurora Replica ReplicationServer ReplicationAgent Aurora Replica (optional ) Region 1: Primary Aurora Cluster Region 2: Read Replica Cluster AZ 1 Async . REDO LOG FRM FILES TYPE OF WRITE Global Physical Replication • Replication server streams redo logs and data pages from the primary instance to the replication agent. • Replication agent applies the redo logs to the storage nodes and updates read replica buffer pool. • Server/agent are responsible for restoring replication through page transfers in the event of network interruptions – primary database remains unaffected.
  • 50. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Highlights • Dedicated replication infrastructure ensures unconstrained database performance • Consistently fast, low-lag, and high- performance replication • Global-scale replication in seconds or less • Recovery in under a minute
  • 51. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AURORA MULTI-MASTER
  • 52. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Single-region Multi-Master: Use cases Continuous write availability • Mission-critical workload needing continuous write availability (e.g., reservation system) • Sharded application that want to limit blast radius of an instance failure (e.g., e-commerce) • Write-intensive application needing more than 200K writes/sec of r4.16xlarge (e.g., gaming) • Applications in hyper-growth businesses needing to future-proof DB platform choice Write scale-out
  • 53. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Continuous write availability SHARED STORAGE M1 M2 M_n App Instance level endpoint Instance level endpoint Instance level endpoint
  • 54. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Continuous write availability SHARED STORAGE M1 M2 M_n M1 failure; transactions abort App Other nodes continue to operate as before Connections terminated
  • 55. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Continuous write availability SHARED STORAGE M1 M2 M_nM1 recovers independently App Other nodes continue to operate as before Redistribute connections from failed node to other nodes
  • 56. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Continuous write availability SHARED STORAGE M1 M2 M_n M1 recovery complete App Other nodes continue to operate Add new connections
  • 57. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Continuous write availability SHARED STORAGE M1 M2 M_n M1 recovery complete App Other nodes continue to operate Add new connections AZ1 AZ2 AZ3 Uninterrupted read/write availability to the multi-master cluster even through AZ failure
  • 58. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Distributed Lock Manager GLOBAL RESOURCE MANAGER SQL TRANSACTIONS CACHING LOGGING SQL TRANSACTIONS CACHING LOGGING SHARED DISK CLUSTER STORAGE APPLICATION LOCKING PROTOCOL MESSAGES SHARED STORAGE M1 M2 M3 M1 M1 M1M2 M3 M2 Cons Heavyweight cache coherency traffic, on per-lock basis Networking can be expensive Negative scaling when hot blocks Pros All data available to all nodes Easy to build applications Similar cache coherency as in multi-processors
  • 59. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Consensus with two phase or Paxos commit DATA RANGE #1 DATA RANGE #2 DATA RANGE #4 DATA RANGE #3 DATA RANGE #5 L L L L L SHARED NOTHING SQL TRANSACTIONS CACHING LOGGING SQL TRANSACTIONS CACHING LOGGING APPLICATION STORAGE STORAGE Cons Heavyweight commit and membership change protocols Range partitioning can result in hot partitions, not just hot blocks. Re-partitioning expensive. Cross partition operations expensive. Better at small requests Pros Query broken up and sent to data node Less coherence traffic – just for commits Can scale to many nodes
  • 60. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. “Blue” Master “Orange” Master P1 P2 Aurora instance Aurora instance Aurora storage Write scale-out in Aurora – conflict resolution w/ distrib. ledger The database nodes know transaction orders from that node Operation Implied txn sequence 1 Write (BT1, P1) BT1 3 Write (BT1, P2) BT1 → BT2 4 Commit (BT1) BT2 5 Commit (BT2) - Blue Master transaction = BT1, BT2 Orange Master transaction = - BT1 BT2 BT1 → BT22 Write (BT2, P1)
  • 61. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Write scale-out in Aurora – conflict resolution w/ distrib. ledger The database nodes know transaction orders from that node 3 Commit (OT1) BT1 “Blue” Master “Orange” Master P1 P2 Aurora instance Aurora instance Aurora storage 4 Commit (BT1) - 2 Write (OT1, P2) BT1, OT1 Blue Master transaction = BT1 Orange Master transaction = OT1 BT1 OT1 Implied txn sequence 1 Write (BT1, P1) BT1 Operation
  • 62. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Write scale-out in Aurora – conflict resolution w/ distrib. ledger P1 P2 Aurora instance Aurora instance Aurora storage “Blue” Master “Orange” Master 2 Commit (BT1) - 4 Commit (OT1) - The storage nodes know transaction orders applied at that node 3 Write (OT1, P1) OT1 Blue Master transaction = BT1 Orange Master transaction = OT1 BT1 OT1 Implied txn sequence 1 Write (BT1, P1) BT1 Operation
  • 63. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Write scale-out in Aurora – conflict resolution w/ distrib. ledger We only have conflicts when data changed at both multiple database nodes AND multiple storage nodes ➔ Much less coordination required P1 P2 Aurora instance Aurora instance Aurora storage “Blue” Master “Orange” Master 2 Write (OT1, P2) BT1, OT1 3 Write (BT1, P2) 4 Write (OT2, P1) OT1 → BT1 5 Commit (OT1) OT1 BT1✅ x Blue Master transaction = BT1 Orange Master transaction = OT1 BT1 OT1 OT1 → BT1 Implied txn sequence 1 Write (BT1, P1) BT1 Operation
  • 64. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Multi-region Multi-Master – uses x-region physical replication REGION 1 REGION 2 HEAD NODES HEAD NODES MULTI-AZ STORAGE VOLUME MULTI-AZ STORAGE VOLUME LOCAL PARTITION REMOTE PARTITION Cross-region replication happens at in the storage layer, and based on physical redo (no binlog)
  • 65. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Multi-region Multi-Master Write accepted locally Optimistic concurrency control – no distributed lock manager, no chatty lock management protocol REGION 1 REGION 2 HEAD NODES HEAD NODES MULTI-AZ STORAGE VOLUME MULTI-AZ STORAGE VOLUME LOCAL PARTITION LOCAL PARTITIONREMOTE PARTITION REMOTE PARTITION Conflicts handled hierarchically – at head nodes, at storage nodes, at AZ and region level arbitrators Near-linear performance scaling when there is no or low levels of conflicts
  • 66. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AURORA PARALLEL QUERY
  • 67. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Parallel query processing Aurora storage has thousands of CPUs ▪ Presents opportunity to push down and parallelize query processing using the storage fleet ▪ Moving processing close to data reduces network traffic and latency However, there are significant challenges ▪ Data stored in storage node is not range partitioned – require full scans ▪ Data may be in flight ▪ Read views may not allow viewing most recent data ▪ Not all functions can be pushed down to storage nodes DATABASE NODE STORAGE NODES PUSH DOWN PREDICATES AGGREGATE RESULTS
  • 68. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Parallel Query: Use cases Orders of magnitude faster queries Analytic workloads on OLTP working set • Analyze real-time data • Avoid building ETL pipelines for ad hoc queries • A large number of concurrent analytic queries Reduced contention with OLTP workload Parallelism increases with data size
  • 69. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Parallel query performance 3.41 42.18 15.77 120.03 75.47 47.23 2.17 4.13 23.5 22.61 182.02 104.87 1.13 1 2 4 8 16 32 64 128 256 “We noticed query time reduce from 32 minutes to 3 minutes.” – preview customer (online media company)
  • 70. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Processing at head node STORAGE NODES OPTIMIZER EXECUTOR INNODB NETWORK STORAGE DRIVER AGGREGATOR APPLICATION PARTIAL RESULTS STREAM RESULTS IN-FLIGHT DATA PQ CONTEXT PQ PLAN Query Optimizer produces PQ Plan and creates PQ context based on leaf page discovery PQ request is sent to storage node along with PQ context Storage node produces ▪ Partial results streams with processed stable rows ▪ Raw stream of unprocessed rows with pending undos Head node aggregates these data streams to produce final results
  • 71. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Processing at storage node Each storage node runs up to 16 PQ processes, each associated with a parallel query PQ process receives PQ context ▪ List of pages to scan ▪ Read view and projections ▪ Expression evaluation byte code PQ process makes two passes through the page list ▪ Pass 1: Filter evaluation on InnoDB formatted raw data ▪ Pass 2: Expression evaluation on MySQL formatted data PQ PROCESS PQ PROCESS Up to 16 TO/FROM HEAD NODE STORAGE NODE PROCESS PAGE LISTS
  • 72. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Submit session feedback 1. Tap the Schedule icon. 2. Select the session you attended. 3. Tap Session Evaluation to submit your feedback.
  • 73. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you!