Nope, we’re not talking chemicals here 🙂
MongoDB recently made a giant announcement that ACID will be supported in multi-document transactions with the release of 4.0. But what’s ACID anyway?
What is ACID?
In the database world, ACID stands for Atomicity, Consistency, Isolation, and Durability. This set of properties has been the defining feature of relational databases which, in a nutshell, ensures that all transactions are accurate, up-to-date, and reliable.
Let’s break these ACID properties down.
A – Atomicity means that a database transaction is fully completed or not at all. No transaction can be left partially completed.
C – Consistency means that a database remains consistent before, during, and after all database transactions, as they happen.
I – Isolation means when multiple database transactions are executed simultaneously, they are unaware of each other so they are processed sequentially. One transaction can’t read data from another that hasn’t been completed.
D – Durability means that once database transactions are committed, results are recorded to a durable medium (e.g. hard disk) and cannot be lost.
It has been a challenge for non-relational databases to comply with ACID properties. Speed is a clear core competency – gaining the NoSQL movement legions of fans among Agile and DevOps circles – which they’ve only pulled off because they don’t strictly adhere to ACID constraints. Why ensure all changes are made across multiple documents when some transactions can afford a little wait?
Technically speaking, MongoDB has always been ACID compliant – but only on a single-document level. So far this has been enough to address the data integrity needs of most applications, but this is no longer the case as MongoDB progresses to fill an enterprise-friendly, e-commerce-heavy role. MongoDB had long anticipated the need for multi-document ACID transactions, starting with their acquisition of WiredTiger in 2014. Fast forward five years, the best of both database worlds might finally be at our fingertips: NoSQL performance with transactional integrity.
MongoDB and ACID
MongoDB 4.0 is scheduled for a summer release this year and it will support multi-document ACID transactions across a single replica set. We’ll see this feature extended to sharded clusters in MongoDB 4.2, which doesn’t have a release date yet.
Sign up for the MongoDB 4.0 beta here: https://www.mongodb.com/transactions