Home / Companies / Cockroach Labs / Blog / January 2019

January 2019 Summaries

4 posts from Cockroach Labs

Filter
Month: Year:
Post Summaries Back to Blog
Angela Chang, a backend engineering intern at Cockroach Labs, details her work on a new vectorized execution engine that significantly enhances the performance of CockroachDB's SQL operations, particularly the hash join operator. This new model, which processes data in batches of columns rather than rows, achieves a 40x speed increase over the traditional row-at-a-time "Volcano" model. The vectorized execution approach leverages the efficiency of CPU cache and reduces the need for type casting and runtime decisions, making it more CPU-friendly. The blog post delves into the implementation challenges and advantages of vectorized execution, illustrating the differences through practical examples and demonstrating the superior performance of the new engine with benchmark results. Angela credits her internship for providing valuable insights into CPU architecture and compiler optimizations, and concludes with an invitation for engineers to join Cockroach Labs to work on innovative projects like this one.
Jan 31, 2019 2,963 words in the original blog post.
CockroachDB is an open-source, distributed SQL database that provides a sophisticated consistency model, which exceeds standard serializability but falls short of strict serializability, while ensuring no stale reads in transactions. The database employs multi-version concurrency control (MVCC) to manage transaction isolation and guarantees that once a write transaction is committed, all subsequent read transactions will see it, thereby preventing stale reads. CockroachDB's implementation involves a transaction layer that assigns timestamps to ensure correct transaction ordering, even across unsynchronized nodes. Although it allows a rare anomaly known as "causal reverse," where concurrent transactions might appear out of order, this is mitigated by ensuring overlapping read/write sets are properly synchronized. CockroachDB effectively balances high consistency with performance and resilience, making it a compelling choice for distributed systems despite not offering full strict serializability.
Jan 24, 2019 6,922 words in the original blog post.
CockroachDB initially built its infrastructure on RocksDB, a key-value storage engine based on log-structured merge trees (LSM), due to its rich feature set essential for a distributed SQL database, despite transitioning to their own Pebble engine later. RocksDB's capabilities, such as prefix bloom filters, fast scans, snapshots, and custom key comparators, are crucial for addressing the performance and complexity of distributed systems, allowing CockroachDB to translate SQL operations into key-value operations efficiently across multiple nodes. While RocksDB's C++ foundation poses challenges in integrating with CockroachDB’s Go-based system, the benefits of its comprehensive features, like SSTable ingestion, range deletion tombstones, and encryption support, outweigh these drawbacks. Cockroach Labs continues to leverage RocksDB for its high concurrency and performance needs while acknowledging the potential advantages of a Go-native storage engine to streamline operations further.
Jan 17, 2019 3,319 words in the original blog post.
CockroachDB, a distributed SQL database, has evolved from a key-value store to a full SQL database, maintaining its core transaction protocol while improving transaction speed through a new feature called Transactional Pipelining, introduced in version 2.1. This optimization reduces transaction latency by enabling concurrent consensus rounds, decreasing time complexity from O(n) to O(1), where n is the number of DML statements. The traditional transaction protocol involved a linear scaling of latency with each DML statement due to the need for synchronous consensus rounds. In contrast, Transactional Pipelining allows for asynchronous consensus, enabling the concurrent processing of intent writes and postponing the consensus requirement until the commit phase, effectively reducing the transaction latency to a constant multiple of consensus latency. Benchmark tests, including those using the TPC-C New-Order transaction, demonstrate significant performance improvements with transactional pipelining, highlighting its ability to reduce latency and enhance throughput. Future enhancements like "parallel commits" are being explored to further decrease consensus-related latency costs.
Jan 10, 2019 6,709 words in the original blog post.