-
Continue reading →: What are Monotonic Reads?First of all the problem case… The problem: anomalies can occur when reading asynchronous followers! This can happen if a user makes several reads from different replicas 😵 In effect the second query is observing an earlier point in time ❌ Although this is very confusing for user 1 2…
-
Continue reading →: Eventual Consistency vs Strong ConsistencyEventual Consistency What is it? Theoretical guarantee If no new updates to an entity are made All reads of the entity will eventually return the last updated value Example of an eventual consistency model? Internet Domain Name System (DNS)! DNS servers are cached and replicated across directories over the internet…
-
Continue reading →: What is Replication Lag?Replication lag.. why bother with replication? Reasons why we use this: Fault tolerance, from node failures Scalability of nodes based on requests Latency, placing nodes geographically closer to users How can replication lag occur with a read scaling architecture? Let walk through a common replication pattern with leader based replication:…
-
Continue reading →: What is Trigger-Based Replication?The replication process typically is implemented by the database system. No application code required. ✅ (Many cases that is what we want) Although.. in some circumstances replication can been needed to perform: Replication of a subset of data Replication to one kind of database to another Conflict resolution You may…
-
Continue reading →: What is Logical Log Replication?Logical replication consists of a process of replicating data objects and their changes. Key characteristics as followed: Based upon their replication identity (primary key) Logical replication uses the exact block addresses and byte by byte replication PostgresSQL supports both mechanisms concurrently “Logical replication sends row-by-row changes, physical replication sends disk…
-
Continue reading →: What is a Write-ahead Logging (WAL)?Key-value store store is a fundamental component, which is gaining exponential demand in a multitude of horizontally scaling environments, including: IoT environments Social networks Online retail environments Cloud services Example of features of key value storage engine: Transactions Versioning Replication Write-ahead Logging (WAL) is used in storage engines to provide…
-
Continue reading →: Replication Logs – What is Statement-Based Replication?In this blog post I will be covering one approach to implementing replication logs… statement-based replication. How does leader based replication work under the hood? 🤔 Several different replication methods are used in practice (due to the multitude of edge cases!) Leader logs every request, statement that it executes and…
-
Continue reading →: What are Version Vectors? – AlgorithmExpanding upon the previous blog post regarding Capturing the happens before relationship, the scenario that is described only uses a single replica… The question is, how does the algorithm change when there are multiple replicas but no leader? (leaderless replication) There are multiple replicas accepting writes concurrently! Instead we need…
-
Continue reading →: Understanding the “Happens-Before” Relationship in Distributed SystemsIn this post, we will delve into an algorithm that can tell whether two operations are concurrent or whether one happened before another. Scenario Let’s begin with a database with only one replica. (so we can simplify this and thereafter generalise the approach to a leaderless database with multiple replicas)…
-
Continue reading →: How to Define a Concurrent Operation?Let’s begin with understanding, on how do we decide whether two operations are concurrent or not? Consider this scenario: Client A inserts a row into a table Client B updates that new row The two writes are not concurrent… A insert happens before Bs increment Because the value incremented by…
-
Continue reading →: What to consider with Replication and Multi-Data Centre Operations?Leaderless replication is suitable for multi-data centre operations, due its ability to tolerate conflicts, such as: Concurrent writes Network interruptions Latency spikes For instance both Cassandra and Voldemort implement there multi data centre support within the normal leaderless model. And with these you can specify the configuration for each of…
-
Continue reading →: What are Sloppy Quorums and Hinted Handoffs?Why optimised quorums useful? Databases with appropriately configured quorums can tolerate the failure of individual nodes, this can allow systems to: Not rely on a need for a failover Tolerate individual slow nodes, because requests do not have to wait for all N (nodes in quorum group) to respond They…
-
Continue reading →: How to Monitor StalenessWhat is Staleness? Describing staleness in an operational and monitoring perspective, this means understanding whether your databases are returning up to date results. The how to Manage Staleness? Even if your application can tolerate stale reads, you need to: Monitor the health of your replication (if it falls behind significantly)…
-
Continue reading →: What are the Limitations of Quorum Consistency?Quorum Variables (before diving into this subject) W = Minimum write nodes R = Minimum read nodes N = Nodes in quorum group (W + R) > N If you have N replicas and you choose W and R such as (W+R) > N you will generally expect every read…
-
Continue reading →: How do Reading and Writing Quorums work?What if 1 of the 3 replicas accepted the write… How far can we push this 🤔 If we know every write guaranteed out of 2 of the replicas that means 1 replica could be stale 😵 Reads can continue returning up to date values Illustrate the Quorum Variables W…
-
Continue reading →: Leaderless Replication – Writing to a database when a node is downIf you need a refresher on leaderless replication please read my previous blog post on: What is Leaderless replication? Or read Martin Kleppman book on ‘Designing Data-Intensive Applications’. Scenario of a node going down Conceptualise a situation where you have a database with 3 replicas and 1 of the replicas…
-
Continue reading →: What is Leaderless Replication?Quickie on multi leader and single leader replication Typically a single or multi leader replication approach is adopted, this is based on the concept: Client sends write requests to one node the leader The database system takes care of copying data it writes to other replicas A leader determines the…
-
Continue reading →: The Multi-Leader Replication TopologiesWhat is a replication topology? This outlines the communication paths, where writes are propagated to one node or the other. You only have two leaders? There is only one suitable topology… Leader one must send all writes to leader two and vice versa With more that two leaders various topologies…
-
Continue reading →: What is a Conflict in Replication?The simple question on what is a conflict? Pronounced types of conflicts There are some types conflicts that are obvious. For instance, the wiki example: Two writes concurrently modify the same field and the same record Setting this to two values will no doubt become a conflict Understated types of…








