The CAP-Theorem Explained in Simple Terms

The CAP-Theorem is one of those terms that are very badly and vaguely explained on the internet. I always suffered with it until I came across it while reading the book “Designing Data Intensive Applications” by Martin Kleppmann. In this post I will try to explain the idea in simple terms from the way I understood it.

Continue ReadingThe CAP-Theorem Explained in Simple Terms

What is Consensus in Distributed Systems?

Consensus is a concept in Distributed Systems that looks at ways to make a set of nodes agree on a decision.

For example, suppose we have a distributed database system that has a master node and a set of slave nodes. If the master node dies, which slave node should become the master and how to select it? This is where we need to reach consensus among these nodes pick the next master.

Continue ReadingWhat is Consensus in Distributed Systems?

What is Eventual Consistency?

Eventual Consistency is a term used when talking about distributed databases. So a distributed database is one where there are several nodes (basically computers) that are responsible for handling database requests from clients (read or write). It often has a leader-follower form, in the sense that one node is a master node and other nodes are slave nodes. The master node receives the requests from the clients and forwards them to the slaves.

Continue ReadingWhat is Eventual Consistency?

What is linearizability in distributed systems?

Linearizability is a guarantee given from distributed databases to clients such that if the DB is processing a write request (e.g increase counter x from 0 to 1), and client A and client B made read requests at the same time, then if client A gets the new value (1) [regardless whether the write request is done being processed or not] then client B must also get the same new value.

In other words, the distributed DB guarantees that if a client gets the new value, then ALL other clients will get the same value afterwards, i.e no values from stale DB replicas or caches … etc.

The DB here is in a leader-follower setup.

This concept is something I learned from the book Designing Data-Intensive Applications.

Continue ReadingWhat is linearizability in distributed systems?