Hello! Welcome back to our module on Distributed Data Storage & Systems.
In our last lesson, we explored the CAP theorem and established that in any real-world distributed system, you must tolerate network partitions (P). This forces a critical architectural trade-off: do you prioritize perfect Consistency (CP) or constant Availability (AP) during a failure?
Today, we will formalize this trade-off by examining the two dominant consistency models that have emerged from it. Your goal for this lesson is to compare the ACID and BASE consistency models and their trade-offs. Understanding these two philosophies is essential for any data architect, as they dictate how databases behave, what guarantees they provide, and where they fit into a larger system design.
Two Philosophies of Data Consistency
At a high level, the choice between the ACID and BASE models mirrors the choice between Consistency and Availability that we saw in the CAP theorem.

- ACID is a model that prioritizes correctness and reliability above all else. It's the philosophy behind traditional relational databases, which you are already familiar with.
- BASE is a model that prioritizes availability and scale, accepting that data might be temporarily inconsistent across the system. It's the philosophy behind many modern NoSQL databases.
Let's dive into what each of these acronyms actually means.
The World of Guarantees: ACID
ACID is a set of properties that guarantee database transactions are processed reliably. Since you have a background in relational databases, these concepts should be a familiar foundation. Our goal here is to formally define them in the context of distributed systems.
To get a detailed breakdown of each property, please read the following section from the "ACID vs BASE - Complete Guide".
This guide provides excellent, concise definitions for each of the ACID properties, along with simple code examples that make the concepts concrete.
Please read the section titled 'ACID Explained'. Focus on understanding the role of each of the four properties: Atomicity, Consistency, Isolation, and Durability.
To summarize, ACID provides the following guarantees:
- Atomicity: All parts of a transaction complete, or none do. Think of a bank transfer: money is debited from one account and credited to another in a single, indivisible ("atomic") operation. If any part fails, the entire transaction is rolled back.
- Consistency: A transaction brings the database from one valid state to another. It ensures that any data written to the database must be valid according to all defined rules, including constraints, cascades, and triggers.
- Isolation: Concurrent transactions result in a system state that would be obtained if transactions were executed serially. In essence, one transaction's in-progress work is hidden from other transactions until it is complete.
- Durability: Once a transaction has been committed, it will remain so, even in the event of a power loss, crash, or error. This is typically achieved by writing to a transaction log before acknowledging the commit.
These properties make application logic simpler because the database itself enforces data integrity. However, this safety comes at the cost of performance and scaling challenges, as coordinating these guarantees across multiple machines is complex and slow.
The World of Trade-offs: BASE
The BASE model takes a fundamentally different approach. It was born from the need to build systems that could scale to massive sizes and remain highly available, even if it meant sacrificing the immediate consistency that ACID provides.
Let's return to the "ACID vs BASE - Complete Guide" to understand its components.
The same guide also clearly defines the principles of the BASE model.
Now, read the section titled 'BASE Explained'. Pay close attention to how 'Eventual Consistency' connects to the concepts from our previous lesson.
The BASE philosophy can be broken down as follows:
- Basically Available: The system guarantees availability. It will always return a response to a request, even if some nodes are down. The response might be stale data or an error, but it will respond.
- Soft State: The state of the system may change over time, even without new input, as updates propagate and the system works towards consistency.
- Eventual Consistency: If no new updates are made to a given data item, all replicas of that item will eventually return the last updated value. This is the same concept we discussed in our lesson on the CAP theorem.
BASE systems are optimized for scale and availability. By relaxing the strict consistency requirements of ACID, they can handle higher throughput and are more resilient to network failures. The trade-off is that developers must now account for the possibility of stale data within their application logic.
Head-to-Head: Choosing the Right Model
As a data architect, the most important skill is knowing when to use each model. The choice depends entirely on the requirements of the specific service you are building.
The following resource provides a clear summary of the trade-offs and common use cases for each model.
ACID vs BASE - by Nikki Siapno
This article, 'ACID vs BASE' by Nikki Siapno, offers a practical perspective on how to choose between the models and, more importantly, when to mix them.
Please read the sections 'Where ACID Hurts / When Not to Use ACID' and 'Where BASE Hurts / When Not to Use BASE'. This will help you frame the decision as a series of trade-offs.
Here's a summary table based on what you've read:
| Aspect | ACID | BASE |
|---|---|---|
| Priority | Data correctness and consistency | System availability and scale |
| Consistency | Strong and immediate | Eventual |
| Availability | Can be compromised during partitions | High |
| Scaling | Typically vertical (bigger servers) | Typically horizontal (more servers) |
| Typical DBs | Relational (PostgreSQL, MySQL) | NoSQL (Cassandra, DynamoDB, Riak) |
| Use Cases | Financial transactions, inventory management, user authentication | Social media feeds, analytics, view counters, shopping carts |
Test your understanding!
You are designing the data architecture for a new e-commerce platform. Which model, ACID or BASE, would you choose for the following two components, and why?
- The payment processing service.
- The "customers who bought this also bought..." recommendation engine.
Show answer
-
Payment Processing Service: ACID
- Reason: This is a mission-critical financial transaction. You must guarantee that a customer is charged exactly once and that the order is recorded correctly. Atomicity is non-negotiable to prevent partial transactions (e.g., charging a card but not creating an order). Strong consistency is required to prevent double-charging or other race conditions. The potential for lower throughput is an acceptable trade-off for correctness.
-
Recommendation Engine: BASE
- Reason: This system's priority is availability and performance. It's better to show slightly outdated recommendations than to show an error or a slow-loading page. Eventual consistency is perfectly acceptable; if the recommendations are based on purchase data that is a few minutes or even an hour old, the user experience is not significantly impacted. This allows the system to scale horizontally to handle heavy traffic and perform complex analytics offline without impacting the main shopping experience.
The Hybrid Reality
As your answer to the exercise implies, a modern enterprise system rarely uses just one model. As an architect, you will compose solutions by using different technologies for different jobs. This is where the concept of a hybrid approach becomes powerful. An e-commerce platform will use an ACID-compliant database for its core order and payment systems, while simultaneously using multiple BASE-compliant systems for its product catalog, user reviews, and analytics.
The guiding question is always: "What hurts the business more: being unavailable or being wrong?" If the answer is "being wrong," you need ACID. If the answer is "being unavailable," BASE is likely the better choice.
Conclusion
Today, we contrasted the two foundational consistency models in data architecture, ACID and BASE, and explored their respective trade-offs.
Key Takeaways:
- ACID (Atomicity, Consistency, Isolation, Durability) prioritizes data correctness and is the foundation of traditional relational databases. It's ideal for systems where transactional integrity is paramount, like finance and inventory.
- BASE (Basically Available, Soft State, Eventual Consistency) prioritizes system availability and scalability. It's common in NoSQL databases and is suited for use cases where temporary inconsistency is acceptable, like social media and analytics.
- The choice between them is a direct trade-off between consistency and availability, echoing the CAP theorem.
- Most modern architectures are hybrid, using ACID-compliant systems for critical transactional workloads and BASE-compliant systems for high-volume, less-critical workloads.
In our upcoming lessons, we will start exploring specific database technologies that embody these principles. Our next topic will be to describe the architecture and query patterns for document databases, using MongoDB as our primary example. We will see how it provides a flexible data model while allowing you to tune its consistency levels to fit your application's needs.