ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO...

28
ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang

Transcript of ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO...

Page 1: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS

KAIJI CHEN, YONGLUAN ZHOU, YU CAO

Presenter: Shu Zhang

Page 2: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

ROADMAP• Introduction

• SOAP System Overview

• Basic Solution

• Feedback-based Approach

• Piggyback-based Approach

• Hybrid Approach

• Evaluation

• Summary

• Related Work

• Strengths and Weaknesses

• Discussion

Page 3: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

INTRODUCTION• Problem

highly concurrent workloads

• Approach

Partition the data and workload across a large number of commodity, shared-nothing servers using a cost-effective, distributed DBMS

• Limitations

Depends on an optimal database design, which defines how an application’s data and workload is partitioned across the nodes in a cluster, and how queries and transactions are routed to the nodes.

A growing fraction of distributed transactions and load skew can degrade performance by a factor of over ten.

Page 4: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

INTRODUCTION (CONT’D)• Approach

Automatic database partitioning - Analyze the workload at a given time and suggest a (near-) optimal repartition scheme in a cost-based or policy-based manner.

• Limitations

post great challenges to DBAs.

Repartition operations should be executed fast enough. But granting high execution priorities to the repartitioning operations will slow down or even stall the normal transaction.

The repartitioning procedure should be as transparent to the users as possible.

Page 5: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

PROBLEM ADDRESSED

How to optimally execute a database repartition plan consisting of a set of repartition operations in a distributed OLTP system, where the repartitioning is expected to take place online without interrupting and disrupting the normal transactions’ processing.

Page 6: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

SOAP

• Definition

A system framework for scheduling online database repartitioning for OLTP workloads.

• Goal

Minimize the time frame of executing the repartition operations while guaranteeing the correctness and performance of the concurrent normal transaction processing.

Page 7: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

SOAP - SYSTEM ARCHITECTURE

Page 8: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

SOAP - SYSTEM ARCHITECTURE (CONT’D)

TRANSACTION MANAGER: manage the processing life-cycle of transactions and guarantees their ACID properties with certain distributed commit protocols and concurrency control protocols.

QUERY ROUTER: maintains the mappings between data partitions and their resident nodes, based on which it routes the incoming transaction queries to the correct nodes for execution.

PROCESSING QUEUE: All the submitted transactions will be associated with a scheduling priority and then put into a PQ, where higher-priority transactions will be executed first, while the FIFO policy will be applied to break the tie.

REPARTITIONER: coordinate its online database repartitioning for OLTP workloads.

OPTIMIZER: periodically extracts the frequency of transactions and their visiting data partitions from the workload history, and then estimates the system throughput and latency in the near future based on the history.

Page 9: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

GENERATING AND RANKING REPARTITION TRANSACTIONS

• Rule

The more “beneficial” ones are executed before less “beneficial” ones.

• Calculate cost

Ci: The cost of running transaction Ti with a repartition plan where all the tuples accessed by Ti are collocated in a single partition.

• Calculate benefit

Bj =

The cost of an arbitrary normal transaction Ti with partition plan P is Ci(P). Benefit of a repartition transaction Tj is Bj. fj is the frequency of Ti

.

Benefit density of Tj is Bj/Cj.

Schedule the repartition transactions in descending order of their benefit densities.

Page 10: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

PACKAGE THE REPARTITION OPERATIONS INTO TRANSACTIONS

Option 1: Put all operations into one transaction

Option 2: Create one transaction for each operation

Trade-off: put the repartition operations that repartition all the objects accessed by a normal transaction into a repartition transaction

Page 11: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

ALGORITHM 1: GENERATING AND RANKING REPARTITION TRANSACTIONS

Page 12: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

BASIC SOLUTION

• Strategies

1. Apply-All: Maximize the speed of applying the repartition plan and submit all the repartition transactions to the waiting queue with a priority higher than the normal transaction.

2. After-All: Schedule repartition transactions only when the system is idle.

• Limitation

Both lack of flexibility to find a good trade-off between two contradicting objectives(maximizing the speed of executing repartition transactions and minimizing the interferences to the processing of normal transactions).

Page 13: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

FEEDBACK-BASED APPROACHSchedule some additional repartition transactions on top of those scheduled by the After-All strategy. These additional transactions will be assigned with the same priority as the normal transactions so that they have the chance to be executed faster.

Need to be able to detect short-term variations of system workload and capacity and promptly adapt the scheduling strategy accordingly.

Limitations: will have repartition transactions contend with normal transactions for the locks of database objects and significantly increase the system’s workload.

Page 14: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

FEEDBACK-BASED APPROACH

Page 15: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

PIGGYBACK-BASED APPROACH

Injects repartition operations into the normal transactions that access the same object. Save the overhead of acquiring and releasing locks as well as performing the distributed commit protocols.

Limitation: fails to take use of the available system resources to speed up the repartitioning process.

Page 16: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

ALGORITHM 2: PIGGYBACK ALGORITHMS FOR INCOMING NORMAL TRANSACTIONS TI(K)

Page 17: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

HYBRID APPROACH

Composed by a piggyback module and a feedback module.

Advantage: when the system workload is low, we can take use of the available resources to repartition the data before the actual arrival of transactions that will access them, and when the system is a bit congested, we can take advantage of the opportunities to piggyback the repartition operations on the incoming transactions.

Page 18: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

EVALUATION

PostgreSQL 9.2.4

JavaSE 1.6

Query router

Query parser

Bitronix(transaction management)

Amazon EC2 cluster consisting of 5 data nodes corresponding to 5 data partitions respectively

1 vCPU using Intel Xeon E5-2670 processor and 3.75 GB memory with an on-demand SSD local storage running 64-bit Ubuntu 13.04

Page 19: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

WORKLOADS AND DATASETS500,000 tuples8 bytes/tuple

Lowload: an average system utilization as 65% before the repartitioning,which is measured by the percentage of time that the system spend on processing the normal transactions.Highload: system overloaded with incoming workload is 30% higher thanthe system capacity.

Page 20: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

EXPERIMENT – HIGH LOAD (ZIPF)

Page 21: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

EXPERIMENT – HIGH LOAD(UNIFORM)

Page 22: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

EXPERIMENT – TRANSACTION FAILURE RATE

Page 23: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

EXPERIMENT – LOW LOAD (ZIPF)

Page 24: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

EXPERIMENT – LOW LOAD (UNIFORM)

Page 25: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

SUMMARY

Propose to use control theory to design an adaptive methods which can dynamically change the frequency that we submit repartition transactions to the system.

Propose a piggyback-based method to mitigate the repartitioning overhead.

Propose a hybrid method composed by a piggyback module and a feedback module.

Based on the experiments, Hybrid is the overall best approach and achieves a great performance improvement.

Page 26: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

RELATED WORKResearchers have recently been focusing on workload-aware partitioning algorithms that take the transaction statistics as input.

Schism[4] is an automatic partitioning tool trying to minimize distributed transactions.

Horticulture[13] further improve this approach by considering temporary skewness of workloads and using a local search algorithm to optimize partition schemes.

Alekh etc. [8] present an online partitioning method that will partition the data in checkpoint time intervals.

Sword[15] introduces an incremental repartitioning algorithm that calculates the contribution of each repartition operation and the cost of executing it.

Page 27: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

STRENGTHS AND WEAKNESSES

• Strengths

• Few previous studies devoted to this problem• No need to partition data manually• Minimize the time frame of executing repartition operations• Able to adapt to low and high workloads

• Weaknesses

• No suggestion on future work.• Only one table is used in experiment

Page 28: ONLINE DATA PARTITIONING IN DISTRIBUTED DATABASE SYSTEMS KAIJI CHEN, YONGLUAN ZHOU, YU CAO Presenter: Shu Zhang.

DISCUSSION

1. Since the authors concluded that hybrid approach is the best solution, is that means nothing to improve?

2. Transactions will fail using any approaches given short time interval. What happen if the transaction failed? Is that any way to ensure the failed transactions will be executed?

3. There are other partitioning approaches such as range-based and hash-based. What’s wrong with these approaches? Why the recent research focus is on workload-aware partitioning?