Chapter 2. Disambiguating ACID and CAP

Fast data is transformative. The most significant uses for fast data apps have been discussed in prior chapters. Key to writing fast data apps is an understanding of two concepts central to modern data management: the ACID properties and the CAP theorem, addressed in this chapter. It’s unfortunate that in both acronyms the “C” stands for “Consistency,” but actually means completely different things. What follows is a primer on the two concepts and an explanation of the differences between the two “C"s.

What Is ACID?

The idea of transactions, their semantics and guarantees, evolved with data management itself. As computers became more powerful, they were tasked with managing more data. Eventually, multiple users would share data on a machine. This led to problems where data could be changed or overwritten out from under users in the middle of a calculation. Something needed to be done; so the academics were called in.

The rules were originally defined by Jim Gray in the 1970s, and the acronym was popularized in the 1980s. “ACID” transactions solve many problems when implemented to the letter, but have been engaged in a push-pull with performance tradeoffs ever since. Still, simply understanding these rules can educate those who seek to bend them.

A transaction is a bundling of one or more operations on database state into a single sequence. Databases that offer transactional semantics offer a clear way to start, stop, and cancel (or roll ...

Get Fast Data: Smart and at Scale now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.