<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Distributed-Systems on Java &amp; Software Architecture Knowledge Hub</title><link>https://samirsahoo.github.io/design-patterns-hub/tags/distributed-systems/</link><description>Recent content in Distributed-Systems on Java &amp; Software Architecture Knowledge Hub</description><generator>Hugo</generator><language>en-US</language><copyright>© 2026 Samir Kumar Sahoo (https://github.com/samirsahoo). All rights reserved.</copyright><atom:link href="https://samirsahoo.github.io/design-patterns-hub/tags/distributed-systems/index.xml" rel="self" type="application/rss+xml"/><item><title>Introduction to System Design</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;System design&lt;/strong&gt; is the process of turning a set of requirements into an architecture — components, data, interfaces and their interactions — that meets those requirements at the expected scale, and that you can explain and defend.&lt;/p&gt;</description></item><item><title>Consistent Hashing</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/consistent-hashing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/consistent-hashing/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;Consistent hashing&lt;/strong&gt; is a way to assign keys to servers so that when a server is &lt;strong&gt;added or removed, only a small fraction of keys move&lt;/strong&gt; — about &lt;em&gt;K / N&lt;/em&gt; of &lt;em&gt;K&lt;/em&gt; keys for &lt;em&gt;N&lt;/em&gt; servers — instead of nearly all of them. It is the standard technique for distributing data across distributed caches and leaderless databases.&lt;/p&gt;</description></item><item><title>CAP Theorem and PACELC</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/cap-theorem-and-pacelc/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/cap-theorem-and-pacelc/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;The &lt;strong&gt;CAP theorem&lt;/strong&gt; (Eric Brewer, 2000; proved by Gilbert and Lynch, 2002) concerns a distributed data store with replicas. It names three properties:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Consistency (C):&lt;/strong&gt; every read receives the most recent write or an error. Here this means &lt;strong&gt;linearizability&lt;/strong&gt;, not the C of ACID.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Availability (A):&lt;/strong&gt; every request to a non-failed node receives a non-error response (without a guarantee that it is the latest write).&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Partition tolerance (P):&lt;/strong&gt; the system keeps operating even when the network drops or delays messages between nodes.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The theorem says: &lt;strong&gt;when a network partition happens, a system must choose between consistency and availability.&lt;/strong&gt; It cannot provide both.&lt;/p&gt;</description></item><item><title>Replication: Leaders, Followers, Lag and Quorums</title><link>https://samirsahoo.github.io/design-patterns-hub/data-systems/replication/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/data-systems/replication/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;Replication&lt;/strong&gt; keeps a copy of the same data on several machines connected by a network. Reasons to do it:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;High availability:&lt;/strong&gt; keep working when a machine or a whole data centre fails.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Read scalability:&lt;/strong&gt; serve more reads from more copies.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Latency:&lt;/strong&gt; keep data geographically close to users.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;If data never changed, replication would be trivial: copy it once. All the difficulty comes from &lt;strong&gt;handling changes&lt;/strong&gt;. There are three main approaches: &lt;strong&gt;single-leader&lt;/strong&gt;, &lt;strong&gt;multi-leader&lt;/strong&gt; and &lt;strong&gt;leaderless&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Partitioning (Sharding): Keys, Hashes, Indexes and Rebalancing</title><link>https://samirsahoo.github.io/design-patterns-hub/data-systems/partitioning/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/data-systems/partitioning/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;Partitioning&lt;/strong&gt;, called &lt;strong&gt;sharding&lt;/strong&gt; in many databases, splits a large dataset into smaller pieces called &lt;strong&gt;partitions&lt;/strong&gt; (shards), each stored on a different node. Each record belongs to exactly one partition. The goal is &lt;strong&gt;scalability&lt;/strong&gt;: spread both the data and the query load across many machines, so the system can grow by adding nodes.&lt;/p&gt;</description></item><item><title>Unique ID Generation in Distributed Systems</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/unique-id-generation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/unique-id-generation/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Every order, message and post needs a unique ID. On one database, &lt;code&gt;AUTO_INCREMENT&lt;/code&gt; does it. Across many servers and databases, generating IDs that are unique &lt;strong&gt;without coordinating on every request&lt;/strong&gt; is a design problem in its own right — and a common interview question.&lt;/p&gt;</description></item><item><title>The Trouble with Distributed Systems: Networks, Clocks and Partial Failure</title><link>https://samirsahoo.github.io/design-patterns-hub/data-systems/distributed-systems-faults/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/data-systems/distributed-systems-faults/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;On a single computer, things either work or break completely: a bug or a hardware fault usually crashes the whole machine, and a deterministic program gives the same result each time. In a &lt;strong&gt;distributed system&lt;/strong&gt; — several computers communicating over a network — some parts can fail while others keep running. This is a &lt;strong&gt;partial failure&lt;/strong&gt;, and it is &lt;strong&gt;nondeterministic&lt;/strong&gt;: the same request may succeed, fail, or leave you not knowing which.&lt;/p&gt;</description></item><item><title>Consistency and Consensus: Linearizability, Ordering, 2PC and Raft</title><link>https://samirsahoo.github.io/design-patterns-hub/data-systems/consistency-and-consensus/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/data-systems/consistency-and-consensus/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Given that networks, clocks and nodes are unreliable (see &lt;a href="https://samirsahoo.github.io/design-patterns-hub/data-systems/distributed-systems-faults/"&gt;The Trouble with Distributed Systems&lt;/a&gt;), how do we build systems that still behave predictably? The approach is to find &lt;strong&gt;general-purpose abstractions with useful guarantees&lt;/strong&gt;, implement them once, carefully, and let applications rely on them — just as transactions hide crashes and concurrency.&lt;/p&gt;</description></item><item><title>Designing a Web Crawler</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/web-crawler/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/web-crawler/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;a class="heading-anchor" href="#overview" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;A &lt;strong&gt;web crawler&lt;/strong&gt; downloads web pages, extracts their links and downloads those in turn. Search engines, archives, price monitors and AI training pipelines all rely on crawlers. The algorithm is a breadth-first traversal; the engineering problems are &lt;strong&gt;scale&lt;/strong&gt;, &lt;strong&gt;politeness&lt;/strong&gt; (not overloading websites), &lt;strong&gt;duplicate avoidance&lt;/strong&gt; and &lt;strong&gt;robustness&lt;/strong&gt; against a hostile, messy web. ByteByteGo&amp;rsquo;s &amp;ldquo;how to avoid crawling duplicate URLs at Google scale&amp;rdquo; focuses on exactly the dedup part.&lt;/p&gt;</description></item><item><title>Designing a Distributed Key-Value Store (Dynamo-Style)</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/distributed-key-value-store/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/distributed-key-value-store/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;a class="heading-anchor" href="#overview" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Designing a key-value store is a favourite interview question because it combines nearly every idea in &lt;a href="https://samirsahoo.github.io/design-patterns-hub/data-systems/"&gt;Data-Intensive Systems&lt;/a&gt;: partitioning, replication, quorums, conflict resolution, failure detection and storage engines. The reference design is Amazon&amp;rsquo;s &lt;strong&gt;Dynamo&lt;/strong&gt; (2007), whose ideas live on in Cassandra, Riak, ScyllaDB and DynamoDB&amp;rsquo;s internals.&lt;/p&gt;</description></item></channel></rss>