@andy_pavlo
@andy_pavlo Part #1 Background Part # 2 Engineering Part # 3 - - PowerPoint PPT Presentation
@andy_pavlo Part #1 Background Part # 2 Engineering Part # 3 - - PowerPoint PPT Presentation
@andy_pavlo Part #1 Background Part # 2 Engineering Part # 3 Oracle Rant 3 AUTONOMOUS DBMSs SELF-ADAPTIVE DATABASES 1970-1990s Index Selection Self-Adaptive Partitioning / Sharding Databases Data Placement 3 AUTONOMOUS
Part #1 Part # 2 Part # 3 Background Engineering Oracle Rant
3
SELF-ADAPTIVE DATABASES1970-1990s Self-Adaptive Databases
→Index Selection →Partitioning / Sharding →Data Placement
3
SELF-ADAPTIVE DATABASES1970-1990s Self-Adaptive Databases
SELECT * FROM A JOIN B ON A.ID = B.ID WHERE A.VAL > 123 AND B.NAME LIKE 'XY%' Admin3
SELF-ADAPTIVE DATABASES1970-1990s Self-Adaptive Databases
SELECT * FROM A JOIN B ON A.ID = B.ID WHERE A.VAL > 123 AND B.NAME LIKE 'XY%' A.ID A.VAL B.ID B.NAME Tuning Algorithm Admin3
SELF-ADAPTIVE DATABASES1970-1990s Self-Adaptive Databases
SELECT * FROM A JOIN B ON A.ID = B.ID WHERE A.VAL > 123 AND B.NAME LIKE 'XY%' A.ID A.VAL B.ID B.NAME+100 +200 +50
Tuning Algorithm Admin3
SELF-ADAPTIVE DATABASES1970-1990s Self-Adaptive Databases
SELECT * FROM A JOIN B ON A.ID = B.ID WHERE A.VAL > 123 AND B.NAME LIKE 'XY%' A.ID A.VAL B.ID B.NAME+100 +200 +50
Tuning Algorithm Admin3
SELF-ADAPTIVE DATABASES1970-1990s Self-Adaptive Databases
SELECT * FROM A JOIN B ON A.ID = B.ID WHERE A.VAL > 123 AND B.NAME LIKE 'XY%' A.ID A.VAL B.ID B.NAME+100 +200 +50
Tuning Algorithm Admin3
SELF-ADAPTIVE DATABASES1970-1990s Self-Adaptive Databases
SELECT * FROM A JOIN B ON A.ID = B.ID WHERE A.VAL > 123 AND B.NAME LIKE 'XY%' A.ID A.VAL B.ID B.NAME Tuning Algorithm Admin→Index Selection →Partitioning / Sharding →Data Placement
4
SELF-TUNING DATABASES1990-2000s Self-Tuning Databases
SELECT * FROM A JOIN B ON A.ID = B.ID WHERE A.VAL > 123 AND B.NAME LIKE 'XY%' Tuning Algorithm Admin→Index Selection →Partitioning / Sharding →Data Placement
A.ID A.VAL B.ID B.NAME4
SELF-TUNING DATABASES1990-2000s Self-Tuning Databases
SELECT * FROM A JOIN B ON A.ID = B.ID WHERE A.VAL > 123 AND B.NAME LIKE 'XY%' Tuning Algorithm AdminAutoAdmin
A.ID A.VAL B.ID B.NAME Optimizer Cost Model4
SELF-TUNING DATABASES1990-2000s Self-Tuning Databases
SELECT * FROM A JOIN B ON A.ID = B.ID WHERE A.VAL > 123 AND B.NAME LIKE 'XY%' Tuning Algorithm AdminAutoAdmin
A.ID A.VAL B.ID B.NAME Optimizer Cost Model541 291
200 400 600 2000 2004 2008 2012 2016 Number of Knobs
AUTONOMOUS DBMSs4
SELF-TUNING DATABASES1990-2000s Self-Tuning Databases
→Knob Configuration
5
CLOUD MANAGED DATABASES2010s Cloud Databases
5
CLOUD MANAGED DATABASES2010s Cloud Databases
5
CLOUD MANAGED DATABASES2010s Cloud Databases
→Initial Placement →Tenant Migration
W hy is this previous work insufficient?
7
A BRIEF HISTORYProblem #1 Human Judgements Problem #2 Reactionary Measures
W hat is different this time?
Better hardware. Better machine learning tools. Better appreciation for data. We seek to complete the circle in autonomous databases.
WHY NOW?10
RESEARCH PROJECTSOtterTune Existing Systems Peloton New System
OtterTune
Database Tuning-as-a-Service → Automatically generate DBMS knob configurations. → Reuse data from previous tuning sessions.
- ttertune.cs.cmu.edu
Supported Systems
12
AUTOMATIC DBMS TUNING SERVICETARGET DATABASE
CONTROLLER
COLLECTOR12
AUTOMATIC DBMS TUNING SERVICETARGET DATABASE
TUNING MANAGER CONTROLLER
COLLECTOR Configur igurat ation- n
12
AUTOMATIC DBMS TUNING SERVICETARGET DATABASE
TUNING MANAGER CONTROLLER
COLLECTOR Configur igurat ation- n
12
AUTOMATIC DBMS TUNING SERVICETARGET DATABASE
TUNING MANAGER CONTROLLER
COLLECTOR Configur igurat ation- n
12
AUTOMATIC DBMS TUNING SERVICETARGET DATABASE
TUNING MANAGER CONTROLLER
COLLECTOR Configur igurat ation- n
12
AUTOMATIC DBMS TUNING SERVICETARGET DATABASE
TUNING MANAGER CONTROLLER
COLLECTOR Configur igurat ation- n
12
AUTOMATIC DBMS TUNING SERVICETARGET DATABASE
TUNING MANAGER CONTROLLER
COLLECTOR Configur igurat ation- n
12
AUTOMATIC DBMS TUNING SERVICETARGET DATABASE
TUNING MANAGER CONTROLLER
COLLECTOR Configur igurat ation- n
13
DEMODemonstration
Postgres v9.3 TPC-C Benchmark
250 500 750 1000
426 845 714 843 946250 500 750 1000
Throughput (txn/sec)Default RDS DBA Scripts OtterTune
14
Peloton
Self-Driving Database System → In-memory DBMS with integrated ML/RL framework. → Designed for autonomous
- perations.
pelotondb.io
16
THE SELF-DRIVING DBMSTARGET DATABASE WORKLOAD HISTORY
16
THE SELF-DRIVING DBMSFORECAST MODELS TARGET DATABASE WORKLOAD HISTORY
"THE BRAIN"
PELOTON16
THE SELF-DRIVING DBMSFORECAST MODELS
Search Tree ACTION CATALOGTARGET DATABASE WORKLOAD HISTORY
"THE BRAIN"
PELOTON16
THE SELF-DRIVING DBMSFORECAST MODELS
Search Tree ACTION CATALOG ACTION SEQUENCETARGET DATABASE WORKLOAD HISTORY
"THE BRAIN"
PELOTON16
THE SELF-DRIVING DBMSFORECAST MODELS
Search Tree ACTION CATALOG ACTION SEQUENCETARGET DATABASE WORKLOAD HISTORY
"THE BRAIN"
PELOTON16
THE SELF-DRIVING DBMSFORECAST MODELS
Search Tree ACTION CATALOG ACTION SEQUENCETARGET DATABASE WORKLOAD HISTORY
"THE BRAIN"
PELOTON16
THE SELF-DRIVING DBMSFORECAST MODELS
Search Tree ACTION CATALOG ACTION SEQUENCETARGET DATABASE WORKLOAD HISTORY
? ? ?
Ensemble (LR+RNN)
17
Actual Predicted Queries Per Hour
5 10 15 26-Nov 30-Nov 4-Dec 8-Dec 12-Dec 16-Dec
MillionsActual Predicted Ensemble (LR+RNN)
18
Queries Per Hour
5 10 15 26-Nov 30-Nov 4-Dec 8-Dec 12-Dec 16-Dec
MillionsActual Predicted Ensemble (LR+RNN)
18
Queries Per Hour
5 10 15 26-Nov 30-Nov 4-Dec 8-Dec 12-Dec 16-Dec
MillionsActual Predicted
5 10 15 26-Nov 30-Nov 4-Dec 8-Dec 12-Dec 16-Dec
MillionsEnsemble (LR+RNN) Hybrid (LR+RNN+KR)
18
Queries Per Hour
19
DEMOLet's on check the demo…
Design Considerations for Autonomous Operation
21
DESIGN CONSIDERATIONSConfiguration Knobs Internal Metrics Action Engineering
Anything that requires a human value judgement should be marked as off-limits to autonomous components.
– File Paths – Network Addresses – Durability / Isolation Levels 22
UNTUNABLE KNOBS CONFIGURATION KNOBSThe autonomous components need hints about how to change a knob
– Min/max ranges. – Separate knobs to enable/disable a feature. – Non-uniform deltas. 23
HOW TO CHANGEThe autonomous components need hints about how to change a knob
– Min/max ranges. – Separate knobs to enable/disable a feature. – Non-uniform deltas. 23
HOW TO CHANGE1 KB 1 MB 1 GB 1 TB
+10 KB +10 MB +10 GBThe autonomous components need hints about how to change a knob
– Min/max ranges. – Separate knobs to enable/disable a feature. – Non-uniform deltas. 23
HOW TO CHANGEIndicate which knobs are constrained by hardware resources.
– The sum of all buffers cannot exceed the total amount of available memory.
The problem is that sometimes it makes sense to overprovision.
24
HARDWARE RESOURCESExpose DBMS's hardware capabilities:
– CPU, Memory, Disk, Network 25
HARDWARE INFORMATION Configu figura rati tion- n
Expose DBMS's hardware capabilities:
– CPU, Memory, Disk, Network
Otherwise you have to come up with clever ways to approximate this…
25
HARDWARE INFORMATIONMicrobenchmark Threads
26
HARDWARE MICROBENCHMARKS c3.large i3.large m3.lar… r3.large c3.xlarge r3.xlarge i2.xlarge i3.xlarge m3.xlar… d2.xlar… c3.2xlarge d2.2xlarge h1.2xlarge i2.2xlarge i3.2xlarge m3.2xlar… r3.2xlarge c3.4xlarge d2.4xlar… h1.4xlarge i2.4xlarge i3.4xlarge r3.4xlarge c3.8xlarge h1.8xlarge- 0.3
- 0.2
- 0.1
Factor 2 Factor 1 2 vCPUs 4 vCPUs 8 vCPUs 16 vCPUs 32 vCPUs Factor Analysis
If the DBMS has sub-components that are tunable, then it must expose separate metrics for those components. Bad Example:
27
SUB-COMPONENTS28
SUB-COMPONENTSRocksDB Column Family Knobs Column Family Metrics
Missing: Reads Writes
28
SUB-COMPONENTSRocksDB Column Family Knobs Global Metrics
Aggregated Metrics
No action should ever require the DBMS to restart in order for it to take affect. The commercial systems are much better than this than the open-source systems.
29
NO SHUTDOWNProvide a notification callback to indicate when an action starts and when it completes. Harder for changes that can be used before the action completes.
30
NOTIFICATIONSSupport executing the same action with different resource usage levels.
31
RESOURCE USAGEAllow replica configurations to diverge from each other.
32
REPLICA EXPLORATIONMaster Replicas
Allow replica configurations to diverge from each other.
32
REPLICA EXPLORATIONMaster Replicas
Allow replica configurations to diverge from each other.
32
REPLICA EXPLORATIONMaster Replicas
Allow replica configurations to diverge from each other.
32
REPLICA EXPLORATIONMaster Replicas
Allow replica configurations to diverge from each other.
32
REPLICA EXPLORATIONMaster Replicas
W hat About Oracle's Self-Driving DBMS?
34 September 2017 January 2017
Automatic Indexing Automatic Recovery Automatic Scaling Automatic Query Tuning
SELF-DRIVING DBMS34 September 2017
Automatic Indexing Automatic Recovery Automatic Scaling Automatic Query Tuning
SELF-DRIVING DBMS34
Problem #2 Reactionary MeasuresSeptember 2017
Automatic Indexing Automatic Recovery Automatic Scaling Automatic Query Tuning
SELF-DRIVING DBMS34
Problem #2 Reactionary MeasuresSeptember 2017
Automatic Indexing Automatic Recovery Automatic Scaling Automatic Query Tuning
SELF-DRIVING DBMS34
Problem #2 Reactionary MeasuresSeptember 2017
True autonomous DBMSs are achievable in the next decade. You should think about how each new feature can be controlled by a machine.
MAIN TAKEAWAYS35
36
DEMODemo Results
END
@andy_pavlo