September 2015 Summaries
2 posts from Cockroach Labs
Filter
Month:
Year:
Post Summaries
Back to Blog
CockroachDB, traditionally known as a distributed, transactionally consistent key-value store, has transitioned to using SQL as the core of its structured data layer. This shift allows CockroachDB to support tables and indexes, facilitating efficient data manipulation and retrieval through SQL queries. The underlying key-value store still plays a critical role, with SQL data encoded into key-value pairs for storage. Each table assigns a unique 64-bit integer ID as a prefix for all keys, and primary keys determine row ordering, enabling optimized data retrieval using index scans. Secondary indexes can be created to improve query efficiency, with unique and non-unique indexes handled differently to maintain data integrity. Null values are not stored as key-value pairs, but indicated by the absence of a key, with a sentinel key ensuring rows with only null values are represented. This approach, similar to systems like MySQL on InnoDB, emphasizes CockroachDB's adaptability in providing SQL functionalities atop a key-value store infrastructure.
Sep 16, 2015
1,560 words in the original blog post.
The article outlines the transaction model of CockroachDB, emphasizing its ability to support ACID transactions across distributed databases without using locks. CockroachDB ensures atomicity, meaning all operations within a transaction are either completed or none are, by implementing a series of steps involving switches and write intents. The transaction process includes creating a transaction record with a unique ID, staging changes using write intents, filtering reads through the transaction's state, committing or aborting transactions, and cleaning up intents to maintain performance. The article notes that CockroachDB also supports concurrent transactions, which will be detailed in a future post. The introductory note mentions that the article was originally written in 2015, and updates are planned to reflect the evolution of CockroachDB since then.
Sep 02, 2015
1,502 words in the original blog post.