Course contentsShow
← Software Engineering
Lesson 903 of 1,93328. Transactions and ConsistencyFree lesson

ACID in Different Database Systems

How relational and non-relational databases implement or relax ACID properties differently.

ACID in Different Database Systems

You'll learn: How relational and non-relational databases implement or relax ACID properties in different ways.

Not all databases treat ACID the same way. While traditional relational databases like PostgreSQL and MySQL are built around strict ACID guarantees, non-relational databases often make different trade-offs to achieve scale, speed, or availability.

Relational Databases: Full ACID by Default

Systems like PostgreSQL, MySQL (InnoDB), and Oracle enforce all four ACID properties by default. They use techniques like write-ahead logging, locking mechanisms, and two-phase commit to guarantee atomicity, consistency, isolation, and durability. These databases prioritize correctness over raw performance, making them ideal for financial systems, inventory management, and anywhere data integrity is paramount.

NoSQL Databases: Selective ACID Support

Many NoSQL databases relax ACID guarantees to improve performance and scalability:

  • MongoDB offers ACID transactions within a single document by default, but multi-document transactions (added later) come with performance costs
  • Cassandra prioritizes availability and partition tolerance, offering eventual consistency and tunable consistency levels rather than strict ACID
  • DynamoDB provides ACID transactions, but they're opt-in and more expensive than standard operations
  • Redis supports atomic operations on single keys but lacks full transactional guarantees across multiple keys without special commands

The Trade-off Spectrum

Think of ACID as a dial, not a switch. Relational databases turn it to maximum by default. NoSQL databases let you adjust it based on your needs—sometimes you need strict guarantees, other times you prefer speed and can tolerate eventual consistency.

Key Takeaway: Relational databases enforce full ACID by default for correctness, while NoSQL systems often relax these guarantees strategically to gain performance, scalability, or availability—choose based on your application's tolerance for inconsistency.