STAR: Scaling Transactions Through Asymmetric Replication

STAR: Scaling Transactions Through Asymmetric Replication

STAR: Scaling Transactions through Asymmetric Replication Yi Lu Xiangyao Yu Samuel Madden MIT CSAIL MIT CSAIL MIT CSAIL [email protected] [email protected] [email protected] ABSTRACT In this paper, we present STAR, a new distributed in-memory database with asymmetric replication. By employing a single- STAR node non-partitioned architecture for some replicas and a partitioned architecture for other replicas, STAR is able to efficiently run both highly partitionable workloads and workloads that involve cross-partition transactions. The key Non-partitioned systems idea is a new phase-switching algorithm where the execu- Performance tion of single-partition and cross-partition transactions is separated. In the partitioned phase, single-partition trans- Partitioning-based systems actions are run on multiple machines in parallel to exploit % of cross-partition transactions more concurrency. In the single-master phase, mastership Figure 1: Partitioning-based systems vs. Non- for the entire database is switched to a single designated partitioned systems master node, which can execute these transactions with- single-server, multi-core setting by avoiding locks and con- out the use of expensive coordination protocols like two- tention whenever possible [37, 38, 50, 54], while allowing any phase commit. Because the master node has a full copy of transaction to run on any core/processor. the database, this phase-switching can be done at negligible As shown in Figure1, partitioning-based systems work cost. Our experiments on two popular benchmarks (YCSB well when workloads have few cross-partition transactions, and TPC-C) show that high availability via replication can because they are able to avoid the use of any synchroniza- coexist with fast serializable transaction execution in dis- tion and thus scale out to multiple machines. However, tributed in-memory databases, with STAR outperforming these systems suffer when transactions need to access more systems that employ conventional concurrency control and than one partition, especially in a distributed setting where replication algorithms by up to one order of magnitude. expensive protocols like two-phase commit are required to PVLDB Reference Format: coordinate these cross-partition transactions. In contrast, Yi Lu, Xiangyao Yu and Samuel Madden. STAR: Scaling Trans- non-partitioned approaches provide somewhat lower perfor- actions through Asymmetric Replication. PVLDB, 12(11): 1316- mance on highly-partitionable workloads due to their inabil- 1329, 2019. ity to scale out, but are not sensitive to how partitionable DOI: https://doi.org/10.14778/3342263.3342270 the workload is. In this paper, we propose a new transaction processing 1. INTRODUCTION system, STAR, that is able to achieve the best of both Recent years have seen a number of in-memory trans- worlds. We start with the observation that most modern action processing systems that can run hundreds of thou- transactional systems will keep several replicas of data for sands to millions of transactions per second by leveraging high availability purposes. In STAR, we ensure that at least multi-core parallelism [46, 50, 54]. These systems can be one of these replicas is complete, i.e., it stores all records broadly classified into i) partitioning-based systems, e.g., on a single machine, as in the recent non-partitioned ap- H-Store [46] which partitions data onto different cores or proaches. We also ensure that at least one of the replicas machines, and ii) non-partitioned systems that try to mini- is partitioned across several processors or machines, as in mize the overheads associated with concurrency control in a partitioned schemes. The system runs in two phases, using a novel phase-switching protocol: in the partitioned phase, transactions that can be executed completely on a single This work is licensed under the Creative Commons Attribution- partition are mastered at one of the partial replicas storing NonCommercial-NoDerivatives 4.0 International License. To view a copy that partition, and replicated to all other replicas to ensure of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. For fault tolerance and consistency. Cross-partition transactions any use beyond those covered by this license, obtain permission by emailing are executed during the single-master phase, during which [email protected]. Copyright is held by the owner/author(s). Publication rights mastership for all records is switched to one of the com- licensed to the VLDB Endowment. plete replicas, which runs the transactions to completion and Proceedings of the VLDB Endowment, Vol. 12, No. 11 ISSN 2150-8097. replicates their results to the other replicas. Because this DOI: https://doi.org/10.14778/3342263.3342270 node already has a copy of every record, changing the master 1316 for a record (re-mastering) can be done without transferring concurrency control algorithms by up to one order of mag- any data, ensuring lightweight phase switching. Further- nitude on YCSB and TPC-C. more, because the node has a complete replica, transactions can be coordinated within a single machine without a slow commit protocol like two-phase commit. In this way, cross- 2. BACKGROUND partition transactions do not incur commit overheads as in In this section, we describe how concurrency control allows typical partitioned approaches (because they all run on the database systems to execute transactions with serializability single master), and can be executed using a lightweight con- guarantees. We also introduce how replication is used in currency control protocol like Silo [50]. Meanwhile, single- database systems with consistency guarantees. partition transactions can still be executed without any con- currency control at all, as in H-Store [46], and can be run 2.1 Concurrency Control Protocols on several machines in parallel to exploit more concurrency. Serializability | where the operations of multiple trans- The latency that phase switching incurs is no larger than actions are interleaved to provide concurrency while ensur- the typical delay used in high-performance transaction pro- ing that the state of the database is equivalent to some cessing systems for an epoch-based group commit. serial ordering of the transactions | is the gold standard Although the primary contribution of STAR is this phase- for transaction execution. Many serializable concurrency switching protocol, to build the system, we had to explore control protocols have been proposed, starting from early several novel aspects of in-memory concurrency control. In protocols that played an important role in hiding disk la- particular, prior systems like Silo [50] and TicToc [54] were tency [4] to modern OLTP systems that exploit multicore not designed with high-availability (replication) in mind. parallelism [50, 54], typically employing lock-based and/or Making replication work efficiently in these systems requires optimistic techniques. some care and is amenable to a number of optimizations. For Two-Phase locking (2PL) is the most widely used classi- example, STAR uses intra-phase asynchronous replication to cal protocol to ensure serializability of concurrent transac- achieve high performance. In the meantime, it ensures con- tions [16]. 2PL is considered pessimistic since the database sistency among replicas via a replication fence when phase- acquires locks on operations even when there is no con- switching occurs. In addition, with our phase-switching pro- flict. By contrast, optimistic concurrency control protocols tocol, STAR can use a cheaper replication strategy than (OCC) avoid this by only checking conflicts at the end of a that employed by replicated systems that need to replicate transaction's execution [23]. OCC runs transactions in three entire records [55]. This optimization can significantly re- phases: read, validation, and write. In the read phase, trans- duce bandwidth requirements (e.g., by up to an order of actions perform read operations from the database and write magnitude in our experiments with TPC-C.). operations to local copies of objects without acquiring locks. Our system does require a single node to hold an entire In the validation phase, conflict checks are done against all copy of the database, as in many other modern transactional concurrently committing transactions. If conflicts exist, the systems [12, 17, 22, 26, 50, 52, 54]. Cloud service providers, transaction aborts. Otherwise, it enters the write phase and such as Amazon EC2 [2] and Google Cloud [3], now provide copies its local modifications to the database. Modern sys- high memory instances with 12 TB RAM, and 24 TB in- tems, like Silo [50], typically employ OCC-like techniques stances are coming in the fall of 2019. Such high memory because they make it easier to avoid the overhead of shared instances are sufficient to store 10 kilobytes of online state locks during query execution. about each customer in a database with about one billion In distributed database systems, cross-partition transac- customers, which exceeds the scale of all but the most de- tions involving many machines are classically coordinated manding transactional workloads. In addition, on workloads using two-phase commit (2PC) [34] protocol to achieve fault with skew, a single-node in-memory database can be further tolerance, since machines can fail independently. The coor- extended through an anti-caching architecture [10], which dinator decides to commit or abort a transaction based on provides 10x larger storage and competitive performance

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    14 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us