<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>System-Design on Java &amp; Software Architecture Knowledge Hub</title><link>https://samirsahoo.github.io/design-patterns-hub/tags/system-design/</link><description>Recent content in System-Design 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/system-design/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>Designing an Order Management System</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/order-management-system/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/order-management-system/</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;This case study designs the system that takes a customer&amp;rsquo;s order in an online shop, reserves stock, takes payment and hands the order to fulfilment. It follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt; and reuses the retail domain from the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/domain-driven-design/fundamentals/"&gt;DDD articles&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Reliability, Scalability and Maintainability</title><link>https://samirsahoo.github.io/design-patterns-hub/data-systems/reliability-scalability-maintainability/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/data-systems/reliability-scalability-maintainability/</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;Applications today are usually &lt;strong&gt;data-intensive&lt;/strong&gt; rather than compute-intensive: the hard problems are the amount of data, its complexity and how fast it changes. Such applications are assembled from standard building blocks — databases, caches, search indexes, stream processors, batch jobs — and the application code that glues them together.&lt;/p&gt;</description></item><item><title>Scaling from Zero to Millions of Users</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/scaling-from-zero-to-millions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/scaling-from-zero-to-millions/</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;Large systems are not designed large on day one. They &lt;strong&gt;evolve&lt;/strong&gt;, one bottleneck at a time. This page walks through the standard sequence of steps that take a web application from a single server to millions of users. Each step removes one limit and adds some complexity — and knowing &lt;em&gt;why&lt;/em&gt; each step exists is what system design interviews test.&lt;/p&gt;</description></item><item><title>Diagram Building Blocks for System Design</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/diagram-patterns/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/diagram-patterns/</guid><description>&lt;h2 id="how-to-use-this-page"&gt;How to use this page&lt;a class="heading-anchor" href="#how-to-use-this-page" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Each building block below has:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;a &lt;strong&gt;Mermaid snippet&lt;/strong&gt; you can copy into an article (view the page source in the repository for the exact text);&lt;/li&gt;&#10;&lt;li&gt;the component&amp;rsquo;s &lt;strong&gt;responsibility&lt;/strong&gt;;&lt;/li&gt;&#10;&lt;li&gt;its typical &lt;strong&gt;failure modes&lt;/strong&gt;;&lt;/li&gt;&#10;&lt;li&gt;the main &lt;strong&gt;trade-off&lt;/strong&gt; to mention.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The notation is consistent across this handbook:&lt;/p&gt;</description></item><item><title>Load Balancing and Proxies</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/load-balancing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/load-balancing/</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;A &lt;strong&gt;load balancer (LB)&lt;/strong&gt; spreads incoming requests across a group of servers so that no single server is overloaded, and stops sending traffic to servers that are unhealthy. It improves &lt;strong&gt;scalability&lt;/strong&gt; (add servers behind it), &lt;strong&gt;availability&lt;/strong&gt; (route around failures) and &lt;strong&gt;responsiveness&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Designing a URL Shortener</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/url-shortener/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/url-shortener/</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 URL shortener turns &lt;code&gt;https://example.com/blog/2026/11/a-very-long-article-title?utm_source=newsletter&lt;/code&gt; into &lt;code&gt;https://sho.rt/3Fq9Zk&lt;/code&gt; and redirects visitors from the short URL to the original. It is a classic first system design question because it is small enough to finish, yet touches ID generation, encoding, caching, read-heavy scaling and analytics. It follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Caching Strategies: Patterns, Invalidation, Eviction and Failure Modes</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/caching-strategies/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/caching-strategies/</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;A &lt;strong&gt;cache&lt;/strong&gt; is a small, fast store holding copies of data that is expensive to fetch or compute. It works because of &lt;strong&gt;locality of reference&lt;/strong&gt;: recently requested data is likely to be requested again. Caches exist at almost every layer — hardware, operating system, browser, CDN, application, database — and they are the cheapest way to cut latency and load.&lt;/p&gt;</description></item><item><title>Designing a Rate Limiter</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/rate-limiter/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/rate-limiter/</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;rate limiter&lt;/strong&gt; caps how many requests a client may make in a time period, for example 100 requests per minute per API key. It protects services from abuse and denial-of-service, controls cost (paid third-party APIs), and keeps one noisy tenant from starving others. This case study designs a distributed rate limiter for an API platform, following the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&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>Designing a Payment System</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/payment-system/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/payment-system/</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;When a customer clicks &lt;strong&gt;Buy&lt;/strong&gt;, money must move from the buyer to the marketplace (&lt;strong&gt;pay-in&lt;/strong&gt;), and later from the marketplace to sellers (&lt;strong&gt;pay-out&lt;/strong&gt;). The payment system records every movement correctly, never charges twice, never loses money, and can prove it. Correctness matters far more than raw throughput. This design follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt; and builds on the payment designs in the ByteByteGo handbook.&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>Designing a Proximity Service (Nearby Places)</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/proximity-service/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/proximity-service/</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;proximity service&lt;/strong&gt; answers &amp;ldquo;what is near me?&amp;rdquo;: restaurants within 1 km, hotels near a landmark, drivers near a pickup point. Yelp and Google Maps rely on one. The interesting part is the &lt;strong&gt;geospatial index&lt;/strong&gt;: how to find nearby points among hundreds of millions quickly. This design follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt; and expands the ByteByteGo handbook&amp;rsquo;s Yelp and quadtree discussions.&lt;/p&gt;</description></item><item><title>Designing a Chat System (WhatsApp, Discord)</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/chat-system/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/chat-system/</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 chat system delivers messages between users in near real time, keeps history, and works when phones go offline and come back. WhatsApp and Discord are the reference points: both keep a &lt;strong&gt;persistent connection&lt;/strong&gt; per device and store messages in a &lt;strong&gt;horizontally partitioned, write-optimised store&lt;/strong&gt;. This design follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Choosing a Database: SQL, NoSQL, Indexes and Storage Types</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/choosing-a-database/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/choosing-a-database/</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;There is no best database, only the best fit for a &lt;strong&gt;workload&lt;/strong&gt;: the shape of the data, how it is queried, how much there is, how fast it changes, and which guarantees it needs. Choosing well means asking those questions first and naming the technology last.&lt;/p&gt;</description></item><item><title>Designing a News Feed (Twitter / Instagram Timeline)</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/news-feed/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/news-feed/</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 news feed shows each user the recent posts of the accounts they follow, newest or best first. It is the canonical example of &lt;strong&gt;fan-out&lt;/strong&gt;: one post must appear in the feeds of every follower, and follower counts range from zero to hundreds of millions. Kleppmann uses Twitter&amp;rsquo;s home timeline as his main example of describing load. This design follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&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>Designing a Notification Service</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/notification-service/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/notification-service/</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;Almost every product sends notifications: order confirmations, password resets, chat messages, marketing campaigns. A &lt;strong&gt;notification service&lt;/strong&gt; centralises this so product teams send an event (&amp;ldquo;order shipped to user 42&amp;rdquo;) and the service decides &lt;strong&gt;whether, where and how&lt;/strong&gt; to deliver it. ByteByteGo&amp;rsquo;s flowchart of how Slack decides to send a notification shows why &amp;ldquo;a simple feature&amp;rdquo; is not simple: a dozen checks (muted channels, do-not-disturb, active on desktop, mention type, thread settings) run before anything is sent.&lt;/p&gt;</description></item><item><title>Message Queues and Delivery Semantics</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/message-queues-and-delivery-semantics/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/message-queues-and-delivery-semantics/</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;A &lt;strong&gt;message queue&lt;/strong&gt; is a durable buffer between components: a &lt;strong&gt;producer&lt;/strong&gt; puts a message on it and continues; a &lt;strong&gt;consumer&lt;/strong&gt; takes it off and processes it later. The queue makes communication &lt;strong&gt;asynchronous&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p&gt;The handwritten notes summarise why this matters: in small systems writes are fast, but in large systems a request may take a long time, and with many clients the server cannot keep up. With a queue, the client gets an acknowledgement (a receipt) immediately, the task is processed when a worker is free, and the client can check the result later.&lt;/p&gt;</description></item><item><title>Long Polling, WebSockets and Server-Sent Events</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/real-time-communication/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/real-time-communication/</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;HTTP was designed for &lt;strong&gt;request and response&lt;/strong&gt;: the client asks, the server answers. Chat, live scores, notifications, collaborative editing and dashboards need the &lt;strong&gt;server to send data when something happens&lt;/strong&gt;. There are four ways to achieve this on the web, from the oldest to the most capable.&lt;/p&gt;</description></item><item><title>Designing a Video Streaming Platform (YouTube, Netflix)</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/video-streaming/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/video-streaming/</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 video platform has two very different halves: a &lt;strong&gt;write path&lt;/strong&gt; where creators upload large files that are processed into many formats, and a &lt;strong&gt;read path&lt;/strong&gt; where millions of viewers stream those formats with smooth playback on any network. Bandwidth, not compute, dominates cost, so most of the design is about &lt;strong&gt;getting bytes close to viewers&lt;/strong&gt;. This case study follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Deployment Strategies: Rolling, Blue-Green, Canary and Feature Flags</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/deployment-strategies/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/deployment-strategies/</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;Deploying or upgrading services is risky: most outages are caused by changes. A &lt;strong&gt;deployment strategy&lt;/strong&gt; decides how a new version replaces the old one, aiming for &lt;strong&gt;no downtime&lt;/strong&gt;, &lt;strong&gt;limited blast radius&lt;/strong&gt; if the new version is bad, and &lt;strong&gt;fast rollback&lt;/strong&gt;.&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 Search Autocomplete (Typeahead)</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/search-autocomplete/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/search-autocomplete/</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;As a user types &amp;ldquo;sys&amp;rdquo;, the search box suggests &amp;ldquo;system design&amp;rdquo;, &amp;ldquo;system of a down&amp;rdquo;, &amp;ldquo;sysadmin&amp;rdquo;. &lt;strong&gt;Search autocomplete&lt;/strong&gt; must return the top suggestions for a prefix in under 100 ms while users type several characters per second, so the serving path is pure in-memory lookup and all heavy work happens offline. Follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>HTTPS, Password Storage and API Request Signing</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/security-fundamentals/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/security-fundamentals/</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;Security is a requirement of every design, not an add-on. Three mechanisms appear in nearly every system design discussion:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;HTTPS (HTTP over TLS)&lt;/strong&gt; protects data in transit: confidentiality, integrity and server authentication.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Password hashing&lt;/strong&gt; protects credentials at rest, even if the database leaks.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Authenticated API access&lt;/strong&gt; — tokens or signed requests — proves who is calling an API and that the request was not tampered with.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="how-https-works"&gt;How HTTPS works&lt;a class="heading-anchor" href="#how-https-works" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;HTTPS is HTTP sent through a &lt;strong&gt;TLS&lt;/strong&gt; connection. TLS uses both kinds of cryptography:&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><item><title>DNS and What Happens When You Type a URL</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/dns-and-web-request-lifecycle/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/dns-and-web-request-lifecycle/</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;When you type &lt;code&gt;https://www.example.com/products&lt;/code&gt; and press Enter, the browser must: find the server&amp;rsquo;s IP address (&lt;strong&gt;DNS&lt;/strong&gt;), open a connection (&lt;strong&gt;TCP&lt;/strong&gt;), secure it (&lt;strong&gt;TLS&lt;/strong&gt;), send an &lt;strong&gt;HTTP&lt;/strong&gt; request, receive the response, and &lt;strong&gt;render&lt;/strong&gt; the page. Each step adds latency and each is a lever in system design. ByteByteGo covers this as &amp;ldquo;what happens when you type a URL into your browser?&amp;rdquo; and &amp;ldquo;how does DNS work&amp;rdquo;.&lt;/p&gt;</description></item><item><title>Designing Collaborative Editing (Google Docs)</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/collaborative-editing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/collaborative-editing/</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;In Google Docs several people type into the same document at once and see each other&amp;rsquo;s changes within a fraction of a second, and everyone ends up with the &lt;strong&gt;same text&lt;/strong&gt;. ByteByteGo&amp;rsquo;s &amp;ldquo;design Google Docs&amp;rdquo; interview question centres on the hard part: merging concurrent edits so all copies &lt;strong&gt;converge&lt;/strong&gt; while each user&amp;rsquo;s intent is preserved. Follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Probabilistic Data Structures: Bloom Filters, HyperLogLog and Count-Min Sketch</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/probabilistic-data-structures/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/probabilistic-data-structures/</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;Probabilistic data structures&lt;/strong&gt; answer questions about very large data sets using a small, fixed amount of memory, in exchange for a small, &lt;strong&gt;quantifiable error&lt;/strong&gt;. Exact answers would need memory proportional to the data; these need kilobytes or megabytes regardless of size.&lt;/p&gt;</description></item><item><title>Designing a Stock Exchange</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/stock-exchange/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/stock-exchange/</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;An exchange matches buy and sell orders for securities. Its requirements are unlike a typical web system: &lt;strong&gt;latency is measured in microseconds&lt;/strong&gt;, &lt;strong&gt;fairness&lt;/strong&gt; demands a strict, deterministic order of events, and &lt;strong&gt;correctness&lt;/strong&gt; cannot be compromised. ByteByteGo describes how a modern exchange achieves microsecond latency by keeping the &lt;strong&gt;critical path&lt;/strong&gt; short and doing everything on it in memory. Follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Designing a Ride-Sharing Service (Uber, Lyft)</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/ride-sharing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/ride-sharing/</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 ride-sharing service matches riders with nearby drivers in seconds, tracks the trip on a map, and charges at the end. It looks like the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/proximity-service/"&gt;proximity service&lt;/a&gt;, with one crucial difference: &lt;strong&gt;the points move&lt;/strong&gt;. Millions of drivers send their location every few seconds, so the geospatial index is write-heavy and must live in memory. Follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Designing a Metrics Monitoring and Alerting System</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/metrics-monitoring/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/metrics-monitoring/</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 monitoring system collects numeric measurements (CPU, request rate, error count, latency histograms) from thousands of servers, stores them as &lt;strong&gt;time series&lt;/strong&gt;, draws dashboards and &lt;strong&gt;alerts&lt;/strong&gt; humans when something is wrong. ByteByteGo covers the &amp;ldquo;metrics monitoring and alerting system&amp;rdquo; and the question &amp;ldquo;which database shall I use for metrics?&amp;rdquo;. Follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Designing a Flash Sale System</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/flash-sale/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/flash-sale/</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;flash sale&lt;/strong&gt; puts a small amount of stock (say 10,000 discounted consoles) on sale at a precise moment. Millions of users press &amp;ldquo;Buy&amp;rdquo; within seconds — traffic hundreds of times higher than normal, almost all of it doomed to fail. The system must stay up, &lt;strong&gt;never oversell&lt;/strong&gt;, and treat users fairly. ByteByteGo&amp;rsquo;s flash sale design lists the principles; this page applies them with the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Designing File Storage and Sync (Dropbox, Google Drive)</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/file-storage-sync/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/file-storage-sync/</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 file sync service keeps a folder identical across a user&amp;rsquo;s laptop, phone and the cloud, and lets users share files. The key insight is to &lt;strong&gt;separate metadata from content&lt;/strong&gt;: files are split into &lt;strong&gt;content-addressed chunks&lt;/strong&gt; stored in object storage, while a strongly consistent metadata service records which chunks make up each file version. This also covers the &amp;ldquo;file upload service&amp;rdquo; design. Follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&lt;/p&gt;</description></item></channel></rss>