Databases Reference
In-Depth Information
Let's explore what consistency features are available to help keep data safe, and what
trade-offs are involved when using (most) NOSQL stores. 1
In the relational database world, we're all familiar with ACID transactions, which have
been the norm for some time. The ACID guarantees provide us with a safe environment
in which to operate on data:
Atomic
All operations in a transaction succeed or every operation is rolled back.
Consistent
On transaction completion, the database is structurally sound.
Isolated
Transactions do not contend with one another. Contentious access to state is mod‐
erated by the database so that transactions appear to run sequentially.
Durable
The results of applying a transaction are permanent, even in the presence of failures.
These properties mean that once a transaction completes, its data is consistent (so-
called write consistency ) and stable on disk (or disks, or indeed in multiple distinct
memory locations). This is a wonderful abstraction for the application developer, but
requires sophisticated locking, which can cause logical unavailability, and is typically
considered to be a heavyweight pattern for most use cases.
For many domains, ACID transactions are far more pessimistic than the domain ac‐
tually requires. In the NOSQL world, ACID transactions have gone out of fashion as
stores loosen the requirements for immediate consistency, data freshness, and accuracy
in order to gain other benefits, like scale and resilience. Instead of using ACID, the term
BASE has arisen as a popular way of describing the properties of a more optimistic
storage strategy.
Basic availability
The store appears to work most of the time.
Soft-state
Stores don't have to be write-consistent, nor do different replicas have to be mutually
consistent all the time.
Eventual consistency
Stores exhibit consistency at some later point (e.g., lazily at read time).
The BASE properties are considerably looser than the ACID guarantees, and there is
no direct mapping between them. A BASE store values availability (because that is a
1. The .NET-based RavenDB has bucked the trend among aggregate stores in supporting ACID transactions;
as we show elsewhere in the topic, ACID properties are still upheld by many graph databases.
Search WWH ::




Custom Search