@andy_pavlo Automatic Database Partitioning in Parallel OLTP Systems SIGMOD May 22 nd, 2012
2
3
4
5
Main Memory Parallel Shared-Nothing Transaction Processing H-Store: A High-Performance, Distributed Main Memory Transaction Processing System Proc. VLDB Endow., vol. 1, iss. 2, pp , 2008.
7 Client Application Database Cluster Procedure Name Input Parameters Procedure Name Input Parameters Transactio n Execution Transactio n Execution Database Cluster Transactio n Result Transactio n Result
TPC-C NewOrder 8
9
10
Automatic Database Design Tool for Parallel Systems Skew-Aware Automatic Database Partitioning in Shared-Nothing, Parallel OLTP Systems SIGMOD 2012
… Sche ma Worklo ad D DL SELECT * FROM WAREHOUSE WHERE W_ID = 10; INSERT INTO ORDERS (O_W_ID, O_D_ID, O_C_ID) VALUES (10, 9, 12345); ⋮ SELECT * FROM WAREHOUSE WHERE W_ID = 10; INSERT INTO ORDERS (O_W_ID, O_D_ID, O_C_ID) VALUES (10, 9, 12345); ⋮ SELECT * FROM WAREHOUSE WHERE W_ID = 10; INSERT INTO ORDERS (O_W_ID, O_D_ID, O_C_ID) VALUES (10, 9, 12345); ⋮ SELECT * FROM WAREHOUSE WHERE W_ID = 10; INSERT INTO ORDERS (O_W_ID, O_D_ID, O_C_ID) VALUES (10, 9, 12345); ⋮ SELECT * FROM WAREHOUSE WHERE W_ID = 10; SELECT * FROM DISTRICT D_W_ID = 10 AND D_ID =9; INSERT INTO ORDERS (O_W_ID, O_D_ID, O_C_ID) VALUES (10, 9, 12345); ⋮ SELECT * FROM WAREHOUSE WHERE W_ID = 10; SELECT * FROM DISTRICT D_W_ID = 10 AND D_ID =9; INSERT INTO ORDERS (O_W_ID, O_D_ID, O_C_ID) VALUES (10, 9, 12345); ⋮ SELECT * FROM WAREHOUSE WHERE W_ID = 10; SELECT * FROM DISTRICT WHERE D_W_ID = 10 AND D_ID =9; INSERT INTO ORDERS (O_W_ID, O_D_ID, O_C_ID,…) VALUES (10, 9, 12345,…); ⋮ SELECT * FROM WAREHOUSE WHERE W_ID = 10; SELECT * FROM DISTRICT WHERE D_W_ID = 10 AND D_ID =9; INSERT INTO ORDERS (O_W_ID, O_D_ID, O_C_ID,…) VALUES (10, 9, 12345,…); ⋮ NewOrde r DDL CUSTOM ER ORDERS ITEM 12
o_ido_c_ido_w_i d … c_idc_w_idc_last… 10015RZA GZA Raekwo n Deck Killah ODB- CUSTOMERORDERS CUSTO MER ORDER S CUSTO MER ORDER S CUSTO MER ORDER S ITEM i_idi_namei_price… XXX XXX XXX XXX XXX XXX ITEMITEMITEM CUSTOMER c_idc_w_idc_last… 10015RZA GZA Raekwo n Deck Killah ODB- 13
CUSTO MER ORDER S CUSTO MER ORDER S CUSTO MER ORDER S ITEMITEMITEM Client Application NewOrder(5, “Method Man”, 1234) 14
Best Design Input Worklo ad Sche ma D DL Initial Design Relaxation Local Search Restart Large- Neighborhood Search 15
Distributed Transactions Workload Skew Factor + Cost Model
Algorithm Comparison (cost estimate) lower is better TATPTPC-CTPC-C Skewed 17 HorticultureState-of-the-Art
+88%+16%+183% HorticultureState-of-the-Art Throughput TATPTPC-CTPC-C Skewed 18 (txn/sec) higher is better
19
Conclusion: Dating scene is still difficult. But partitioning your database is now easier.
TATPTPC-C TPC-C Skewed TPC-E % Single-Partitioned Transactions Search Times 22
Improvement Breakdown 23 TATP – 64 Partitions (txn/sec)
Scaling Search Times 24 (minutes) 10 Partitions100 Partitions1,000 Partitions10,000 Partitions
FastRepetitiveSmall OLTP Transactions
Database Cluster Client Application Transactio n Result Transactio n Result 26 Two-Phase Commit Prepare Two-Phase Commit Prepare Two-Phase Commit Finish Two-Phase Commit Finish
27
NoSQL+OldSQL