Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Part #1
Part #2
Part #3
Background
Engineering
Oracle Rant
AUTONOMOUS DBMSs 3SELF-ADAPTIVE DATABASES
1970-1990sSelf-Adaptive
Databases
→Index Selection→Partitioning / Sharding→Data Placement
AUTONOMOUS DBMSs 3SELF-ADAPTIVE DATABASES
1970-1990sSelf-Adaptive
Databases
SELECT * FROM A JOIN BON A.ID = B.ID
WHERE A.VAL > 123AND B.NAME LIKE 'XY%'
Admin
AUTONOMOUS DBMSs 3SELF-ADAPTIVE DATABASES
1970-1990sSelf-Adaptive
Databases
SELECT * FROM A JOIN BON A.ID = B.ID
WHERE A.VAL > 123AND B.NAME LIKE 'XY%'
A.IDA.VALB.ID
B.NAMETuning
Algorithm
Admin
AUTONOMOUS DBMSs 3SELF-ADAPTIVE DATABASES
1970-1990sSelf-Adaptive
Databases
SELECT * FROM A JOIN BON A.ID = B.ID
WHERE A.VAL > 123AND B.NAME LIKE 'XY%'
A.IDA.VALB.ID
B.NAME
+100 +200 +50
TuningAlgorithm
Admin
AUTONOMOUS DBMSs 3SELF-ADAPTIVE DATABASES
1970-1990sSelf-Adaptive
Databases
SELECT * FROM A JOIN BON A.ID = B.ID
WHERE A.VAL > 123AND B.NAME LIKE 'XY%'
A.IDA.VALB.ID
B.NAME
+100 +200 +50
TuningAlgorithm
Admin
AUTONOMOUS DBMSs 3SELF-ADAPTIVE DATABASES
1970-1990sSelf-Adaptive
Databases
SELECT * FROM A JOIN BON A.ID = B.ID
WHERE A.VAL > 123AND B.NAME LIKE 'XY%'
A.IDA.VALB.ID
B.NAME
+100 +200 +50
TuningAlgorithm
Admin
AUTONOMOUS DBMSs 3SELF-ADAPTIVE DATABASES
1970-1990sSelf-Adaptive
Databases
SELECT * FROM A JOIN BON A.ID = B.ID
WHERE A.VAL > 123AND B.NAME LIKE 'XY%'
A.IDA.VALB.ID
B.NAMETuning
Algorithm
Admin
→Index Selection→Partitioning / Sharding→Data Placement
AUTONOMOUS DBMSs 4SELF-TUNING DATABASES
1990-2000sSelf-TuningDatabases
SELECT * FROM A JOIN BON A.ID = B.ID
WHERE A.VAL > 123AND B.NAME LIKE 'XY%'
TuningAlgorithm
Admin
→Index Selection→Partitioning / Sharding→Data Placement
A.IDA.VALB.ID
B.NAME
AUTONOMOUS DBMSs 4SELF-TUNING DATABASES
1990-2000sSelf-TuningDatabases
SELECT * FROM A JOIN BON A.ID = B.ID
WHERE A.VAL > 123AND B.NAME LIKE 'XY%'
TuningAlgorithm
Admin
AutoAdmin
A.IDA.VALB.ID
B.NAME
OptimizerCost Model
AUTONOMOUS DBMSs 4SELF-TUNING DATABASES
1990-2000sSelf-TuningDatabases
SELECT * FROM A JOIN BON A.ID = B.ID
WHERE A.VAL > 123AND B.NAME LIKE 'XY%'
TuningAlgorithm
Admin
AutoAdmin
A.IDA.VALB.ID
B.NAME
OptimizerCost Model
541
291
0
200
400
600
2000 2004 2008 2012 2016
Number of Knobs
AUTONOMOUS DBMSs 4SELF-TUNING DATABASES
1990-2000sSelf-TuningDatabases →Knob Configuration
AUTONOMOUS DBMSs 5CLOUD MANAGED DATABASES
2010sCloud
Databases
AUTONOMOUS DBMSs 5CLOUD MANAGED DATABASES
2010sCloud
Databases
AUTONOMOUS DBMSs 5CLOUD MANAGED DATABASES
2010sCloud
Databases
→Initial Placement→Tenant Migration
Why is this previous workinsufficient?
AUTONOMOUS DBMSs 7A BRIEF HISTORY
Problem #1Human
Judgements
Problem #2Reactionary
Measures
What is different this time?
AUTONOMOUS DATABASES
Better hardware.Better machine learning tools.Better appreciation for data.
We seek to complete the circle in autonomous databases.
WHY NOW?
CARNEGIE MELLON UNIVERSITY 10RESEARCH PROJECTS
OtterTuneExistingSystems
PelotonNew
System
OtterTune
Database Tuning-as-a-Service
→ Automatically generate DBMS knob configurations.
→ Reuse data from previous tuning sessions.
ottertune.cs.cmu.edu SupportedSystems
OTTERTUNE 12AUTOMATIC DBMS TUNING SERVICE
TARGETDATABASE
CONTROLLERCOLLECTOR
OTTERTUNE 12AUTOMATIC DBMS TUNING SERVICE
TARGETDATABASE
TUNING MANAGERCONTROLLERCOLLECTOR
Configuration Recommender
KnobAnalyzer
MetricAnalyzer
InternalRepository
OTTERTUNE 12AUTOMATIC DBMS TUNING SERVICE
TARGETDATABASE
TUNING MANAGERCONTROLLERCOLLECTOR
Configuration Recommender
KnobAnalyzer
MetricAnalyzer
InternalRepository
OTTERTUNE 12AUTOMATIC DBMS TUNING SERVICE
TARGETDATABASE
TUNING MANAGERCONTROLLERCOLLECTOR
Configuration Recommender
KnobAnalyzer
MetricAnalyzer
InternalRepository
OTTERTUNE 12AUTOMATIC DBMS TUNING SERVICE
TARGETDATABASE
TUNING MANAGERCONTROLLERCOLLECTOR
Configuration Recommender
KnobAnalyzer
MetricAnalyzer
InternalRepository
OTTERTUNE 12AUTOMATIC DBMS TUNING SERVICE
TARGETDATABASE
TUNING MANAGERCONTROLLERCOLLECTOR
Configuration Recommender
KnobAnalyzer
MetricAnalyzer
InternalRepository
OTTERTUNE 12AUTOMATIC DBMS TUNING SERVICE
TARGETDATABASE
TUNING MANAGERCONTROLLERCOLLECTOR
Configuration Recommender
KnobAnalyzer
MetricAnalyzer
InternalRepository
OTTERTUNE 12AUTOMATIC DBMS TUNING SERVICE
TARGETDATABASE
TUNING MANAGERCONTROLLERCOLLECTOR
Configuration Recommender
KnobAnalyzer
MetricAnalyzer
InternalRepository
INSTALL AGENT
OTTERTUNE 13DEMO
DemonstrationPostgres v9.3
TPC-C Benchmark
OTTERTUNE
TPC-C TUNING
AUTOMATIC DATABASE MANAGEMENT SYSTEM TUNING THROUGH LARGE-SCALE MACHINE LEARNINGSIGMOD 2017
165
508 562
736 686
0
250
500
750
1000
426
845714
843946
0
250
500
750
1000Throughput (txn/sec)
Default RDS DBAScripts OtterTune
14
Peloton
Self-Driving Database System
→ In-memory DBMS with integrated ML/RL framework.
→ Designed for autonomous operations.
pelotondb.io
PELOTON 16THE SELF-DRIVING DBMS
TARGETDATABASE
WORKLOADHISTORY
PELOTON 16THE SELF-DRIVING DBMS
FORECAST MODELSTARGET
DATABASE
WORKLOADHISTORY
"THE BRAIN"PELOTON 16THE SELF-DRIVING DBMS
FORECAST MODELS
Search Tree
ACTIONCATALOG
TARGETDATABASE
WORKLOADHISTORY
"THE BRAIN"PELOTON 16THE SELF-DRIVING DBMS
FORECAST MODELS
Search Tree
ACTIONCATALOG
ACTION SEQUENCETARGET
DATABASE
WORKLOADHISTORY
"THE BRAIN"PELOTON 16THE SELF-DRIVING DBMS
FORECAST MODELS
Search Tree
ACTIONCATALOG
ACTION SEQUENCETARGET
DATABASE
WORKLOADHISTORY
"THE BRAIN"PELOTON 16THE SELF-DRIVING DBMS
FORECAST MODELS
Search Tree
ACTIONCATALOG
ACTION SEQUENCETARGET
DATABASE
WORKLOADHISTORY
"THE BRAIN"PELOTON 16THE SELF-DRIVING DBMS
FORECAST MODELS
Search Tree
ACTIONCATALOG
ACTION SEQUENCETARGET
DATABASE
WORKLOADHISTORY ?
??
PELOTON
BUS TRACKING APP WITH ONE-HOUR HORIZON
QUERY-BASED WORKLOAD FORECASTING FOR SELF-DRIVING DATABASE MANAGEMENT SYSTEMSIGMOD 2018
0
15000
30000
45000
60000
9-Jan 11-Jan 13-Jan 15-Jan 17-Jan
Ensemble (LR+RNN)
17
Actual Predicted
Que
ries
Per
Hou
r
PELOTON
ADMISSIONS APP WITH THREE-DAY HORIZON
0
5
10
15
26-Nov 30-Nov 4-Dec 8-Dec 12-Dec 16-Dec
Mill
ions
Actual Predicted
Ensemble (LR+RNN)
18Q
ueri
es P
er H
our
PELOTON
ADMISSIONS APP WITH THREE-DAY HORIZON
0
5
10
15
26-Nov 30-Nov 4-Dec 8-Dec 12-Dec 16-Dec
Mill
ions
Actual Predicted
Ensemble (LR+RNN)
18Q
ueri
es P
er H
our
PELOTON
ADMISSIONS APP WITH THREE-DAY HORIZON
0
5
10
15
26-Nov 30-Nov 4-Dec 8-Dec 12-Dec 16-Dec
Mill
ions
Actual Predicted
0
5
10
15
26-Nov 30-Nov 4-Dec 8-Dec 12-Dec 16-Dec
Mill
ions
Ensemble (LR+RNN)
Hybrid (LR+RNN+KR)
18Q
ueri
es P
er H
our
Design Considerations forAutonomous Operation
AUTONMOUS DBMS 21DESIGN CONSIDERATIONS
ConfigurationKnobs
InternalMetrics
ActionEngineering
Anything that requires a human value judgement should be marked as off-limits to autonomous components.
– File Paths– Network Addresses– Durability / Isolation Levels
22UNTUNABLE KNOBS
CONFIGURATION KNOBS
CONFIGURATION KNOBS
The autonomous components need hints about how to change a knob
– Min/max ranges.– Separate knobs to enable/disable a feature.– Non-uniform deltas.
23HOW TO CHANGE
CONFIGURATION KNOBS
The autonomous components need hints about how to change a knob
– Min/max ranges.– Separate knobs to enable/disable a feature.– Non-uniform deltas.
23HOW TO CHANGE
1 KB 1 MB 1 GB 1 TB+10 KB +10 MB +10 GB
CONFIGURATION KNOBS
The autonomous components need hints about how to change a knob
– Min/max ranges.– Separate knobs to enable/disable a feature.– Non-uniform deltas.
23HOW TO CHANGE
CONFIGURATION KNOBS
Indicate 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.
24HARDWARE RESOURCES
INTERNAL METRICS
Expose DBMS's hardware capabilities:– CPU, Memory, Disk, Network
25HARDWARE INFORMATION
Configuration Recommender
INTERNAL METRICS
Expose DBMS's hardware capabilities:– CPU, Memory, Disk, Network
Otherwise you have to come up with clever ways to approximate this…
25HARDWARE INFORMATION
MicrobenchmarkThreads
INTERNAL METRICS 26HARDWARE MICROBENCHMARKS
c3.large
i3.largem3.lar…r3.large
c3.xlarger3.xlargei2.xlarge
i3.xlarge
m3.xlar…
d2.xlar…
c3.2xlarged2.2xlargeh1.2xlarge
i2.2xlarge
i3.2xlarge
m3.2xlar…
r3.2xlarge
c3.4xlarged2.4xlar…
h1.4xlarge
i2.4xlarge
i3.4xlarge
r3.4xlarge
c3.8xlarge
h1.8xlarge
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
0.60 0.64 0.68 0.72 0.76 0.80
Fact
or 2
Factor 1
2 vCPUs 4 vCPUs 8 vCPUs 16 vCPUs 32 vCPUs
Factor Analysis
INTERNAL METRICS
If the DBMS has sub-components that are tunable, then it must expose separate metrics for those components.
Bad Example:
27SUB-COMPONENTS
INTERNAL METRICS 28SUB-COMPONENTS
RocksDB Column Family Knobs
Column Family Metrics
Missing:ReadsWrites
INTERNAL METRICS 28SUB-COMPONENTS
RocksDB Column Family Knobs
Global Metrics
AggregatedMetrics
ACTION ENGINEERING
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.
29NO SHUTDOWN
ACTION ENGINEERING
Provide a notification callback to indicate when an action starts and when it completes.
Harder for changes that can be used before the action completes.
30NOTIFICATIONS
ACTION ENGINEERING
Support executing the same action with different resource usage levels.
31RESOURCE USAGE
ACTION ENGINEERING
Allow replica configurations to diverge from each other.
32REPLICA EXPLORATION
Master
Replicas
ACTION ENGINEERING
Allow replica configurations to diverge from each other.
32REPLICA EXPLORATION
Master
Replicas
ACTION ENGINEERING
Allow replica configurations to diverge from each other.
32REPLICA EXPLORATION
Master
Replicas
ACTION ENGINEERING
Allow replica configurations to diverge from each other.
32REPLICA EXPLORATION
Master
Replicas
ACTION ENGINEERING
Allow replica configurations to diverge from each other.
32REPLICA EXPLORATION
Master
Replicas
What About Oracle'sSelf-Driving DBMS?
ORACLE
SELF-DRIVING DBMS34
September 2017 January 2017
ORACLE
Automatic Indexing
Automatic Recovery
Automatic Scaling
Automatic Query Tuning
SELF-DRIVING DBMS34
September 2017
ORACLE
Automatic Indexing
Automatic Recovery
Automatic Scaling
Automatic Query Tuning
SELF-DRIVING DBMS34
Problem #2Reactionary
Measures
September 2017
ORACLE
Automatic Indexing
Automatic Recovery
Automatic Scaling
Automatic Query Tuning
SELF-DRIVING DBMS34
Problem #2Reactionary
Measures
September 2017
ORACLE
Automatic Indexing
Automatic Recovery
Automatic Scaling
Automatic Query Tuning
SELF-DRIVING DBMS34
Problem #2Reactionary
Measures
September 2017
CONCLUSION
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
END@andy_pavlo