Latch-free Synchronization in Database Systems: Silver Bullet or Fool's Gold?

Recent research on multi-core database architectures has made the argument that, when possible, database systems should abandon the use of latches in favor of latch-free algorithms. Latch-based algorithms are thought to scale poorly due to their use of synchronization based on mutual exclusion. In contrast, latch-free algorithms make strong theoretical guarantees which ensure that the progress of a thread is never impeded due to the delay or failure of other threads. In this paper, we analyze the various factors that influence the performance and scalability of latch-free and latch-based algorithms, and perform a microbenchmark evaluation of latch-free and latch-based synchronization algorithms. Our findings indicate that the argument for latch-free algorithms’ superior scalability is far more nuanced than the current state-of-the-art in multi-core database architectures suggests.

[1]  Ali Ghodsi,et al.  Highly Available Transactions: Virtues and Limitations , 2013, Proc. VLDB Endow..

[2]  David Maier,et al.  Logic and lattices for distributed programming , 2012, SoCC '12.

[3]  Maged M. Michael,et al.  Correction of a Memory Management Method for Lock-Free Data Structures , 1995 .

[4]  Werner Vogels,et al.  Building reliable distributed systems at a worldwide scale demands trade-offs between consistency and availability. , 2022 .

[6]  Philip A. Bernstein,et al.  Orleans: Distributed Virtual Actors for Programmability and Scalability , 2014 .

[7]  Cheng Li,et al.  Making geo-replicated systems fast as possible, consistent when necessary , 2012, OSDI 2012.

[8]  D. M. Hutton,et al.  The Art of Multiprocessor Programming , 2008 .

[9]  Ryan Stutsman,et al.  To Lock, Swap, or Elide: On the Interplay of Hardware Transactional Memory and Lock-Free Indexing , 2015, Proc. VLDB Endow..

[10]  Pradeep Dubey,et al.  PALM: Parallel Architecture-Friendly Latch-Free Modifications to B+ Trees on Many-Core Processors , 2011, Proc. VLDB Endow..

[11]  Johannes Gehrke,et al.  Centiman: elastic, high performance optimistic concurrency control by watermarking , 2015, SoCC.

[12]  Daniel J. Abadi,et al.  Calvin: fast distributed transactions for partitioned database systems , 2012, SIGMOD Conference.

[13]  Ippokratis Pandis,et al.  Eliminating unscalable communication in transaction processing , 2013, The VLDB Journal.

[14]  Maged M. Michael Hazard pointers: safe memory reclamation for lock-free objects , 2004, IEEE Transactions on Parallel and Distributed Systems.

[15]  Craig Freedman,et al.  Hekaton: SQL server's memory-optimized OLTP engine , 2013, SIGMOD '13.

[16]  Keir Fraser,et al.  Concurrent programming without locks , 2007, TOCS.

[17]  Maurice Herlihy,et al.  Obstruction-free synchronization: double-ended queues as an example , 2003, 23rd International Conference on Distributed Computing Systems, 2003. Proceedings..

[18]  Maurice Herlihy,et al.  Wait-free synchronization , 1991, TOPL.

[19]  Michael J. Carey,et al.  Performance of B+ tree concurrency control algorithms , 1993, The VLDB Journal.

[20]  Maged M. Michael,et al.  Simple, fast, and practical non-blocking and blocking concurrent queue algorithms , 1996, PODC '96.

[21]  Anastasia Ailamaki,et al.  A Case for Staged Database Systems , 2003, CIDR.

[22]  Viktor Leis,et al.  The ART of practical synchronization , 2016, DaMoN '16.

[23]  Miron Livny,et al.  Concurrency control performance modeling: alternatives and implications , 1987, TODS.

[24]  Timothy L. Harris,et al.  A Pragmatic Implementation of Non-blocking Linked-Lists , 2001, DISC.

[25]  Eddie Kohler,et al.  Speedy transactions in multicore in-memory databases , 2013, SOSP.

[26]  Eddie Kohler,et al.  Cache craftiness for fast multicore key-value storage , 2012, EuroSys '12.

[27]  Thomas E. Anderson,et al.  The Performance of Spin Lock Alternatives for Shared-Memory Multiprocessors , 1990, IEEE Trans. Parallel Distributed Syst..

[28]  C. Mohan,et al.  ARIES/IM: an efficient and high concurrency index management method using write-ahead logging , 1992, SIGMOD '92.

[29]  Bryan Cantrill,et al.  Real-World Concurrency , 2008, ACM Queue.

[30]  Maurice Herlihy,et al.  A methodology for implementing highly concurrent data structures , 1990, PPOPP '90.

[31]  Brian N. Bershad,et al.  Scheduler activations: effective kernel support for the user-level management of parallelism , 1991, TOCS.

[32]  Gustavo Alonso,et al.  Customized OS support for data-processing , 2016, DaMoN '16.

[33]  J. T. Robinson,et al.  On optimistic methods for concurrency control , 1979, TODS.

[34]  Adrian Schüpbach,et al.  The multikernel: a new OS architecture for scalable multicore systems , 2009, SOSP '09.

[35]  Kihong Kim,et al.  Cache-Conscious Concurrency Control of Main-Memory Indexes on Shared-Memory Multiprocessor Systems , 2001, VLDB.

[36]  Marvin Theimer,et al.  Managing update conflicts in Bayou, a weakly connected replicated storage system , 1995, SOSP.

[37]  Maged M. Michael,et al.  Nonblocking Algorithms and Preemption-Safe Locking on Multiprogrammed Shared Memory Multiprocessors , 1998, J. Parallel Distributed Comput..

[38]  Michael Stonebraker,et al.  Operating system support for database management , 1981, CACM.

[39]  Tudor David,et al.  Everything you always wanted to know about synchronization but were afraid to ask , 2013, SOSP.

[40]  Daniel J. Abadi,et al.  High Performance Transactions via Early Write Visibility , 2017, Proc. VLDB Endow..

[41]  B. Bershad Practical considerations for lock-free concurrent objects , 1991 .

[42]  Danny Hendler,et al.  Lightweight Contention Management for Efficient Compare-and-Swap Operations , 2013, Euro-Par.

[43]  Julia L. Lawall,et al.  Remote Core Locking: Migrating Critical-Section Execution to Improve the Performance of Multithreaded Applications , 2012, USENIX Annual Technical Conference.

[44]  Ippokratis Pandis,et al.  ERMIA: Fast Memory-Optimized Database System for Heterogeneous Workloads , 2016, SIGMOD Conference.

[45]  Alfons Kemper,et al.  Fast Serializable Multi-Version Concurrency Control for Main-Memory Database Systems , 2015, SIGMOD Conference.

[46]  Sudipta Sengupta,et al.  The Bw-Tree: A B-tree for new hardware platforms , 2013, 2013 IEEE 29th International Conference on Data Engineering (ICDE).

[47]  Michael L. Scott,et al.  Algorithms for scalable synchronization on shared-memory multiprocessors , 1991, TOCS.

[48]  Daniel J. Abadi,et al.  Design Principles for Scaling Multi-core OLTP Under High Contention , 2015, SIGMOD Conference.

[49]  Douglas Comer,et al.  Ubiquitous B-Tree , 1979, CSUR.

[50]  Hideaki Kimura,et al.  Mostly-Optimistic Concurrency Control for Highly Contended Dynamic Workloads on a Thousand Cores , 2016, Proc. VLDB Endow..

[51]  Daniel J. Abadi,et al.  Lazy evaluation of transactions in database systems , 2014, SIGMOD Conference.

[52]  Michael J. Freedman,et al.  Don't settle for eventual: scalable causal consistency for wide-area storage with COPS , 2011, SOSP.

[53]  Robert Ennals Software Transactional Memory Should Not Be Obstruction-Free , 2005 .

[54]  Eddie Kohler,et al.  Fast Databases with Fast Durability and Recovery Through Multicore Parallelism , 2014, OSDI.

[55]  Michael Stonebraker,et al.  The End of an Architectural Era (It's Time for a Complete Rewrite) , 2007, VLDB.

[56]  Robert Morris,et al.  Non-scalable locks are dangerous , 2012 .

[57]  Takashi Horikawa Latch-free data structures for DBMS: design, implementation, and evaluation , 2013, SIGMOD '13.

[58]  Ryan Johnson,et al.  Decoupling contention management from scheduling , 2010, ASPLOS XV.

[59]  John D. Valois Lock-free linked lists using compare-and-swap , 1995, PODC '95.

[60]  David R. Cheriton,et al.  The synergy between non-blocking synchronization and operating system structure , 1996, OSDI '96.

[61]  Larry Rudolph,et al.  Dynamic decentralized cache schemes for mimd parallel processors , 1984, ISCA '84.

[62]  Nir Shavit,et al.  TLRW: return of the read-write lock , 2010, SPAA '10.

[63]  Nir Shavit,et al.  Transactional Locking II , 2006, DISC.

[64]  Marc Shapiro,et al.  A comprehensive study of Convergent and Commutative Replicated Data Types , 2011 .

[65]  S. B. Yao,et al.  Efficient locking for concurrent operations on B-trees , 1981, TODS.

[66]  Edward W. Felten,et al.  Performance issues in non-blocking synchronization on shared-memory multiprocessors , 1992, PODC '92.

[67]  Daniel J. Abadi,et al.  Rethinking serializable multiversion concurrency control , 2014, Proc. VLDB Endow..

[68]  Heon Young Yeom,et al.  A scalable lock manager for multicores , 2013, SIGMOD '13.