Skip to content

Commit 8bb509c

Browse files
committed
(docs) Consistency Models
Signed-off-by: Progyan Bhattacharya <[email protected]>
1 parent 23b8029 commit 8bb509c

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/config/docs.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ export const docsConfig: DocsConfig = {
3434
},
3535
{
3636
title: "Consistency Models",
37-
href: "/docs/consistency",
38-
disabled: true,
37+
href: "/docs/consistency-models",
3938
},
4039
{
4140
title: "History of Web Editors",

src/content/docs/consistency-models.mdx

+13-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ Eventual Consistency is a Weak Consistency model in a system with the lack of si
3939

4040
This model is very effective when the volume of transactions is high but the turn-around time for each operation is very small making the system <strong>Highly Available</strong>. However, the value READ in between Converged State of a node is non-deterministic and often can be unsafe for usage.
4141

42+
### 🥽 Strong Eventual Consistency
43+
44+
Whereas eventual consistency is only a <strong>Liveness Guarantee</strong> (updates will be observed eventually), strong eventual consistency (SEC) adds the <strong>Safety Guarantee</strong> that any two nodes that have received the same (unordered) set of updates will be in the same state. If, furthermore, the system is monotonic, the application will never suffer rollbacks.
45+
4246
## 🧪 How it applies to Databases - ACID vs BASE
4347

44-
## 🥽 Conclusion
48+
The term <strong>ACID</strong> which is an acronym for Atomicity, Consistency, Isolation and Durability, was coined as a concept to understand Database Transactions in Traditional Databases, namely SQL Databases. <strong>BASE</strong> on the other hand used to describe Transactions in NoSQL Databases as a sequence of Basically Available, Soft State and Eventually Consistent.
49+
50+
<strong>Atomicity</strong> guarantees failure of a Transaction under Strong Consistency model in case of at least one failure within the block of the transaction. This ensures that the Database never goes into an inconsistent state for each and every situation, including power failures, errors, and crashes. This gets followed up by <strong>Isolation</strong> guarantee that executes multiple transactions in parallel to produce end state such that it appears as if they have been executed sequentially. And <strong>Durability</strong> simply means that the resultant state gets backed-up into no-volatile memory to be preserved.
51+
52+
Databases that follows ACID are widely adopted across the industry due the constraints it follows and hence produces only clean state of the application. However, due to the same constraints, the database at scale obtains limits to it's Availability and Concurrency. To overcome this burden, some of this constraints are loosen up. It introduces Soft States between WRITE updates that can converge at a given time making the system Eventually Consistent. This means at any point in time, READ requests might not be able to provide the state post latest WRITE requests, and WRITE request might well be overwritten or reformed against latest state of the Database.
53+
54+
Most of the modern decentralized databases are a mix of both qualities as they provide both Availability and Liveness Guarantees as well as Safety Guarantee. Hence they are called <strong>SALT</strong> Databases, i.e., Sequential, Agreed, Ledgered and Tamper-resistant.
55+
56+
Now that we are well versed with Consistency Models and how they are adopted inside Databases, let us take short tour on Web based Editors before we understand how <strong>Operational Transformation</strong> fits into all these.

0 commit comments

Comments
 (0)