Blog
Engineering
Improving unordered distinct efficiency in the vectorized SQL engine
For the past four months, I’ve worked as a backend engineering intern with the incredibly talented engineers of the Cockroach Labs SQL Execution team to unlock the full potential of the vectorized engine ahead of the CockroachDB 20.1 release. During this time, I focused on improving the algorithm behind some of CockroachDB’s SQL operators, to reduce memory usage and speed up query execution. In this blog post, I will go over the improvements that I made to the algorithm behind the unordered distinct operator, as well as new algorithms that address some existing inefficiencies.
Archer Zhang
July 9, 2020
Culture
How CockroachDB combats unconscious bias
Before meeting a candidate, your brain has already started playing some unconscious games. You get excited if you see a candidate who went to the same school as you. You get irritated if you see a company you don't like. You have already started making assumptions simply based by what is on paper, showing the power unconscious bias can have in the hiring process.
Lindsay Grenawalt
July 9, 2020
Product
Why TuneGO chose CockroachDB over PostgreSQL
Every startup has a choice: Begin building with something familiar (Postgres, MySQL…) or begin building with something new (CockroachDB). Using a familiar database means engineers can hit the ground running and begin building on a trustworthy platform. Using a new database will require research, testing, and a period of time for acclimation. On the surface this looks like a simple decision: start building faster with a familiar database. Peel the onion back one more layer and it becomes clear why so many growth-stage companies are deciding to start with CockroachDB rather than Postgres or MySQL.
Dan Kelly
July 7, 2020
Engineering
Disk spilling in a vectorized execution engine
Late last year, we shipped v1 of our vectorized execution engine. It enables column-based query execution and speeds up complex joins and aggregations, improving analytical capabilities in CockroachDB (which is first and foremost optimized for OLTP workloads). v1 of the engine didn’t support disk spilling, which meant it couldn’t execute certain memory-intensive queries if there was not enough memory available. Starting in CockroachDB v20.1, these queries fall back to disk (also known as “spilling” to disk).
Alfonso Subiotto Marques
June 30, 2020
applications
How distributed SQL databases solve scale in the healthcare industry
Healthcare industry companies count on their database solutions to protect sensitive data and to deliver consistent performance. They also need the database to streamline communication between a complicated backend full of disparate systems. For most of the last 30 years this meant relying on Oracle because Oracle delivers the consistency required in an industry where lives are at stake and data must always be correct. The rise of cloud-native, distributed SQL database technology that offers a high level of consistency and horizontal scale is giving the healthcare industry a more flexible option.
Dan Kelly
June 29, 2020
Engineering
When and why to use SELECT FOR UPDATE in CockroachDB
We didn’t implement SELECT FOR UPDATE to ensure consistency. Unlike Amazon Aurora, CockroachDB already guarantees serializable isolation, the highest isolation level provided by the ANSI SQL standard. Contention happens. And application developers shouldn’t need to risk the integrity of their data when transactions contend. To combat this, CockroachDB must occasionally return errors prompting applications to retry transactions that would risk anomalies, such as write skews. This means that just like with PostgreSQL in serializable isolation, developers need to implement retry-loops for contended transactions. For developers accustomed to relational databases with lower isolation levels, this can be an unfamiliar pattern.
John Kendall
June 22, 2020
Product
Build an app with Active Record + CockroachDB
To make CockroachDB as accessible as possible, we’ve worked hard over the past six months to add compatibility with various Object Relational Mapping tools (ORMs). We started with ORMs for Python, Java, and Go. Now, we’re excited to announce full CockroachDB compatibility with Active Record, our first ORM for Ruby developers.
Meagan Goldman
June 17, 2020
Engineering
Nested transactions in CockroachDB 20.1
CockroachDB 20.1 introduces support for nested transactions, a SQL feature which simplifies the work of programmers of certain client applications. In this post, we'll explore when and where to use nested transactions, when not to use them, and how they work in a distributed environment.
Raphael Kena Poss
June 15, 2020
Product
How to get zero-downtime scaling from single-region to multi-region applications
CockroachDB offers a number of features aimed at making it easy to support your application in multiple regions. In CockroachDB 20.1, we introduced a new feature Online Primary Key Changes that allows you to upgrade your application from a single-region to multi-region with zero downtime. We wrote a bit recently about the technical challenges involved in building online primary key changes and in this blog post, we'll walk through some of the use cases and benefits the feature can lead to.
Andy Woods
June 11, 2020