<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[System Design, but Simple]]></title><description><![CDATA[System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!]]></description><link>https://www.systemdesignbutsimple.com</link><image><url>https://substackcdn.com/image/fetch/$s_!VTWY!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png</url><title>System Design, but Simple</title><link>https://www.systemdesignbutsimple.com</link></image><generator>Substack</generator><lastBuildDate>Tue, 14 Apr 2026 20:26:42 GMT</lastBuildDate><atom:link href="https://www.systemdesignbutsimple.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Stephane Moreau]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[systemdesignbutsimple@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[systemdesignbutsimple@substack.com]]></itunes:email><itunes:name><![CDATA[Stephane Moreau]]></itunes:name></itunes:owner><itunes:author><![CDATA[Stephane Moreau]]></itunes:author><googleplay:owner><![CDATA[systemdesignbutsimple@substack.com]]></googleplay:owner><googleplay:email><![CDATA[systemdesignbutsimple@substack.com]]></googleplay:email><googleplay:author><![CDATA[Stephane Moreau]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Something I couldn't stop building]]></title><description><![CDATA[If you're preparing for an interview this is for you.]]></description><link>https://www.systemdesignbutsimple.com/p/something-i-couldnt-stop-building</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/something-i-couldnt-stop-building</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Sun, 29 Mar 2026 11:31:04 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/6dbd8de7-862d-40c2-843e-0dc672b49a79_1600x900.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey, it&#8217;s <a href="https://www.linkedin.com/in/stefmoreau/">Stephane</a>,</p><p>I want to tell you about something I can&#8217;t stop thinking about.</p><p>Last year I watched a Software Engineer bomb a behavioural interview. He was smart, had 12 years of experience, and did really well in the previous rounds.</p><p>He presented a good story, too. He led a platform migration, handled stakeholder pushback, and managed to deliver on time.</p><p>Then my peer interviewer asked: &#8220;What was the measurable impact of this project?&#8221;</p><p>The candidate froze, rambled for 90 seconds, and then said something like: &#8220;We delivered it on time.&#8221;</p><p>Ultimately, he didn&#8217;t get the job... and that job paid &#163;120k.</p><p>I&#8217;ve seen this happen over and over. Experienced people who know their stuff but can&#8217;t show it during an interview. They have enough stories but they just haven&#8217;t practised saying them out loud in a way that lands to interviewers.</p><p>Coaching with a human helps, but at &#163;150-200/hour, you cover maybe 4-5 questions per session. You need 5-10 reps on each question before you actually get good at it. Do the maths.. It gets expensive fast.</p><p>So I built something.</p><p>It&#8217;s a voice AI interviewer. You pick a question, talk out loud, and it&#8217;s trained to come back at you the way a real interviewer would. &#8220;How did you measure success?&#8221; &#8220;What would you do differently?&#8221;</p><p>After each answer, it scores you and tells you where you dropped marks.</p><p>130+ questions pulled from real interviews at Google, Amazon, Meta, and Stripe, or you can create your own. It&#8217;s only &#163;25/month and you can practise anytime - even at 11pm the night before your interview if you need to.</p><p>Your first question is free. No credit card required.</p><p>&#8594; Try it here: <a href="https://www.em-tools.io/interview-prep">https://www.em-tools.io/interview-prep</a></p><p>If you&#8217;re not job hunting right now, send this to someone who is. Nobody should lose a job in this market over a question they could have practised.</p><p>Stephane</p><p>P.S. Everyone who&#8217;s tried it so far scores 3-4 out of 10 on their first go, then 7-8 by their fifth. The gap between rehearsing in your head and practising out loud is bigger than you&#8217;d think.</p>]]></content:encoded></item><item><title><![CDATA[Observability (Metrics, Logs, and Traces)]]></title><description><![CDATA[A simple guide for software engineers]]></description><link>https://www.systemdesignbutsimple.com/p/observability-metrics-logs-and-traces</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/observability-metrics-logs-and-traces</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 26 Jan 2026 12:12:18 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/5287bf4f-ffe8-4a51-8632-e552c018fc4c_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Observability is the ability to understand what&#8217;s happening inside your system by looking at its outputs. It rests on three pillars: metrics, logs, and traces. Each serves a distinct purpose, and understanding when to use each one will make you significantly more effective at debugging and monitoring production systems.</p><h2>Metrics</h2><p>Metrics are numerical measurements collected at regular intervals. CPU usage, memory consumption, request count, error rate, response time.</p><p>They answer one question: <strong>&#8220;How is the system doing right now?&#8221;</strong></p><p>Metrics are compact. A single data point is just a timestamp and a number, which means you can collect and store millions of them efficiently. This makes metrics ideal for dashboards, alerting, and trend analysis.</p><p>The &#8220;Four Golden Signals&#8221; are all metrics:</p><ul><li><p><strong>Latency</strong> - how long requests take</p></li><li><p><strong>Traffic</strong> - request volume</p></li><li><p><strong>Errors</strong> - failure rate</p></li><li><p><strong>Saturation</strong> - resource utilization</p></li></ul><p>When an alert fires, it&#8217;s almost always because a metric crossed a threshold.</p><p><strong>Limitation:</strong> Metrics tell you <em>that</em> something is wrong, not <em>what</em> is wrong. A spike in error rate doesn&#8217;t tell you which errors, which users, or which code path.</p><h2>Logs</h2><p>Logs are records of discrete events. A user logged in. A request was received. An error was thrown. A configuration changed.</p><p>They answer a different question: <strong>&#8220;What happened?&#8221;</strong></p><p>Logs contain rich detail: timestamps, user IDs, request parameters, stack traces, error messages. This detail is essential for debugging. When you need to know exactly what went wrong for a specific request, you look at logs.</p><p><strong>Limitation:</strong> Logs are verbose. A busy system generates enormous volumes of log data. Storing, indexing, and searching logs at scale is expensive. Unstructured logs make analysis harder. High log generation rates can even impact application performance.</p><p>The typical workflow: use metrics to detect a problem, then query logs to understand what happened.</p><h2>Traces</h2><p>Traces track a single request as it flows through a distributed system. When one user action triggers calls across multiple services, a trace shows the complete path.</p><p>They answer: <strong>&#8220;How did this request move through the system?&#8221;</strong></p><p>A trace is a collection of spans. Each span represents a unit of work: an HTTP request, a database query, a message processed from a queue. Spans include timing information, so you can see exactly where time was spent.</p><p>Traces are essential for debugging latency in microservices. When a request is slow, a trace shows you which service or operation is the bottleneck.</p><p><strong>Limitation:</strong> Traces require instrumentation. You need to propagate trace IDs through your code and across service boundaries. Tracing also generates significant data volume, particularly in high-throughput systems. Sampling is often necessary, which means you won&#8217;t capture every request.</p><h2>How They Work Together</h2><p>Each pillar has a role:</p><p><strong>Metrics</strong> detect problems. Your error rate spiked. Response times are climbing. Something is wrong.</p><p><strong>Logs</strong> explain problems. The database connection failed. A null pointer exception occurred. The config was invalid.</p><p><strong>Traces</strong> locate problems in distributed systems. The request was fine until it reached the payment service, which called inventory, which timed out.</p><p>In practice, you move between all three. Metrics for detection and alerting. Logs for detailed investigation. Traces for understanding request flow across services.</p><h2>In short</h2><p>Metrics are efficient and great for alerting but lack detail. Logs are detailed but expensive at scale. Traces show request flow but require instrumentation.</p><p>Use metrics to know something is wrong. Use logs to understand what went wrong. Use traces to see where it went wrong.</p><p>The three pillars complement each other. Relying on just one leaves gaps in your ability to understand and debug your systems.</p><div><hr></div><h4><strong>Like posts like this?</strong></h4><p>You may also like these:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;ad6dac44-6cd1-4b60-b897-e3ee6faa7c4d&quot;,&quot;caption&quot;:&quot;You type &#8220;google.com&#8221; into your browser, hit Enter, and boom - the page loads in milliseconds.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;What happens when you type a url in your browser?&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-17T12:12:32.033Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f722affe-d95d-4808-8bd0-256604fa2b17_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/what-happens-when-you-type-a-url&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:178412763,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:11,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;1cac5f2c-e3d7-47cd-8405-491db5e79c8a&quot;,&quot;caption&quot;:&quot;It is essential to store passwords in a way that prevents an attacker from getting them, even if the database is compromised.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to store passwords in your database&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-10T12:12:42.449Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0048edd-a511-4100-83bc-0340c0f4cf25_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-store-passwords-in-your-database&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177724900,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:26,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;e62f9451-543f-4368-b5d6-e92c3853b7d5&quot;,&quot;caption&quot;:&quot;SQL and NoSQL solve the same problem (storing data) with fundamentally different approaches:&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to choose between SQL and NoSQL&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-03T12:12:41.311Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a849abcc-eb00-4cbc-833e-e9a8d08dcc99_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-choose-between-sql-and-nosql&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177087618,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:22,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;b448ffeb-f249-48db-b6a3-a56851278609&quot;,&quot;caption&quot;:&quot;Authentication vs Authorization&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Authentication (Session Vs JWT)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-27T12:12:37.305Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/94367ece-8f06-42e5-bc60-380e57637b6c_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/authentication-session-vs-jwt&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177086976,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:18,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;22bccb87-be4a-429b-b9bd-bea86a26f179&quot;,&quot;caption&quot;:&quot;Whether you&#8217;re designing a social media platform, payment system, or real-time collaboration tool, choosing the right API architecture can make or break your system&#8217;s performance and scalability. This post breaks down the most important API types you&#8217;ll need to know in system design interviews.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Every type of API you must know&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-20T11:28:45.176Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3bdeb004-41be-4d1d-a257-4117399f0b01_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/every-type-of-api-you-must-know&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:176498772,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:25,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h4>By subscribing, you get a breakdown <strong>like this every week</strong>.</h4><p><strong>Free subscribers</strong> also get a little bonus:</p><p>&#127873; <strong>The System Design Interview Preparation Cheat Sheet</strong></p><p>If you&#8217;re into <strong>visuals</strong>, <strong>paid subscribers</strong> unlock:</p><p>&#8594; <strong>My Excalidraw system design template</strong> &#8211; so you have <strong>somewhere to start</strong><br>&#8594; <strong>My Excalidraw component library</strong> &#8211; used in <strong>the diagram of this issue</strong></p><p>No pressure though. <strong>Your support helps me keep writing</strong>, and I appreciate it <strong>more than you know</strong> &#10084;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Common Architectures: Monolithic, Distributed, and Serverless]]></title><description><![CDATA[Understanding when each approach makes sense for your system]]></description><link>https://www.systemdesignbutsimple.com/p/common-architectures-monolithic-distributed</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/common-architectures-monolithic-distributed</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 05 Jan 2026 12:12:26 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/81755217-68c6-43c5-ad3f-69ca5cbc3f57_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When designing a system, one of the first decisions you&#8217;ll face is how to structure your application. Three architectural patterns dominate modern software development, each with distinct trade-offs.</p><h3>Monolithic Architecture</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vYB2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0ee46b5-c33b-4932-a91a-0ba4e4ce8977_756x996.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vYB2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0ee46b5-c33b-4932-a91a-0ba4e4ce8977_756x996.png 424w, https://substackcdn.com/image/fetch/$s_!vYB2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0ee46b5-c33b-4932-a91a-0ba4e4ce8977_756x996.png 848w, https://substackcdn.com/image/fetch/$s_!vYB2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0ee46b5-c33b-4932-a91a-0ba4e4ce8977_756x996.png 1272w, https://substackcdn.com/image/fetch/$s_!vYB2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0ee46b5-c33b-4932-a91a-0ba4e4ce8977_756x996.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vYB2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0ee46b5-c33b-4932-a91a-0ba4e4ce8977_756x996.png" width="430" height="566.5079365079365" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e0ee46b5-c33b-4932-a91a-0ba4e4ce8977_756x996.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:996,&quot;width&quot;:756,&quot;resizeWidth&quot;:430,&quot;bytes&quot;:65080,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/182657415?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0ee46b5-c33b-4932-a91a-0ba4e4ce8977_756x996.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vYB2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0ee46b5-c33b-4932-a91a-0ba4e4ce8977_756x996.png 424w, https://substackcdn.com/image/fetch/$s_!vYB2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0ee46b5-c33b-4932-a91a-0ba4e4ce8977_756x996.png 848w, https://substackcdn.com/image/fetch/$s_!vYB2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0ee46b5-c33b-4932-a91a-0ba4e4ce8977_756x996.png 1272w, https://substackcdn.com/image/fetch/$s_!vYB2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0ee46b5-c33b-4932-a91a-0ba4e4ce8977_756x996.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A monolith packages everything into a single deployable unit. Your UI, business logic, and data access all run in the same process, communicating through function calls rather than network requests.</p><p>This works brilliantly for early-stage products, small teams, and tightly coupled domains. You can move fast, validate ideas quickly, and avoid the operational overhead of managing multiple services. The trade-off is that scaling means replicating everything, deployments become riskier as the codebase grows, and a bug anywhere can bring down the whole system.</p><p>Many successful systems start here and extract services later once domain boundaries become clearer. A modular monolith with well-structured internal boundaries makes this transition much easier.</p><h3>Distributed Architecture</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-62P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62d50e1e-7184-4a80-aad2-b44ec573775c_1090x1014.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-62P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62d50e1e-7184-4a80-aad2-b44ec573775c_1090x1014.png 424w, https://substackcdn.com/image/fetch/$s_!-62P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62d50e1e-7184-4a80-aad2-b44ec573775c_1090x1014.png 848w, https://substackcdn.com/image/fetch/$s_!-62P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62d50e1e-7184-4a80-aad2-b44ec573775c_1090x1014.png 1272w, https://substackcdn.com/image/fetch/$s_!-62P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62d50e1e-7184-4a80-aad2-b44ec573775c_1090x1014.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-62P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62d50e1e-7184-4a80-aad2-b44ec573775c_1090x1014.png" width="538" height="500.4880733944954" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/62d50e1e-7184-4a80-aad2-b44ec573775c_1090x1014.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1014,&quot;width&quot;:1090,&quot;resizeWidth&quot;:538,&quot;bytes&quot;:80397,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/182657415?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62d50e1e-7184-4a80-aad2-b44ec573775c_1090x1014.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-62P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62d50e1e-7184-4a80-aad2-b44ec573775c_1090x1014.png 424w, https://substackcdn.com/image/fetch/$s_!-62P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62d50e1e-7184-4a80-aad2-b44ec573775c_1090x1014.png 848w, https://substackcdn.com/image/fetch/$s_!-62P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62d50e1e-7184-4a80-aad2-b44ec573775c_1090x1014.png 1272w, https://substackcdn.com/image/fetch/$s_!-62P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62d50e1e-7184-4a80-aad2-b44ec573775c_1090x1014.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Distributed systems split your application into multiple independent services communicating over the network. This includes both service-oriented architecture and its modern evolution, microservices.</p><p>Each service owns a specific capability, can have its own database, and can be developed, deployed, and scaled independently. This suits large organisations with multiple teams, systems with components that have very different scaling requirements, and mature products with well-understood boundaries.</p><p>The challenges are significant though. Network communication introduces latency and partial failures. Distributed transactions require patterns like sagas or eventual consistency. Operational overhead increases dramatically, and debugging issues that span services requires sophisticated tooling.</p><h3>Serverless Architecture</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zg_5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924a1ed9-7c77-4075-8097-759fa6c2779d_1168x938.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zg_5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924a1ed9-7c77-4075-8097-759fa6c2779d_1168x938.png 424w, https://substackcdn.com/image/fetch/$s_!zg_5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924a1ed9-7c77-4075-8097-759fa6c2779d_1168x938.png 848w, https://substackcdn.com/image/fetch/$s_!zg_5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924a1ed9-7c77-4075-8097-759fa6c2779d_1168x938.png 1272w, https://substackcdn.com/image/fetch/$s_!zg_5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924a1ed9-7c77-4075-8097-759fa6c2779d_1168x938.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zg_5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924a1ed9-7c77-4075-8097-759fa6c2779d_1168x938.png" width="570" height="457.7568493150685" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/924a1ed9-7c77-4075-8097-759fa6c2779d_1168x938.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:938,&quot;width&quot;:1168,&quot;resizeWidth&quot;:570,&quot;bytes&quot;:94395,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/182657415?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924a1ed9-7c77-4075-8097-759fa6c2779d_1168x938.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zg_5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924a1ed9-7c77-4075-8097-759fa6c2779d_1168x938.png 424w, https://substackcdn.com/image/fetch/$s_!zg_5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924a1ed9-7c77-4075-8097-759fa6c2779d_1168x938.png 848w, https://substackcdn.com/image/fetch/$s_!zg_5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924a1ed9-7c77-4075-8097-759fa6c2779d_1168x938.png 1272w, https://substackcdn.com/image/fetch/$s_!zg_5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924a1ed9-7c77-4075-8097-759fa6c2779d_1168x938.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Serverless abstracts away infrastructure entirely. You deploy individual functions that run on-demand, with your cloud provider handling scaling, availability, and capacity planning.</p><p>This is great for unpredictable or spiky workloads, event-driven workflows like file processing or webhooks, and MVPs where speed matters more than optimisation. You pay per execution, meaning near-zero cost when idle.</p><p>The constraints include cold start latency, execution time limits (typically 15 minutes maximum), and potential vendor lock-in. Debugging and local development can also be more difficult.</p><p><em>A note on categorisation: Serverless is technically a form of distributed architecture, but the operational model is different enough that it&#8217;s useful to consider separately. You don&#8217;t manage the distribution - the platform does.</em></p><h2>Making the Choice</h2><p>There&#8217;s no universally correct answer. Small teams often thrive with monoliths due to reduced operational complexity. Large organisations with multiple teams benefit from distributed architectures that enable independent work. Serverless suits unpredictable workloads and teams wanting to minimise operational overhead.</p><p>Consider your team size, acceptable operational complexity, scaling requirements, and how quickly you need to reach production. The right architecture is the one that matches your current constraints while leaving room to evolve.</p><div><hr></div><h4><strong>Like posts like this?</strong></h4><p>You may also like these:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;9ebd53ed-3e79-4719-aeca-8e46b439fad7&quot;,&quot;caption&quot;:&quot;You type &#8220;google.com&#8221; into your browser, hit Enter, and boom - the page loads in milliseconds.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;What happens when you type a url in your browser?&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-17T12:12:32.033Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f722affe-d95d-4808-8bd0-256604fa2b17_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/what-happens-when-you-type-a-url&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:178412763,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:11,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;f9d8c1d4-8010-46bc-bed2-193cff0189ed&quot;,&quot;caption&quot;:&quot;It is essential to store passwords in a way that prevents an attacker from getting them, even if the database is compromised.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to store passwords in your database&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-10T12:12:42.449Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0048edd-a511-4100-83bc-0340c0f4cf25_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-store-passwords-in-your-database&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177724900,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:26,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;d74ab29d-e2f2-4603-a764-385f21d7f145&quot;,&quot;caption&quot;:&quot;SQL and NoSQL solve the same problem (storing data) with fundamentally different approaches:&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to choose between SQL and NoSQL&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-03T12:12:41.311Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a849abcc-eb00-4cbc-833e-e9a8d08dcc99_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-choose-between-sql-and-nosql&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177087618,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:22,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;da3e641d-68b3-4555-bae1-375d6540463b&quot;,&quot;caption&quot;:&quot;Authentication vs Authorization&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Authentication (Session Vs JWT)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-27T12:12:37.305Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/94367ece-8f06-42e5-bc60-380e57637b6c_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/authentication-session-vs-jwt&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177086976,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:18,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;c98286e2-ebed-405a-a5a7-7b9421e22d79&quot;,&quot;caption&quot;:&quot;Whether you&#8217;re designing a social media platform, payment system, or real-time collaboration tool, choosing the right API architecture can make or break your system&#8217;s performance and scalability. This post breaks down the most important API types you&#8217;ll need to know in system design interviews.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Every type of API you must know&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-20T11:28:45.176Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3bdeb004-41be-4d1d-a257-4117399f0b01_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/every-type-of-api-you-must-know&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:176498772,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:25,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h4>By subscribing, you get a breakdown <strong>like this every week</strong>.</h4><p><strong>Free subscribers</strong> also get a little bonus:</p><p>&#127873; <strong>The System Design Interview Preparation Cheat Sheet</strong></p><p>If you&#8217;re into <strong>visuals</strong>, <strong>paid subscribers</strong> unlock:</p><p>&#8594; <strong>My Excalidraw system design template</strong> &#8211; so you have <strong>somewhere to start</strong><br>&#8594; <strong>My Excalidraw component library</strong> &#8211; used in <strong>the diagram of this issue</strong></p><p>No pressure though. <strong>Your support helps me keep writing</strong>, and I appreciate it <strong>more than you know</strong> &#10084;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Communication Protocols]]></title><description><![CDATA[HTTP, WebSockets, SSE, gRPC, REST, and GraphQL]]></description><link>https://www.systemdesignbutsimple.com/p/communication-protocols</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/communication-protocols</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 29 Dec 2025 12:12:24 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/93121f82-aa06-4484-8bf1-9e3ba6028b4f_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The web is stateless. Every HTTP transaction is brand new - the server doesn&#8217;t remember what you just did. This is such a fundamental assumption that we take it for granted, but it shapes everything about how we build systems.</p><p>You give HTTP context through headers, cookies, and metadata. This statelessness is actually a feature: it makes HTTP simple, human-readable, and supported by every browser.</p><p>But stateless request/response isn&#8217;t always what you need.</p><h2>HTTP</h2><p>HTTP is the protocol of the internet. It&#8217;s request/response by nature - client asks, server answers, connection closes. This simplicity is why it&#8217;s everywhere.</p><p>The trade-off is overhead. Every request requires a new handshake. For most web traffic, that&#8217;s fine. For real-time applications, it becomes a bottleneck.</p><h2>WebSockets</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!x0SN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd23252d-9634-4745-bce2-4d2ee6e940e1_655x368.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!x0SN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd23252d-9634-4745-bce2-4d2ee6e940e1_655x368.webp 424w, https://substackcdn.com/image/fetch/$s_!x0SN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd23252d-9634-4745-bce2-4d2ee6e940e1_655x368.webp 848w, https://substackcdn.com/image/fetch/$s_!x0SN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd23252d-9634-4745-bce2-4d2ee6e940e1_655x368.webp 1272w, https://substackcdn.com/image/fetch/$s_!x0SN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd23252d-9634-4745-bce2-4d2ee6e940e1_655x368.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!x0SN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd23252d-9634-4745-bce2-4d2ee6e940e1_655x368.webp" width="655" height="368" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dd23252d-9634-4745-bce2-4d2ee6e940e1_655x368.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:368,&quot;width&quot;:655,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:9512,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/182650185?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd23252d-9634-4745-bce2-4d2ee6e940e1_655x368.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!x0SN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd23252d-9634-4745-bce2-4d2ee6e940e1_655x368.webp 424w, https://substackcdn.com/image/fetch/$s_!x0SN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd23252d-9634-4745-bce2-4d2ee6e940e1_655x368.webp 848w, https://substackcdn.com/image/fetch/$s_!x0SN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd23252d-9634-4745-bce2-4d2ee6e940e1_655x368.webp 1272w, https://substackcdn.com/image/fetch/$s_!x0SN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd23252d-9634-4745-bce2-4d2ee6e940e1_655x368.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>WebSockets provide bidirectional communication over a persistent connection. Once established, the connection stays open. Both client and server can send messages whenever they want, eliminating the handshake overhead on every message.</p><p>This makes WebSockets stateful - they can remember what happened previously. That&#8217;s a significant shift from HTTP&#8217;s stateless model.</p><p>Use WebSockets when you need true real-time bidirectional communication: chat applications, collaborative editing tools, multiplayer games, or any scenario where both sides need to initiate messages.</p><p>The cost is complexity. You&#8217;re maintaining persistent connections, handling reconnection logic, and managing state.</p><h2>Server-Sent Events (SSE)</h2><p>Server-Sent Events are actually older than WebSockets, yet far less commonly used. They provide one-way communication from server to client over standard HTTP.</p><p>Many &#8220;real-time&#8221; features only need server-to-client communication. News feeds, live scores, notifications, status updates - the client doesn&#8217;t need to send data back, it just needs to receive updates.</p><p>For these use cases, SSE is simpler than WebSockets. You don&#8217;t need bidirectional connections, you don&#8217;t need special libraries, and it works over standard HTTP infrastructure.</p><p>Why aren&#8217;t more people using SSE? Browser support was limited in the past. But it&#8217;s worth adding to your toolkit.</p><h2>gRPC</h2><p>gRPC is fast and uses a strict contract between services. It runs exclusively over HTTP/2 and uses Protocol Buffers for serialisation - not human-readable, but extremely efficient.</p><p>Browsers don&#8217;t support gRPC natively. You need special libraries and proxies to make it work in a browser context.</p><p>This makes gRPC ideal for service-to-service communication where you control both ends. Microservices architectures, IoT devices, low-latency internal APIs - anywhere you need speed and don&#8217;t need browser compatibility.</p><p>Generally, don&#8217;t use gRPC for frontend-to-backend communication. It&#8217;s not what it&#8217;s designed for.</p><h2>REST and GraphQL (API Styles Over HTTP)</h2><p>REST and GraphQL aren&#8217;t protocols - they&#8217;re architectural styles for building APIs on top of HTTP. Both use standard HTTP requests under the hood; they just differ in how you structure those requests and responses.</p><p>You can read more about thei differences here:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;d413d8a9-5065-47d9-a034-7cc4b5e7bd66&quot;,&quot;caption&quot;:&quot;Both REST and GraphQL let clients talk to servers over HTTP. Both return data (usually JSON). Both are widely used in production. So what&#8217;s the difference between them?&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;REST vs GraphQL&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-12-22T12:12:19.197Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6d76537a-56d5-422e-84c6-0d20a20dc846_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/rest-vs-graphql&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:181459689,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:20,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h2>Making the Decision</h2><p>When choosing a protocol, start with these questions.</p><p>Is it service-to-service communication where you control both ends? Use gRPC. The performance benefits are worth the setup complexity when browsers aren&#8217;t involved.</p><p>Does it need to be real-time? If you need bidirectional communication, WebSockets are your answer. But if you only need to push updates from server to client, try SSE first.</p><p>For frontend-to-backend APIs, the REST vs GraphQL decision comes down to data complexity. Do you have simple, uniform data needs? REST. Do you have complex data from multiple sources with varied client requirements? GraphQL.</p><div><hr></div><h4><strong>Like posts like this?</strong></h4><p>You may also like these:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;9ebd53ed-3e79-4719-aeca-8e46b439fad7&quot;,&quot;caption&quot;:&quot;You type &#8220;google.com&#8221; into your browser, hit Enter, and boom - the page loads in milliseconds.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;What happens when you type a url in your browser?&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-17T12:12:32.033Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f722affe-d95d-4808-8bd0-256604fa2b17_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/what-happens-when-you-type-a-url&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:178412763,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:11,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;f9d8c1d4-8010-46bc-bed2-193cff0189ed&quot;,&quot;caption&quot;:&quot;It is essential to store passwords in a way that prevents an attacker from getting them, even if the database is compromised.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to store passwords in your database&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-10T12:12:42.449Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0048edd-a511-4100-83bc-0340c0f4cf25_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-store-passwords-in-your-database&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177724900,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:26,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;d74ab29d-e2f2-4603-a764-385f21d7f145&quot;,&quot;caption&quot;:&quot;SQL and NoSQL solve the same problem (storing data) with fundamentally different approaches:&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to choose between SQL and NoSQL&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-03T12:12:41.311Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a849abcc-eb00-4cbc-833e-e9a8d08dcc99_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-choose-between-sql-and-nosql&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177087618,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:22,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;da3e641d-68b3-4555-bae1-375d6540463b&quot;,&quot;caption&quot;:&quot;Authentication vs Authorization&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Authentication (Session Vs JWT)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-27T12:12:37.305Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/94367ece-8f06-42e5-bc60-380e57637b6c_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/authentication-session-vs-jwt&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177086976,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:18,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;c98286e2-ebed-405a-a5a7-7b9421e22d79&quot;,&quot;caption&quot;:&quot;Whether you&#8217;re designing a social media platform, payment system, or real-time collaboration tool, choosing the right API architecture can make or break your system&#8217;s performance and scalability. This post breaks down the most important API types you&#8217;ll need to know in system design interviews.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Every type of API you must know&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-20T11:28:45.176Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3bdeb004-41be-4d1d-a257-4117399f0b01_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/every-type-of-api-you-must-know&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:176498772,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:25,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h4>By subscribing, you get a breakdown <strong>like this every week</strong>.</h4><p><strong>Free subscribers</strong> also get a little bonus:</p><p>&#127873; <strong>The System Design Interview Preparation Cheat Sheet</strong></p><p>If you&#8217;re into <strong>visuals</strong>, <strong>paid subscribers</strong> unlock:</p><p>&#8594; <strong>My Excalidraw system design template</strong> &#8211; so you have <strong>somewhere to start</strong><br>&#8594; <strong>My Excalidraw component library</strong> &#8211; used in <strong>the diagram of this issue</strong></p><p>No pressure though. <strong>Your support helps me keep writing</strong>, and I appreciate it <strong>more than you know</strong> &#10084;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[REST vs GraphQL]]></title><description><![CDATA[Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/rest-vs-graphql</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/rest-vs-graphql</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 22 Dec 2025 12:12:19 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/6d76537a-56d5-422e-84c6-0d20a20dc846_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Both REST and GraphQL let clients talk to servers over HTTP. Both return data (usually JSON). Both are widely used in production. So what&#8217;s the difference between them?</p><p>It comes down to one core trade-off: <strong>REST prioritizes simplicity and standardization. GraphQL prioritizes flexibility and efficiency.</strong></p><h2>REST: One Endpoint Per Resource</h2><p>REST (Representational State Transfer) organizes your API around resources. Each resource gets its own URL, and you use HTTP methods to interact with it.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iQVj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc314f-ff37-40e3-b08a-1ec6a4e0366e_1798x400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iQVj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc314f-ff37-40e3-b08a-1ec6a4e0366e_1798x400.png 424w, https://substackcdn.com/image/fetch/$s_!iQVj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc314f-ff37-40e3-b08a-1ec6a4e0366e_1798x400.png 848w, https://substackcdn.com/image/fetch/$s_!iQVj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc314f-ff37-40e3-b08a-1ec6a4e0366e_1798x400.png 1272w, https://substackcdn.com/image/fetch/$s_!iQVj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc314f-ff37-40e3-b08a-1ec6a4e0366e_1798x400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iQVj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc314f-ff37-40e3-b08a-1ec6a4e0366e_1798x400.png" width="1456" height="324" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/06fc314f-ff37-40e3-b08a-1ec6a4e0366e_1798x400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:324,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:102983,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/181459689?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc314f-ff37-40e3-b08a-1ec6a4e0366e_1798x400.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iQVj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc314f-ff37-40e3-b08a-1ec6a4e0366e_1798x400.png 424w, https://substackcdn.com/image/fetch/$s_!iQVj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc314f-ff37-40e3-b08a-1ec6a4e0366e_1798x400.png 848w, https://substackcdn.com/image/fetch/$s_!iQVj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc314f-ff37-40e3-b08a-1ec6a4e0366e_1798x400.png 1272w, https://substackcdn.com/image/fetch/$s_!iQVj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc314f-ff37-40e3-b08a-1ec6a4e0366e_1798x400.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>The server decides what data each endpoint returns. If you call <code>GET /users/123</code>, you get whatever fields the backend team decided to include: name, email, address, preferences, etc.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IqTF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9c2e0a-9efa-459a-b61b-17884461d809_1645x660.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IqTF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9c2e0a-9efa-459a-b61b-17884461d809_1645x660.png 424w, https://substackcdn.com/image/fetch/$s_!IqTF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9c2e0a-9efa-459a-b61b-17884461d809_1645x660.png 848w, https://substackcdn.com/image/fetch/$s_!IqTF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9c2e0a-9efa-459a-b61b-17884461d809_1645x660.png 1272w, https://substackcdn.com/image/fetch/$s_!IqTF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9c2e0a-9efa-459a-b61b-17884461d809_1645x660.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IqTF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9c2e0a-9efa-459a-b61b-17884461d809_1645x660.png" width="1456" height="584" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ee9c2e0a-9efa-459a-b61b-17884461d809_1645x660.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:584,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:69836,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/181459689?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9c2e0a-9efa-459a-b61b-17884461d809_1645x660.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IqTF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9c2e0a-9efa-459a-b61b-17884461d809_1645x660.png 424w, https://substackcdn.com/image/fetch/$s_!IqTF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9c2e0a-9efa-459a-b61b-17884461d809_1645x660.png 848w, https://substackcdn.com/image/fetch/$s_!IqTF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9c2e0a-9efa-459a-b61b-17884461d809_1645x660.png 1272w, https://substackcdn.com/image/fetch/$s_!IqTF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9c2e0a-9efa-459a-b61b-17884461d809_1645x660.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>The Problem: Over-fetching and Under-fetching</h3><p><strong>Over-fetching:</strong> You only need the user&#8217;s name, but the endpoint returns 50 fields. You&#8217;re transferring data you&#8217;ll never use.</p><p><strong>Under-fetching:</strong> You need the user AND their orders. That&#8217;s two separate API calls: <code>GET /users/123</code> then <code>GET /users/123/orders</code>. More round-trips, higher latency.</p><h2>GraphQL: One Endpoint, Client-Specified Data</h2><p>GraphQL flips the model. Instead of multiple endpoints, you have a single endpoint (typically <code>/graphql</code>). The client sends a query specifying exactly what data it needs.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!89sf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdf9745d-ab03-49d1-924f-d74c90898512_1645x1445.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!89sf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdf9745d-ab03-49d1-924f-d74c90898512_1645x1445.png 424w, https://substackcdn.com/image/fetch/$s_!89sf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdf9745d-ab03-49d1-924f-d74c90898512_1645x1445.png 848w, https://substackcdn.com/image/fetch/$s_!89sf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdf9745d-ab03-49d1-924f-d74c90898512_1645x1445.png 1272w, https://substackcdn.com/image/fetch/$s_!89sf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdf9745d-ab03-49d1-924f-d74c90898512_1645x1445.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!89sf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdf9745d-ab03-49d1-924f-d74c90898512_1645x1445.png" width="485" height="426.04052197802196" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bdf9745d-ab03-49d1-924f-d74c90898512_1645x1445.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1279,&quot;width&quot;:1456,&quot;resizeWidth&quot;:485,&quot;bytes&quot;:142905,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/181459689?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdf9745d-ab03-49d1-924f-d74c90898512_1645x1445.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!89sf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdf9745d-ab03-49d1-924f-d74c90898512_1645x1445.png 424w, https://substackcdn.com/image/fetch/$s_!89sf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdf9745d-ab03-49d1-924f-d74c90898512_1645x1445.png 848w, https://substackcdn.com/image/fetch/$s_!89sf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdf9745d-ab03-49d1-924f-d74c90898512_1645x1445.png 1272w, https://substackcdn.com/image/fetch/$s_!89sf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdf9745d-ab03-49d1-924f-d74c90898512_1645x1445.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>One request. You get exactly name and orders, nothing more.</p><h3>The Trade-off: Complexity Moves to the Server</h3><p>GraphQL requires a strongly-typed schema that defines every type and field. The server must resolve arbitrary queries, which can introduce performance challenges.</p><p>Caching also becomes harder. REST&#8217;s <code>GET /users/123</code> is easily cached at the HTTP level. GraphQL POST requests with dynamic queries aren&#8217;t.</p><h2>Key Differences</h2><p><strong>Structure:</strong> REST uses multiple endpoints (one per resource). GraphQL uses a single endpoint for everything.</p><p><strong>Data fetching:</strong> In REST, the server decides what&#8217;s returned. In GraphQL, the client specifies exact fields.</p><p><strong>Schema:</strong> REST schemas are optional (OpenAPI). GraphQL schemas are mandatory and strongly typed.</p><p><strong>Versioning:</strong> REST typically uses URL versioning (<code>/v1</code>, <code>/v2</code>). GraphQL uses schema evolution - you add or deprecate fields without breaking clients.</p><p><strong>Caching:</strong> REST has built-in HTTP caching. GraphQL requires custom caching strategies.</p><p><strong>Error handling:</strong> REST uses HTTP status codes (404, 500). GraphQL always returns 200; errors appear in the response body.</p><p><strong>Learning curve:</strong> REST is lower (uses familiar HTTP patterns). GraphQL is higher (new query syntax to learn).</p><h2>When to Use REST</h2><p><strong>Your API maps cleanly to resources.</strong> Users, orders, products - if your domain is CRUD-shaped, REST fits naturally.</p><p><strong>Caching matters.</strong> REST&#8217;s HTTP caching works out of the box. CDNs, browser caches, and reverse proxies all understand it.</p><p><strong>You&#8217;re building a public API.</strong> REST is widely understood. External developers can integrate faster without learning GraphQL.</p><p><strong>Your data model is stable.</strong> If endpoints rarely change, REST&#8217;s simplicity wins over GraphQL&#8217;s flexibility.</p><h2>When to Use GraphQL</h2><p><strong>You have multiple clients with different data needs.</strong> A mobile app needs minimal data; a web dashboard needs everything. GraphQL lets each client request exactly what it needs.</p><p><strong>You&#8217;re aggregating data from multiple sources.</strong> GraphQL can sit in front of multiple services and present a unified API.</p><p><strong>Your frontend team iterates faster than backend.</strong> Frontend devs can add fields to their queries without waiting for backend changes.</p><p><strong>Network efficiency matters.</strong> On slow mobile connections, fewer round-trips and smaller payloads make a real difference.</p><h2>The Hybrid Approach</h2><p>Many companies use both. A common pattern: REST for public APIs (wide compatibility, easy caching) and GraphQL internally (flexibility for frontend teams, data aggregation).</p><p>GraphQL can even sit on top of existing REST APIs as an aggregation layer, translating multiple endpoints into a single schema. You don&#8217;t have to choose one forever.</p><div><hr></div><h4><strong>Like posts like this?</strong></h4><p>You may also like these:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;1a0c1b3e-81fd-4bd3-a4af-d9eb0d707353&quot;,&quot;caption&quot;:&quot;You type &#8220;google.com&#8221; into your browser, hit Enter, and boom - the page loads in milliseconds.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;What happens when you type a url in your browser?&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-17T12:12:32.033Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f722affe-d95d-4808-8bd0-256604fa2b17_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/what-happens-when-you-type-a-url&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:178412763,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:11,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;86c43596-2adb-4bd4-b053-a0120909fe87&quot;,&quot;caption&quot;:&quot;It is essential to store passwords in a way that prevents an attacker from getting them, even if the database is compromised.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to store passwords in your database&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-10T12:12:42.449Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0048edd-a511-4100-83bc-0340c0f4cf25_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-store-passwords-in-your-database&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177724900,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:26,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;512d1ed9-9f15-4f8b-9bb4-64f1fd3d9ecc&quot;,&quot;caption&quot;:&quot;SQL and NoSQL solve the same problem (storing data) with fundamentally different approaches:&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to choose between SQL and NoSQL&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-03T12:12:41.311Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a849abcc-eb00-4cbc-833e-e9a8d08dcc99_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-choose-between-sql-and-nosql&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177087618,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:22,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;d91f90b1-1530-4bb6-9d3a-dbb070052aff&quot;,&quot;caption&quot;:&quot;Authentication vs Authorization&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Authentication (Session Vs JWT)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-27T12:12:37.305Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/94367ece-8f06-42e5-bc60-380e57637b6c_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/authentication-session-vs-jwt&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177086976,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:18,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;ace969c6-a172-4d43-bd1c-c2e3772c0397&quot;,&quot;caption&quot;:&quot;Whether you&#8217;re designing a social media platform, payment system, or real-time collaboration tool, choosing the right API architecture can make or break your system&#8217;s performance and scalability. This post breaks down the most important API types you&#8217;ll need to know in system design interviews.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Every type of API you must know&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-20T11:28:45.176Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3bdeb004-41be-4d1d-a257-4117399f0b01_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/every-type-of-api-you-must-know&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:176498772,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:25,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h4>By subscribing, you get a breakdown <strong>like this every week</strong>.</h4><p><strong>Free subscribers</strong> also get a little bonus:</p><p>&#127873; <strong>The System Design Interview Preparation Cheat Sheet</strong></p><p>If you&#8217;re into <strong>visuals</strong>, <strong>paid subscribers</strong> unlock:</p><p>&#8594; <strong>My Excalidraw system design template</strong> &#8211; so you have <strong>somewhere to start</strong><br>&#8594; <strong>My Excalidraw component library</strong> &#8211; used in <strong>the diagram of this issue</strong></p><p>No pressure though. <strong>Your support helps me keep writing</strong>, and I appreciate it <strong>more than you know</strong> &#10084;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[HTTP Status Codes You Must Know]]></title><description><![CDATA[Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/http-status-codes-you-must-know</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/http-status-codes-you-must-know</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 15 Dec 2025 12:12:11 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/31a7715c-62a2-4e61-8351-f600d12e8fa4_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Every API response includes a status code. Most early stage engineers only know 200, 404, and 500.</p><p>Here are the ones that can set you apart:</p><h2>2xx - Success</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OJtG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3629ab49-8a86-4c5b-b4a8-5ea266e15ed6_1645x694.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OJtG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3629ab49-8a86-4c5b-b4a8-5ea266e15ed6_1645x694.png 424w, https://substackcdn.com/image/fetch/$s_!OJtG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3629ab49-8a86-4c5b-b4a8-5ea266e15ed6_1645x694.png 848w, https://substackcdn.com/image/fetch/$s_!OJtG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3629ab49-8a86-4c5b-b4a8-5ea266e15ed6_1645x694.png 1272w, https://substackcdn.com/image/fetch/$s_!OJtG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3629ab49-8a86-4c5b-b4a8-5ea266e15ed6_1645x694.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OJtG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3629ab49-8a86-4c5b-b4a8-5ea266e15ed6_1645x694.png" width="1456" height="614" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3629ab49-8a86-4c5b-b4a8-5ea266e15ed6_1645x694.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:614,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:84470,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/181459725?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3629ab49-8a86-4c5b-b4a8-5ea266e15ed6_1645x694.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OJtG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3629ab49-8a86-4c5b-b4a8-5ea266e15ed6_1645x694.png 424w, https://substackcdn.com/image/fetch/$s_!OJtG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3629ab49-8a86-4c5b-b4a8-5ea266e15ed6_1645x694.png 848w, https://substackcdn.com/image/fetch/$s_!OJtG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3629ab49-8a86-4c5b-b4a8-5ea266e15ed6_1645x694.png 1272w, https://substackcdn.com/image/fetch/$s_!OJtG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3629ab49-8a86-4c5b-b4a8-5ea266e15ed6_1645x694.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><strong>200 OK</strong> &#8594; Request succeeded</p></li><li><p><strong>201 Created</strong> &#8594; New resource created (POST)</p></li><li><p><strong>204 No Content</strong> &#8594; Success, nothing to return (DELETE)</p></li></ul><h2>3xx - Redirection</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1OyA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07ca1082-bdbe-4576-a288-dd2cfd4ce38c_1645x430.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1OyA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07ca1082-bdbe-4576-a288-dd2cfd4ce38c_1645x430.png 424w, https://substackcdn.com/image/fetch/$s_!1OyA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07ca1082-bdbe-4576-a288-dd2cfd4ce38c_1645x430.png 848w, https://substackcdn.com/image/fetch/$s_!1OyA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07ca1082-bdbe-4576-a288-dd2cfd4ce38c_1645x430.png 1272w, https://substackcdn.com/image/fetch/$s_!1OyA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07ca1082-bdbe-4576-a288-dd2cfd4ce38c_1645x430.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1OyA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07ca1082-bdbe-4576-a288-dd2cfd4ce38c_1645x430.png" width="1456" height="381" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/07ca1082-bdbe-4576-a288-dd2cfd4ce38c_1645x430.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:381,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51208,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/181459725?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07ca1082-bdbe-4576-a288-dd2cfd4ce38c_1645x430.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1OyA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07ca1082-bdbe-4576-a288-dd2cfd4ce38c_1645x430.png 424w, https://substackcdn.com/image/fetch/$s_!1OyA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07ca1082-bdbe-4576-a288-dd2cfd4ce38c_1645x430.png 848w, https://substackcdn.com/image/fetch/$s_!1OyA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07ca1082-bdbe-4576-a288-dd2cfd4ce38c_1645x430.png 1272w, https://substackcdn.com/image/fetch/$s_!1OyA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07ca1082-bdbe-4576-a288-dd2cfd4ce38c_1645x430.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><strong>301 Moved Permanently</strong> &#8594; URL changed forever</p></li><li><p><strong>302 Found</strong> &#8594; Temporary redirect</p></li></ul><h2>4xx - Client Error</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-XKG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92ae4c6e-b43d-4e37-b765-6942681e942c_1645x676.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-XKG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92ae4c6e-b43d-4e37-b765-6942681e942c_1645x676.png 424w, https://substackcdn.com/image/fetch/$s_!-XKG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92ae4c6e-b43d-4e37-b765-6942681e942c_1645x676.png 848w, https://substackcdn.com/image/fetch/$s_!-XKG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92ae4c6e-b43d-4e37-b765-6942681e942c_1645x676.png 1272w, https://substackcdn.com/image/fetch/$s_!-XKG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92ae4c6e-b43d-4e37-b765-6942681e942c_1645x676.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-XKG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92ae4c6e-b43d-4e37-b765-6942681e942c_1645x676.png" width="1456" height="598" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/92ae4c6e-b43d-4e37-b765-6942681e942c_1645x676.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:598,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:94797,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/181459725?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92ae4c6e-b43d-4e37-b765-6942681e942c_1645x676.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-XKG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92ae4c6e-b43d-4e37-b765-6942681e942c_1645x676.png 424w, https://substackcdn.com/image/fetch/$s_!-XKG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92ae4c6e-b43d-4e37-b765-6942681e942c_1645x676.png 848w, https://substackcdn.com/image/fetch/$s_!-XKG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92ae4c6e-b43d-4e37-b765-6942681e942c_1645x676.png 1272w, https://substackcdn.com/image/fetch/$s_!-XKG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92ae4c6e-b43d-4e37-b765-6942681e942c_1645x676.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><strong>400 Bad Request</strong> &#8594; Malformed request</p></li><li><p><strong>401 Unauthorized</strong> &#8594; Not authenticated</p></li><li><p><strong>403 Forbidden</strong> &#8594; Authenticated, but not allowed</p></li><li><p><strong>404 Not Found</strong> &#8594; Resource doesn&#8217;t exist</p></li></ul><h2>5xx - Server Error</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SAl_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01172bab-0348-4c9a-8843-055c55045ec0_1645x704.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SAl_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01172bab-0348-4c9a-8843-055c55045ec0_1645x704.png 424w, https://substackcdn.com/image/fetch/$s_!SAl_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01172bab-0348-4c9a-8843-055c55045ec0_1645x704.png 848w, https://substackcdn.com/image/fetch/$s_!SAl_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01172bab-0348-4c9a-8843-055c55045ec0_1645x704.png 1272w, https://substackcdn.com/image/fetch/$s_!SAl_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01172bab-0348-4c9a-8843-055c55045ec0_1645x704.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SAl_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01172bab-0348-4c9a-8843-055c55045ec0_1645x704.png" width="1456" height="623" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/01172bab-0348-4c9a-8843-055c55045ec0_1645x704.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:623,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:97244,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/181459725?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01172bab-0348-4c9a-8843-055c55045ec0_1645x704.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SAl_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01172bab-0348-4c9a-8843-055c55045ec0_1645x704.png 424w, https://substackcdn.com/image/fetch/$s_!SAl_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01172bab-0348-4c9a-8843-055c55045ec0_1645x704.png 848w, https://substackcdn.com/image/fetch/$s_!SAl_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01172bab-0348-4c9a-8843-055c55045ec0_1645x704.png 1272w, https://substackcdn.com/image/fetch/$s_!SAl_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01172bab-0348-4c9a-8843-055c55045ec0_1645x704.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><strong>500 Internal Server Error</strong> &#8594; Something broke</p></li><li><p><strong>502 Bad Gateway</strong> &#8594; Upstream server failed</p></li><li><p><strong>503 Service Unavailable</strong> &#8594; Server overloaded</p></li><li><p><strong>504 Gateway Timeout</strong> &#8594; Upstream didn&#8217;t respond</p></li></ul><div><hr></div><h4><strong>Like posts like this?</strong></h4><p>You may also like these:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;ee4a7ef7-8fb3-4932-9337-919ac8f222b5&quot;,&quot;caption&quot;:&quot;You type &#8220;google.com&#8221; into your browser, hit Enter, and boom - the page loads in milliseconds.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;What happens when you type a url in your browser?&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-17T12:12:32.033Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f722affe-d95d-4808-8bd0-256604fa2b17_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/what-happens-when-you-type-a-url&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:178412763,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:11,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;8b7277a7-665e-41f9-8452-f45d76a3bb68&quot;,&quot;caption&quot;:&quot;It is essential to store passwords in a way that prevents an attacker from getting them, even if the database is compromised.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to store passwords in your database&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-10T12:12:42.449Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0048edd-a511-4100-83bc-0340c0f4cf25_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-store-passwords-in-your-database&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177724900,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:26,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;e035bed4-66a3-49c3-89d0-78b4a6f6f26e&quot;,&quot;caption&quot;:&quot;SQL and NoSQL solve the same problem (storing data) with fundamentally different approaches:&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to choose between SQL and NoSQL&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-03T12:12:41.311Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a849abcc-eb00-4cbc-833e-e9a8d08dcc99_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-choose-between-sql-and-nosql&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177087618,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:22,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;47516577-d03a-4839-8866-3b88cba2ccc9&quot;,&quot;caption&quot;:&quot;Authentication vs Authorization&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Authentication (Session Vs JWT)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-27T12:12:37.305Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/94367ece-8f06-42e5-bc60-380e57637b6c_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/authentication-session-vs-jwt&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177086976,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:18,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;4b5280ad-2f4e-47e0-831a-20cdc5aaba96&quot;,&quot;caption&quot;:&quot;Whether you&#8217;re designing a social media platform, payment system, or real-time collaboration tool, choosing the right API architecture can make or break your system&#8217;s performance and scalability. This post breaks down the most important API types you&#8217;ll need to know in system design interviews.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Every type of API you must know&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-20T11:28:45.176Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3bdeb004-41be-4d1d-a257-4117399f0b01_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/every-type-of-api-you-must-know&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:176498772,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:25,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h4>By subscribing, you get a breakdown <strong>like this every week</strong>.</h4><p><strong>Free subscribers</strong> also get a little bonus:</p><p>&#127873; <strong>The System Design Interview Preparation Cheat Sheet</strong></p><p>If you&#8217;re into <strong>visuals</strong>, <strong>paid subscribers</strong> unlock:</p><p>&#8594; <strong>My Excalidraw system design template</strong> &#8211; so you have <strong>somewhere to start</strong><br>&#8594; <strong>My Excalidraw component library</strong> &#8211; used in <strong>the diagram of this issue</strong></p><p>No pressure though. <strong>Your support helps me keep writing</strong>, and I appreciate it <strong>more than you know</strong> &#10084;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Types of API Testing]]></title><description><![CDATA[Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/types-of-api-testing</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/types-of-api-testing</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 08 Dec 2025 12:12:46 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/50d2143a-4a53-4001-b9cf-735cedf229be_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>APIs need testing. But not all testing is the same. Each type catches different problems at different stages.</p><p>Here are the nine types you should know.</p><h2>1. Smoke Testing</h2><p>The first check after deployment. Does the API even work?</p><p>You&#8217;re testing basic connectivity, key endpoints returning 200, and authentication not failing immediately. A simple <code>GET /health</code> request is usually enough.</p><h2>2. Functional Testing</h2><p>Does the API do what it&#8217;s supposed to do?</p><p>You&#8217;re validating inputs and outputs against requirements. Send a <code>POST /users</code> with valid data - did it create a user? Is the response structure correct? Do all CRUD operations behave as documented?</p><h2>3. Integration Testing</h2><p>Does the API work with everything it connects to?</p><p>APIs don&#8217;t exist in isolation. They talk to databases, other services, message queues. Integration testing verifies data flows correctly across these boundaries.</p><p>Create a user via API, then check if the downstream service received it.</p><h2>4. Regression Testing</h2><p>Did the new changes break old functionality?</p><p>Every time you deploy, you risk breaking something that worked before. Regression testing runs your existing test suite to catch unintended side effects.</p><p>Automate this in CI/CD.</p><h2>5. Load Testing</h2><p>How does the API perform under expected traffic?</p><p>You&#8217;re measuring response times, throughput, and resource usage when many users hit the API simultaneously. Simulate 500 concurrent users and watch what happens to latency.</p><h2>6. Stress Testing</h2><p>What happens when traffic exceeds expectations?</p><p>Load testing checks normal conditions. Stress testing pushes past the limit. You want to know the breaking point and whether the API fails gracefully or crashes entirely.</p><h2>7. Security Testing</h2><p>Is the API protected from attacks?</p><p>Check authentication and authorization. Try accessing admin resources with user tokens. Test for SQL injection, XSS, and CSRF. Verify rate limiting works.</p><h2>8. UI Testing (API-Driven)</h2><p>Does the frontend display API data correctly?</p><p>The API might return perfect data, but if the UI mishandles it, users see bugs. This tests the contract between backend responses and frontend rendering.</p><h2>9. Fuzz Testing</h2><p>How does the API handle garbage input?</p><p>Send malformed JSON, random strings, oversized payloads, unexpected data types. You&#8217;re looking for unhandled exceptions and system crashes that attackers could exploit.</p><div><hr></div><h4><strong>Like posts like this?</strong></h4><p>You may also like these:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;ab88602a-527d-4c80-85f3-4bc508c694c9&quot;,&quot;caption&quot;:&quot;You type &#8220;google.com&#8221; into your browser, hit Enter, and boom - the page loads in milliseconds.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;What happens when you type a url in your browser?&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-17T12:12:32.033Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f722affe-d95d-4808-8bd0-256604fa2b17_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/what-happens-when-you-type-a-url&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:178412763,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:11,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;4ebffb5c-ce62-4192-83e2-97348145ee6d&quot;,&quot;caption&quot;:&quot;It is essential to store passwords in a way that prevents an attacker from getting them, even if the database is compromised.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to store passwords in your database&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-10T12:12:42.449Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0048edd-a511-4100-83bc-0340c0f4cf25_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-store-passwords-in-your-database&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177724900,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:26,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;675b9c6e-4dc2-4dbd-9f83-51b0a726558f&quot;,&quot;caption&quot;:&quot;SQL and NoSQL solve the same problem (storing data) with fundamentally different approaches:&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to choose between SQL and NoSQL&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-03T12:12:41.311Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a849abcc-eb00-4cbc-833e-e9a8d08dcc99_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-choose-between-sql-and-nosql&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177087618,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:22,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;2f893e77-8923-4b21-8e15-e5b8ebb01168&quot;,&quot;caption&quot;:&quot;Authentication vs Authorization&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Authentication (Session Vs JWT)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-27T12:12:37.305Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/94367ece-8f06-42e5-bc60-380e57637b6c_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/authentication-session-vs-jwt&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177086976,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:18,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;5afafac0-a671-413e-bf35-11a445b7b03e&quot;,&quot;caption&quot;:&quot;Whether you&#8217;re designing a social media platform, payment system, or real-time collaboration tool, choosing the right API architecture can make or break your system&#8217;s performance and scalability. This post breaks down the most important API types you&#8217;ll need to know in system design interviews.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Every type of API you must know&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-20T11:28:45.176Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3bdeb004-41be-4d1d-a257-4117399f0b01_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/every-type-of-api-you-must-know&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:176498772,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:25,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h4>By subscribing, you get a breakdown <strong>like this every week</strong>.</h4><p><strong>Free subscribers</strong> also get a little bonus:</p><p>&#127873; <strong>The System Design Interview Preparation Cheat Sheet</strong></p><p>If you&#8217;re into <strong>visuals</strong>, <strong>paid subscribers</strong> unlock:</p><p>&#8594; <strong>My Excalidraw system design template</strong> &#8211; so you have <strong>somewhere to start</strong><br>&#8594; <strong>My Excalidraw component library</strong> &#8211; used in <strong>the diagram of this issue</strong></p><p>No pressure though. <strong>Your support helps me keep writing</strong>, and I appreciate it <strong>more than you know</strong> &#10084;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[The Only 5 Diagramming Tools You Need for System Design]]></title><description><![CDATA[The tools I actually use (and recommend to my mentees)]]></description><link>https://www.systemdesignbutsimple.com/p/the-best-tools-for-creating-system-diagrams</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/the-best-tools-for-creating-system-diagrams</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 01 Dec 2025 12:12:30 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/a6fc8cc4-5b56-45b8-a518-8120a9d2a346_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When you&#8217;re preparing for system design interviews or documenting architecture at work, having the right diagramming tool makes a difference.</p><p>Here are my top picks for creating clear, professional system design diagrams.</p><h2>1. <a href="https://excalidraw.com/">Excalidraw</a></h2><p>This is my go-to tool for system design work, and it&#8217;s what I recommend to everyone I coach.</p><p>Excalidraw gives you a hand-drawn aesthetic that feels approachable. It&#8217;s free, runs in your browser, and has virtually no learning curve. You can start sketching architecture in seconds.</p><p>What makes it perfect for system design practice is the flexibility. You&#8217;re not locked into rigid shapes or connectors. You can quickly iterate on designs, which is exactly what you need when you&#8217;re working through a problem in an interview setting.</p><p><strong>For paid subscribers:</strong> I&#8217;ve created two resources to accelerate your practice:</p><ul><li><p><strong>My Excalidraw System Design Template</strong> &#8211; copy it and adjust when you practice, so you&#8217;re not starting from scratch every time</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tYk2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39401866-aa84-48b1-8e6a-a3dbbde59a70_1970x812.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tYk2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39401866-aa84-48b1-8e6a-a3dbbde59a70_1970x812.png 424w, https://substackcdn.com/image/fetch/$s_!tYk2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39401866-aa84-48b1-8e6a-a3dbbde59a70_1970x812.png 848w, https://substackcdn.com/image/fetch/$s_!tYk2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39401866-aa84-48b1-8e6a-a3dbbde59a70_1970x812.png 1272w, https://substackcdn.com/image/fetch/$s_!tYk2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39401866-aa84-48b1-8e6a-a3dbbde59a70_1970x812.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tYk2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39401866-aa84-48b1-8e6a-a3dbbde59a70_1970x812.png" width="478" height="196.97802197802199" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/39401866-aa84-48b1-8e6a-a3dbbde59a70_1970x812.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1456,&quot;resizeWidth&quot;:478,&quot;bytes&quot;:486243,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/undefined?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39401866-aa84-48b1-8e6a-a3dbbde59a70_1970x812.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!tYk2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39401866-aa84-48b1-8e6a-a3dbbde59a70_1970x812.png 424w, https://substackcdn.com/image/fetch/$s_!tYk2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39401866-aa84-48b1-8e6a-a3dbbde59a70_1970x812.png 848w, https://substackcdn.com/image/fetch/$s_!tYk2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39401866-aa84-48b1-8e6a-a3dbbde59a70_1970x812.png 1272w, https://substackcdn.com/image/fetch/$s_!tYk2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39401866-aa84-48b1-8e6a-a3dbbde59a70_1970x812.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div></li><li><p><strong>My System Design Component Library</strong> &#8211; essential Excalidraw components for databases, load balancers, caches, queues, and more</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sMcM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa85e47e8-40c8-4ec9-849c-f47c13b536c8_2329x1427.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sMcM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa85e47e8-40c8-4ec9-849c-f47c13b536c8_2329x1427.png 424w, https://substackcdn.com/image/fetch/$s_!sMcM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa85e47e8-40c8-4ec9-849c-f47c13b536c8_2329x1427.png 848w, https://substackcdn.com/image/fetch/$s_!sMcM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa85e47e8-40c8-4ec9-849c-f47c13b536c8_2329x1427.png 1272w, https://substackcdn.com/image/fetch/$s_!sMcM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa85e47e8-40c8-4ec9-849c-f47c13b536c8_2329x1427.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sMcM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa85e47e8-40c8-4ec9-849c-f47c13b536c8_2329x1427.png" width="472" height="289.16483516483515" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a85e47e8-40c8-4ec9-849c-f47c13b536c8_2329x1427.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:892,&quot;width&quot;:1456,&quot;resizeWidth&quot;:472,&quot;bytes&quot;:272997,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/undefined?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa85e47e8-40c8-4ec9-849c-f47c13b536c8_2329x1427.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!sMcM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa85e47e8-40c8-4ec9-849c-f47c13b536c8_2329x1427.png 424w, https://substackcdn.com/image/fetch/$s_!sMcM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa85e47e8-40c8-4ec9-849c-f47c13b536c8_2329x1427.png 848w, https://substackcdn.com/image/fetch/$s_!sMcM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa85e47e8-40c8-4ec9-849c-f47c13b536c8_2329x1427.png 1272w, https://substackcdn.com/image/fetch/$s_!sMcM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa85e47e8-40c8-4ec9-849c-f47c13b536c8_2329x1427.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Subscribe to get them!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>2. <a href="https://www.drawio.com/">Draw.io</a></h2><p>The Swiss Army knife of diagramming tools. It&#8217;s free, feature-rich, and integrates with Google Drive, Dropbox, GitHub, and Confluence.</p><p>The template library is massive, covering flowcharts, network diagrams, process maps, and more. Best for polished, professional diagrams you need to share with stakeholders or embed in documentation.</p><h2>3. <a href="https://www.lucidchart.com/pages">Lucidchart</a></h2><p>The enterprise standard. If your company already uses it, lean into the template library and real-time collaboration features.</p><p>Works well for team environments where multiple people need to contribute simultaneously, with live updates and commenting built in.</p><h2>4. <a href="https://www.eraser.io/diagramgpt">DiagramGPT</a></h2><p>Describe what you want in plain text, and it generates the diagram. Useful for quick iterations or when you&#8217;re exploring ideas and don&#8217;t want to manually place boxes yet.</p><p>You can tweak the output afterward, adjusting layout and colors to fit your needs.</p><h2>5. <a href="https://diagrammingai.com/">Diagramming AI</a></h2><p>Smart generation from simple descriptions and an interactive chat interface. You can make modifications using natural language commands and get suggestions as you build.</p><p>Integrates with other tools to streamline your workflow.</p><div><hr></div><h4><strong>Want to learn more about System Design?</strong></h4><p>You may also like these:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;2bdf81f6-1a45-4f88-a8f0-763f5a53a4fa&quot;,&quot;caption&quot;:&quot;You type &#8220;google.com&#8221; into your browser, hit Enter, and boom - the page loads in milliseconds.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;What happens when you type a url in your browser?&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-17T12:12:32.033Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f722affe-d95d-4808-8bd0-256604fa2b17_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/what-happens-when-you-type-a-url&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:178412763,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:11,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;3bae1450-95d5-4ed2-b38f-0fce3b725dcc&quot;,&quot;caption&quot;:&quot;It is essential to store passwords in a way that prevents an attacker from getting them, even if the database is compromised.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to store passwords in your database&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-10T12:12:42.449Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0048edd-a511-4100-83bc-0340c0f4cf25_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-store-passwords-in-your-database&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177724900,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:26,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;0ea198ed-ecba-4530-baa9-fb17c68219ee&quot;,&quot;caption&quot;:&quot;SQL and NoSQL solve the same problem (storing data) with fundamentally different approaches:&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to choose between SQL and NoSQL&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-03T12:12:41.311Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a849abcc-eb00-4cbc-833e-e9a8d08dcc99_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-choose-between-sql-and-nosql&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177087618,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:22,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;23a2c2c3-fde3-41ae-8a5f-c34aa2680537&quot;,&quot;caption&quot;:&quot;Authentication vs Authorization&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Authentication (Session Vs JWT)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-27T12:12:37.305Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/94367ece-8f06-42e5-bc60-380e57637b6c_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/authentication-session-vs-jwt&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177086976,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:18,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;0f957aa0-9f4c-499a-aa9e-b0e7a6ae3988&quot;,&quot;caption&quot;:&quot;Whether you&#8217;re designing a social media platform, payment system, or real-time collaboration tool, choosing the right API architecture can make or break your system&#8217;s performance and scalability. This post breaks down the most important API types you&#8217;ll need to know in system design interviews.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Every type of API you must know&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-20T11:28:45.176Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3bdeb004-41be-4d1d-a257-4117399f0b01_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/every-type-of-api-you-must-know&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:176498772,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:25,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h4>By subscribing, you get a breakdown <strong>like this every week</strong>.</h4><p><strong>Free subscribers</strong> also get a little bonus:</p><p>&#127873; <strong>The System Design Interview Preparation Cheat Sheet</strong></p><p>If you&#8217;re into <strong>visuals</strong>, <strong>paid subscribers</strong> unlock:</p><p>&#8594; <a href="https://www.systemdesignbutsimple.com/t/interview-walkthroughs">System Design Walkthroughs of Popular Interview Questions</a><br>&#8594; <strong>My Excalidraw system design template</strong> &#8211; so you have <strong>somewhere to start</strong><br>&#8594; <strong>My Excalidraw component library</strong> &#8211; used in <strong>the diagram of this issue</strong></p><p>No pressure though. <strong>Your support helps me keep writing</strong>, and I appreciate it <strong>more than you know</strong> &#10084;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Read-Through vs Write-Through Cache]]></title><description><![CDATA[Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/read-through-vs-write-through-cache</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/read-through-vs-write-through-cache</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 24 Nov 2025 12:12:27 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/f8825023-565d-4d5b-86c3-5feb094f89b2_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You&#8217;ve probably heard &#8220;just add a cache&#8221; thrown around as the solution to every performance problem.</p><p>But caching strategies matter. Pick the wrong one and you&#8217;ll spend weekends debugging stale data issues or wondering why your writes are suddenly slow.</p><p>There are two fundamental patterns you should be aware of: Read-Through and Write-Through caching.</p><h2>Read-Through Cache</h2><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VID-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F392a77f3-5898-4579-a827-c1b2b64e4cd3_3407x377.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VID-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F392a77f3-5898-4579-a827-c1b2b64e4cd3_3407x377.png 424w, https://substackcdn.com/image/fetch/$s_!VID-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F392a77f3-5898-4579-a827-c1b2b64e4cd3_3407x377.png 848w, https://substackcdn.com/image/fetch/$s_!VID-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F392a77f3-5898-4579-a827-c1b2b64e4cd3_3407x377.png 1272w, https://substackcdn.com/image/fetch/$s_!VID-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F392a77f3-5898-4579-a827-c1b2b64e4cd3_3407x377.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VID-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F392a77f3-5898-4579-a827-c1b2b64e4cd3_3407x377.png" width="1456" height="161" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/392a77f3-5898-4579-a827-c1b2b64e4cd3_3407x377.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:161,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:118511,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/179602867?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F392a77f3-5898-4579-a827-c1b2b64e4cd3_3407x377.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VID-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F392a77f3-5898-4579-a827-c1b2b64e4cd3_3407x377.png 424w, https://substackcdn.com/image/fetch/$s_!VID-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F392a77f3-5898-4579-a827-c1b2b64e4cd3_3407x377.png 848w, https://substackcdn.com/image/fetch/$s_!VID-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F392a77f3-5898-4579-a827-c1b2b64e4cd3_3407x377.png 1272w, https://substackcdn.com/image/fetch/$s_!VID-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F392a77f3-5898-4579-a827-c1b2b64e4cd3_3407x377.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>In a Read-Through setup, your application only talks to the cache. It never queries the database directly.</p><p>When your application requests data:</p><ol><li><p>The service checks if the cache has the data</p></li><li><p>If yes (cache hit), it returns immediately</p></li><li><p>If no (cache miss), the cache fetches from the database, stores a copy, then returns it</p></li></ol><p>Your application code stays simple. It doesn&#8217;t handle cache misses - the cache layer manages that automatically.</p><p><strong>When it works well:</strong></p><ul><li><p>Read-heavy workloads (product catalogues, user profiles)</p></li><li><p>When you want simpler application code</p></li><li><p>Systems where the same data gets requested repeatedly</p></li></ul><p><strong>The tradeoff:</strong> First-time reads are slow since every cache miss means a database trip. If your cache restarts, expect a flood of requests hitting your database while the cache warms up.</p><h2>Write-Through Cache</h2><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uryd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5589a8e2-2c49-4894-9ffb-14eec1fbe277_3407x377.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uryd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5589a8e2-2c49-4894-9ffb-14eec1fbe277_3407x377.png 424w, https://substackcdn.com/image/fetch/$s_!uryd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5589a8e2-2c49-4894-9ffb-14eec1fbe277_3407x377.png 848w, https://substackcdn.com/image/fetch/$s_!uryd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5589a8e2-2c49-4894-9ffb-14eec1fbe277_3407x377.png 1272w, https://substackcdn.com/image/fetch/$s_!uryd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5589a8e2-2c49-4894-9ffb-14eec1fbe277_3407x377.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uryd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5589a8e2-2c49-4894-9ffb-14eec1fbe277_3407x377.png" width="1456" height="161" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5589a8e2-2c49-4894-9ffb-14eec1fbe277_3407x377.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:161,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:123778,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/179602867?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5589a8e2-2c49-4894-9ffb-14eec1fbe277_3407x377.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uryd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5589a8e2-2c49-4894-9ffb-14eec1fbe277_3407x377.png 424w, https://substackcdn.com/image/fetch/$s_!uryd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5589a8e2-2c49-4894-9ffb-14eec1fbe277_3407x377.png 848w, https://substackcdn.com/image/fetch/$s_!uryd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5589a8e2-2c49-4894-9ffb-14eec1fbe277_3407x377.png 1272w, https://substackcdn.com/image/fetch/$s_!uryd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5589a8e2-2c49-4894-9ffb-14eec1fbe277_3407x377.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>In a Write-Through setup, every write operation goes to both the cache and database simultaneously.</p><p>The write only succeeds when both complete. Your cache and database stay perfectly in sync.</p><p><strong>When it works well:</strong></p><ul><li><p>When data consistency is non-negotiable (financial systems, inventory)</p></li><li><p>Read-heavy systems that also need reliable writes</p></li><li><p>When stale data causes real business problems</p></li></ul><p><strong>The tradeoff:</strong> Writes are slower because every operation has two steps. You might also cache data that never gets read, wasting memory.</p><h2>How to decide between the two</h2><p>Ask yourself two questions:</p><p><strong>How painful is stale data?</strong> If outdated information causes customer complaints or financial errors, Write-Through gives you that consistency guarantee.</p><p><strong>What&#8217;s your read-to-write ratio?</strong> Read-Through excels when reads vastly outnumber writes. Write-Through makes more sense when you write frequently and read that same data soon after.</p><h2>Caveats</h2><p>You rarely use just one strategy.</p><p>Many systems combine both. Write-Through for critical data that must stay consistent (user account balances). Read-Through for less critical, read-heavy data (product recommendations).</p><p>Some teams add Write-Behind (writing to cache immediately, database asynchronously) for high-throughput scenarios where eventual consistency is acceptable.</p><p>Neither is universally better. Understanding when to use each is what separates engineers who &#8220;add caching&#8221; from engineers who design systems that actually scale.</p><div><hr></div><h4><strong>Like posts like this?</strong></h4><p>You may also like these:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;203729fe-9dd9-4724-92cf-f363d1a5ce1e&quot;,&quot;caption&quot;:&quot;You type &#8220;google.com&#8221; into your browser, hit Enter, and boom - the page loads in milliseconds.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;What happens when you type a url in your browser?&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-17T12:12:32.033Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f722affe-d95d-4808-8bd0-256604fa2b17_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/what-happens-when-you-type-a-url&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:178412763,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:11,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;eb25f8fa-3e88-4258-8584-86269572cc34&quot;,&quot;caption&quot;:&quot;It is essential to store passwords in a way that prevents an attacker from getting them, even if the database is compromised.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to store passwords in your database&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-10T12:12:42.449Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0048edd-a511-4100-83bc-0340c0f4cf25_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-store-passwords-in-your-database&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177724900,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:26,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;d86f6019-5c35-4e82-8279-538d8768a474&quot;,&quot;caption&quot;:&quot;SQL and NoSQL solve the same problem (storing data) with fundamentally different approaches:&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to choose between SQL and NoSQL&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-03T12:12:41.311Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a849abcc-eb00-4cbc-833e-e9a8d08dcc99_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-choose-between-sql-and-nosql&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177087618,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:22,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;2be351e6-7c0e-42c8-97d8-20ed917fe73a&quot;,&quot;caption&quot;:&quot;Authentication vs Authorization&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Authentication (Session Vs JWT)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-27T12:12:37.305Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/94367ece-8f06-42e5-bc60-380e57637b6c_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/authentication-session-vs-jwt&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177086976,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:18,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;ad66e122-c270-42e2-9526-4ec359cbc73d&quot;,&quot;caption&quot;:&quot;Whether you&#8217;re designing a social media platform, payment system, or real-time collaboration tool, choosing the right API architecture can make or break your system&#8217;s performance and scalability. This post breaks down the most important API types you&#8217;ll need to know in system design interviews.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Every type of API you must know&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-20T11:28:45.176Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3bdeb004-41be-4d1d-a257-4117399f0b01_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/every-type-of-api-you-must-know&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:176498772,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:25,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h4>By subscribing, you get a breakdown <strong>like this every week</strong>.</h4><p><strong>Free subscribers</strong> also get a little bonus:</p><p>&#127873; <strong>The System Design Interview Preparation Cheat Sheet</strong></p><p>If you&#8217;re into <strong>visuals</strong>, <strong>paid subscribers</strong> unlock:</p><p>&#8594; <strong>My Excalidraw system design template</strong> &#8211; so you have <strong>somewhere to start</strong><br>&#8594; <strong>My Excalidraw component library</strong> &#8211; used in <strong>the diagram of this issue</strong></p><p>No pressure though. <strong>Your support helps me keep writing</strong>, and I appreciate it <strong>more than you know</strong> &#10084;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[What happens when you type a url in your browser?]]></title><description><![CDATA[Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/what-happens-when-you-type-a-url</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/what-happens-when-you-type-a-url</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 17 Nov 2025 12:12:32 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/f722affe-d95d-4808-8bd0-256604fa2b17_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You type &#8220;google.com&#8221; into your browser, hit Enter, and boom - the page loads in milliseconds.</p><p>Behind that seamless experience is a carefully orchestrated setup of distributed systems, each performing its role with precision. Understanding this process is fundamental to system design, and it&#8217;s why this question shows up in engineering interviews.</p><p>Let&#8217;s break down exactly what happens, step by step.</p><h2>URLs</h2><p>Behind that seamless experience is a carefully orchestrated dance of distributed systems, each performing its role with precision. Understanding this process is fundamental to system design, and it&#8217;s why this question keeps showing up in senior engineering interviews.</p><p>Let&#8217;s break down exactly what happens, step by step.</p><h2>The Journey Begins: Understanding URLs</h2><p>When you type a URL like <code>https://www.bbc.co.uk/news/technology</code> into your browser, you&#8217;re actually providing four pieces of information:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZRA7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd963b7f8-d17e-4e5c-988e-919a4958852e_2683x507.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZRA7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd963b7f8-d17e-4e5c-988e-919a4958852e_2683x507.png 424w, https://substackcdn.com/image/fetch/$s_!ZRA7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd963b7f8-d17e-4e5c-988e-919a4958852e_2683x507.png 848w, https://substackcdn.com/image/fetch/$s_!ZRA7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd963b7f8-d17e-4e5c-988e-919a4958852e_2683x507.png 1272w, https://substackcdn.com/image/fetch/$s_!ZRA7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd963b7f8-d17e-4e5c-988e-919a4958852e_2683x507.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZRA7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd963b7f8-d17e-4e5c-988e-919a4958852e_2683x507.png" width="638" height="120.50137362637362" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d963b7f8-d17e-4e5c-988e-919a4958852e_2683x507.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:275,&quot;width&quot;:1456,&quot;resizeWidth&quot;:638,&quot;bytes&quot;:109823,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/178412763?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd963b7f8-d17e-4e5c-988e-919a4958852e_2683x507.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZRA7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd963b7f8-d17e-4e5c-988e-919a4958852e_2683x507.png 424w, https://substackcdn.com/image/fetch/$s_!ZRA7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd963b7f8-d17e-4e5c-988e-919a4958852e_2683x507.png 848w, https://substackcdn.com/image/fetch/$s_!ZRA7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd963b7f8-d17e-4e5c-988e-919a4958852e_2683x507.png 1272w, https://substackcdn.com/image/fetch/$s_!ZRA7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd963b7f8-d17e-4e5c-988e-919a4958852e_2683x507.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><ol><li><p><strong>Scheme</strong> (<code>https://</code>) - Tells the browser which protocol to use. HTTPS means the connection will be encrypted.</p></li><li><p><strong>Domain</strong> (<code>www.bbc.co.uk</code>) - The human-readable name of the server.</p></li><li><p><strong>Path</strong> (<code>/news</code>) - Think of it as a directory in a file system.</p></li><li><p><strong>Resource</strong> (<code>/technology</code>) - The specific file or content you want.</p></li></ol><p>Computers don&#8217;t speak in domain names though. They speak in IP addresses - unique numerical identifiers for every device on the internet. So our browser has a problem to solve.</p><h2>Step 1: DNS Lookup - Finding the Server&#8217;s Address</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rymk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bfa2a3a-9afc-4f02-9508-ef34d8671f5d_1254x1161.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rymk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bfa2a3a-9afc-4f02-9508-ef34d8671f5d_1254x1161.png 424w, https://substackcdn.com/image/fetch/$s_!rymk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bfa2a3a-9afc-4f02-9508-ef34d8671f5d_1254x1161.png 848w, https://substackcdn.com/image/fetch/$s_!rymk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bfa2a3a-9afc-4f02-9508-ef34d8671f5d_1254x1161.png 1272w, https://substackcdn.com/image/fetch/$s_!rymk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bfa2a3a-9afc-4f02-9508-ef34d8671f5d_1254x1161.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rymk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bfa2a3a-9afc-4f02-9508-ef34d8671f5d_1254x1161.png" width="576" height="533.2822966507177" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5bfa2a3a-9afc-4f02-9508-ef34d8671f5d_1254x1161.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1161,&quot;width&quot;:1254,&quot;resizeWidth&quot;:576,&quot;bytes&quot;:121970,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/178412763?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bfa2a3a-9afc-4f02-9508-ef34d8671f5d_1254x1161.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rymk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bfa2a3a-9afc-4f02-9508-ef34d8671f5d_1254x1161.png 424w, https://substackcdn.com/image/fetch/$s_!rymk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bfa2a3a-9afc-4f02-9508-ef34d8671f5d_1254x1161.png 848w, https://substackcdn.com/image/fetch/$s_!rymk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bfa2a3a-9afc-4f02-9508-ef34d8671f5d_1254x1161.png 1272w, https://substackcdn.com/image/fetch/$s_!rymk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bfa2a3a-9afc-4f02-9508-ef34d8671f5d_1254x1161.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The browser needs to translate &#8220;<a href="http://www.bbc.co.uk">www.bbc.co.uk</a>&#8220; into an IP address. This is where DNS (Domain Name System) comes in - essentially the internet&#8217;s phone book.</p><p>But DNS lookups can be slow, so the system is designed with multiple layers of caching:</p><p><strong>First stop: Browser cache</strong><br>The browser checks if it recently looked up this domain. If yes, it uses the cached IP address.</p><p><strong>Second stop: Operating system cache</strong><br>If the browser doesn&#8217;t have it, it asks the OS, which maintains its own short-term cache.</p><p><strong>Third stop: DNS resolver</strong><br>If neither has the answer, the OS queries a DNS resolver (usually provided by your ISP). This kicks off a chain of requests through the DNS infrastructure, from root servers to authoritative name servers, until the IP address is found.</p><p>The answer gets cached at every step along the way, making subsequent requests fast.</p><h2>Step 2: Establishing a TCP Connection</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!661G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061040be-beb5-4775-bc8d-4961825e0133_2313x1161.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!661G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061040be-beb5-4775-bc8d-4961825e0133_2313x1161.png 424w, https://substackcdn.com/image/fetch/$s_!661G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061040be-beb5-4775-bc8d-4961825e0133_2313x1161.png 848w, https://substackcdn.com/image/fetch/$s_!661G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061040be-beb5-4775-bc8d-4961825e0133_2313x1161.png 1272w, https://substackcdn.com/image/fetch/$s_!661G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061040be-beb5-4775-bc8d-4961825e0133_2313x1161.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!661G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061040be-beb5-4775-bc8d-4961825e0133_2313x1161.png" width="1456" height="731" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/061040be-beb5-4775-bc8d-4961825e0133_2313x1161.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:731,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:179124,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/178412763?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061040be-beb5-4775-bc8d-4961825e0133_2313x1161.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!661G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061040be-beb5-4775-bc8d-4961825e0133_2313x1161.png 424w, https://substackcdn.com/image/fetch/$s_!661G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061040be-beb5-4775-bc8d-4961825e0133_2313x1161.png 848w, https://substackcdn.com/image/fetch/$s_!661G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061040be-beb5-4775-bc8d-4961825e0133_2313x1161.png 1272w, https://substackcdn.com/image/fetch/$s_!661G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061040be-beb5-4775-bc8d-4961825e0133_2313x1161.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Now that the browser has the IP address, it needs to establish a connection with the server. This happens through a TCP handshake, a multi-step process that takes several round trips across the network.</p><p>Modern browsers use something called &#8220;keep-alive connections&#8221;. Instead of opening a new connection for every request, they reuse existing connections whenever possible. This dramatically reduces latency.</p><p>If you&#8217;re using HTTPS (which you should be), there&#8217;s an additional step: the TLS/SSL handshake. This establishes an encrypted tunnel between your browser and the server, but it&#8217;s computationally expensive. Browsers mitigate this cost using SSL session resumption, allowing them to skip parts of the handshake for repeated connections.</p><h2>Step 3: Sending the HTTP Request</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VKv4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ec79d03-e8ce-47e7-858e-8d28107d9423_2313x1161.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VKv4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ec79d03-e8ce-47e7-858e-8d28107d9423_2313x1161.png 424w, https://substackcdn.com/image/fetch/$s_!VKv4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ec79d03-e8ce-47e7-858e-8d28107d9423_2313x1161.png 848w, https://substackcdn.com/image/fetch/$s_!VKv4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ec79d03-e8ce-47e7-858e-8d28107d9423_2313x1161.png 1272w, https://substackcdn.com/image/fetch/$s_!VKv4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ec79d03-e8ce-47e7-858e-8d28107d9423_2313x1161.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VKv4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ec79d03-e8ce-47e7-858e-8d28107d9423_2313x1161.png" width="1456" height="731" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2ec79d03-e8ce-47e7-858e-8d28107d9423_2313x1161.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:731,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:204534,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/178412763?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ec79d03-e8ce-47e7-858e-8d28107d9423_2313x1161.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VKv4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ec79d03-e8ce-47e7-858e-8d28107d9423_2313x1161.png 424w, https://substackcdn.com/image/fetch/$s_!VKv4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ec79d03-e8ce-47e7-858e-8d28107d9423_2313x1161.png 848w, https://substackcdn.com/image/fetch/$s_!VKv4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ec79d03-e8ce-47e7-858e-8d28107d9423_2313x1161.png 1272w, https://substackcdn.com/image/fetch/$s_!VKv4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ec79d03-e8ce-47e7-858e-8d28107d9423_2313x1161.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Once the connection is established, the browser sends an HTTP request over it. HTTP itself is simple, just a text-based protocol asking the server for specific resources.</p><p>The server processes the request, fetches the necessary files (HTML, CSS, JavaScript), and sends back a response.</p><h2>Step 4: Rendering the Page</h2><p>The browser receives the HTML and starts parsing it.</p><p>As it reads through the HTML, it discovers additional resources it needs: CSS stylesheets, JavaScript files, images, fonts. For each of these, the browser repeats the entire process:</p><ul><li><p>DNS lookup (likely hitting cache this time)</p></li><li><p>TCP connection (likely reusing an existing one)</p></li><li><p>HTTP request</p></li></ul><p>This is why web performance optimization matters so much. Each additional resource means more round trips, more latency, more waiting.</p><h2>Why This Matters for System Design</h2><p>This seemingly simple flow touches nearly every fundamental concept in distributed systems:</p><ul><li><p><strong>Caching</strong> at multiple levels (browser, OS, DNS)</p></li><li><p><strong>Load balancing</strong> (DNS can return different IPs based on geography)</p></li><li><p><strong>Latency optimization</strong> (connection reuse, SSL session resumption)</p></li><li><p><strong>Fault tolerance</strong> (redundant DNS servers, CDNs)</p></li><li><p><strong>Scalability</strong> (handling millions of concurrent requests)</p></li></ul><p>When you&#8217;re designing systems at scale, you&#8217;re essentially orchestrating variations of these same patterns. Understanding how they work together in something as &#8220;simple&#8221; as loading a webpage gives you the mental models you need to design robust, performant systems.</p><div><hr></div><h4><strong>Like posts like this?</strong></h4><p>You may also like these:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;78798731-33c4-4020-a86e-61b6b9f35c11&quot;,&quot;caption&quot;:&quot;It is essential to store passwords in a way that prevents an attacker from getting them, even if the database is compromised.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to store passwords in your database&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-10T12:12:42.449Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0048edd-a511-4100-83bc-0340c0f4cf25_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-store-passwords-in-your-database&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177724900,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:26,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;03bf582e-a16f-459e-8752-841211412380&quot;,&quot;caption&quot;:&quot;SQL and NoSQL solve the same problem (storing data) with fundamentally different approaches:&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to choose between SQL and NoSQL&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-03T12:12:41.311Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a849abcc-eb00-4cbc-833e-e9a8d08dcc99_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/how-to-choose-between-sql-and-nosql&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177087618,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:22,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;78984cf3-3e4f-4521-a94d-fdb53547b0d1&quot;,&quot;caption&quot;:&quot;Authentication vs Authorization&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Authentication (Session Vs JWT)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-27T12:12:37.305Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/94367ece-8f06-42e5-bc60-380e57637b6c_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/authentication-session-vs-jwt&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177086976,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:18,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;7d3eb838-3e77-4e9f-b870-7827d84b3101&quot;,&quot;caption&quot;:&quot;Whether you&#8217;re designing a social media platform, payment system, or real-time collaboration tool, choosing the right API architecture can make or break your system&#8217;s performance and scalability. This post breaks down the most important API types you&#8217;ll need to know in system design interviews.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Every type of API you must know&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22563751,&quot;name&quot;:&quot;Stephane Moreau&quot;,&quot;bio&quot;:&quot;Senior Engineering Manager | Subscribe to get 50+ EM templates, The EM's Field Guide, and Engineering Leadership &amp; System Design posts.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f6e91f6-c630-4ddf-8d41-0cffe48b9b0c_2500x2500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-10-20T11:28:45.176Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3bdeb004-41be-4d1d-a257-4117399f0b01_2500x1406.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.systemdesignbutsimple.com/p/every-type-of-api-you-must-know&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:176498772,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:25,&quot;comment_count&quot;:1,&quot;publication_id&quot;:4458464,&quot;publication_name&quot;:&quot;System Design, but Simple&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!VTWY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e13eed-d7d4-43dd-862f-e9e70a989d8d_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h4>By subscribing, you get a breakdown <strong>like this every week</strong>.</h4><p><strong>Free subscribers</strong> also get a little bonus:</p><p>&#127873; <strong>The System Design Interview Preparation Cheat Sheet</strong></p><p>If you&#8217;re into <strong>visuals</strong>, <strong>paid subscribers</strong> unlock:</p><p>&#8594; <strong>My Excalidraw system design template</strong> &#8211; so you have <strong>somewhere to start</strong><br>&#8594; <strong>My Excalidraw component library</strong> &#8211; used in <strong>the diagram of this issue</strong></p><p>No pressure though. <strong>Your support helps me keep writing</strong>, and I appreciate it <strong>more than you know</strong> &#10084;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[How to store passwords in your database]]></title><description><![CDATA[Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/how-to-store-passwords-in-your-database</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/how-to-store-passwords-in-your-database</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 10 Nov 2025 12:12:42 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/d0048edd-a511-4100-83bc-0340c0f4cf25_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>It is essential to store passwords in a way that prevents an attacker from getting them, even if the database is compromised.</p><p><strong>Never store passwords as plaintext.</strong></p><h2>Recommendations from OWASP</h2><p>According to the <a href="https://owasp.org/">Open Web Application Security Project (OWASP)</a>, secure password storage requires two key ingredients:</p><h3>1. Use a Modern Hashing Algorithm</h3><p>A hash function is a one-way mathematical operation. You can turn a password into a hash, but you cannot reverse a hash back into the password.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BXMi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89ea9275-d25d-4763-957b-b26d124be69d_3428x1467.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BXMi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89ea9275-d25d-4763-957b-b26d124be69d_3428x1467.png 424w, https://substackcdn.com/image/fetch/$s_!BXMi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89ea9275-d25d-4763-957b-b26d124be69d_3428x1467.png 848w, https://substackcdn.com/image/fetch/$s_!BXMi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89ea9275-d25d-4763-957b-b26d124be69d_3428x1467.png 1272w, https://substackcdn.com/image/fetch/$s_!BXMi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89ea9275-d25d-4763-957b-b26d124be69d_3428x1467.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BXMi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89ea9275-d25d-4763-957b-b26d124be69d_3428x1467.png" width="638" height="272.99038461538464" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/89ea9275-d25d-4763-957b-b26d124be69d_3428x1467.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:623,&quot;width&quot;:1456,&quot;resizeWidth&quot;:638,&quot;bytes&quot;:376207,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/177724900?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89ea9275-d25d-4763-957b-b26d124be69d_3428x1467.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BXMi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89ea9275-d25d-4763-957b-b26d124be69d_3428x1467.png 424w, https://substackcdn.com/image/fetch/$s_!BXMi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89ea9275-d25d-4763-957b-b26d124be69d_3428x1467.png 848w, https://substackcdn.com/image/fetch/$s_!BXMi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89ea9275-d25d-4763-957b-b26d124be69d_3428x1467.png 1272w, https://substackcdn.com/image/fetch/$s_!BXMi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89ea9275-d25d-4763-957b-b26d124be69d_3428x1467.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>But not all hashing functions are equal.</strong></p><p>Common hash functions like MD5 and SHA-1 are fast - which sounds good, but is actually terrible for passwords. Fast hashing means attackers can try billions of password guesses per second using brute-force attacks.</p><p>Instead, use password-specific hashing algorithms that are intentionally slow and resource-intensive (such as <strong><a href="https://en.wikipedia.org/wiki/Bcrypt">bcrypt</a></strong>).</p><p>These algorithms make brute-force attacks computationally expensive and unattractive.</p><h3>2. Salt the Passwords</h3><p>A salt is a unique, randomly generated string added to each password before hashing. Even if two users have the same password (&#8221;password123&#8221;), their hashes will be completely different.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0Bfh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F988c8f89-bf68-4f48-afcd-0a256d564a70_3352x1276.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0Bfh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F988c8f89-bf68-4f48-afcd-0a256d564a70_3352x1276.png 424w, https://substackcdn.com/image/fetch/$s_!0Bfh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F988c8f89-bf68-4f48-afcd-0a256d564a70_3352x1276.png 848w, https://substackcdn.com/image/fetch/$s_!0Bfh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F988c8f89-bf68-4f48-afcd-0a256d564a70_3352x1276.png 1272w, https://substackcdn.com/image/fetch/$s_!0Bfh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F988c8f89-bf68-4f48-afcd-0a256d564a70_3352x1276.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0Bfh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F988c8f89-bf68-4f48-afcd-0a256d564a70_3352x1276.png" width="1456" height="554" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/988c8f89-bf68-4f48-afcd-0a256d564a70_3352x1276.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:554,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:276506,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/177724900?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F988c8f89-bf68-4f48-afcd-0a256d564a70_3352x1276.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0Bfh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F988c8f89-bf68-4f48-afcd-0a256d564a70_3352x1276.png 424w, https://substackcdn.com/image/fetch/$s_!0Bfh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F988c8f89-bf68-4f48-afcd-0a256d564a70_3352x1276.png 848w, https://substackcdn.com/image/fetch/$s_!0Bfh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F988c8f89-bf68-4f48-afcd-0a256d564a70_3352x1276.png 1272w, https://substackcdn.com/image/fetch/$s_!0Bfh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F988c8f89-bf68-4f48-afcd-0a256d564a70_3352x1276.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Why is this important?</strong></p><p>Without salts, attackers can use precomputed attack methods:</p><ul><li><p><strong>Rainbow tables</strong>: Massive databases of precomputed hashes for common passwords</p></li><li><p><strong>Database lookups</strong>: Quick searches to crack passwords in seconds</p></li></ul><p>By adding a unique salt to each password, you ensure every hash is unique, making these precomputed attacks useless.</p><h2>How It Works: Registration Flow</h2><p>When a user creates an account:</p><ol><li><p>User submits their password</p></li><li><p>System generates a random salt (e.g., &#8220;k8Px2mN9&#8221;)</p></li><li><p>System combines password + salt</p></li><li><p>System computes hash using a hashing algorithm like bcrypt</p></li><li><p>System stores both the hash AND the salt in the database</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8wTB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3fe923-a708-4340-ba8f-2db2cbc86ba5_3451x1227.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8wTB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3fe923-a708-4340-ba8f-2db2cbc86ba5_3451x1227.png 424w, https://substackcdn.com/image/fetch/$s_!8wTB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3fe923-a708-4340-ba8f-2db2cbc86ba5_3451x1227.png 848w, https://substackcdn.com/image/fetch/$s_!8wTB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3fe923-a708-4340-ba8f-2db2cbc86ba5_3451x1227.png 1272w, https://substackcdn.com/image/fetch/$s_!8wTB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3fe923-a708-4340-ba8f-2db2cbc86ba5_3451x1227.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8wTB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3fe923-a708-4340-ba8f-2db2cbc86ba5_3451x1227.png" width="664" height="236.23076923076923" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a3fe923-a708-4340-ba8f-2db2cbc86ba5_3451x1227.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:518,&quot;width&quot;:1456,&quot;resizeWidth&quot;:664,&quot;bytes&quot;:203224,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/177724900?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3fe923-a708-4340-ba8f-2db2cbc86ba5_3451x1227.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8wTB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3fe923-a708-4340-ba8f-2db2cbc86ba5_3451x1227.png 424w, https://substackcdn.com/image/fetch/$s_!8wTB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3fe923-a708-4340-ba8f-2db2cbc86ba5_3451x1227.png 848w, https://substackcdn.com/image/fetch/$s_!8wTB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3fe923-a708-4340-ba8f-2db2cbc86ba5_3451x1227.png 1272w, https://substackcdn.com/image/fetch/$s_!8wTB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3fe923-a708-4340-ba8f-2db2cbc86ba5_3451x1227.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The salt isn&#8217;t a secret. It can be stored as plaintext right next to the hash. Its job is to make each hash unique, not to hide information.</p><p><strong>Example</strong>:</p><pre><code><code>Password: "Welcome123!"
Salt: "S4!t"
Combined: "Welcome123!S4!t"
Hash: "$2y$10$Qbpn8Bq...b6MVioit/bG" (this gets stored)</code></code></pre><h2>How It Works: Login Validation</h2><p>When a user logs in:</p><ol><li><p>User submits username and password</p></li><li><p>System fetches the stored hash and salt from the database</p></li><li><p>System appends the stored salt to the submitted password</p></li><li><p>System computes a new hash</p></li><li><p>System compares: if computed hash == stored hash, password is valid &#10003;</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!l_14!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91de155-46d2-47e2-bffd-6fb8f1e3c24b_3621x1332.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!l_14!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91de155-46d2-47e2-bffd-6fb8f1e3c24b_3621x1332.png 424w, https://substackcdn.com/image/fetch/$s_!l_14!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91de155-46d2-47e2-bffd-6fb8f1e3c24b_3621x1332.png 848w, https://substackcdn.com/image/fetch/$s_!l_14!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91de155-46d2-47e2-bffd-6fb8f1e3c24b_3621x1332.png 1272w, https://substackcdn.com/image/fetch/$s_!l_14!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91de155-46d2-47e2-bffd-6fb8f1e3c24b_3621x1332.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!l_14!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91de155-46d2-47e2-bffd-6fb8f1e3c24b_3621x1332.png" width="666" height="245.17582417582418" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d91de155-46d2-47e2-bffd-6fb8f1e3c24b_3621x1332.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:536,&quot;width&quot;:1456,&quot;resizeWidth&quot;:666,&quot;bytes&quot;:243445,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/177724900?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91de155-46d2-47e2-bffd-6fb8f1e3c24b_3621x1332.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!l_14!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91de155-46d2-47e2-bffd-6fb8f1e3c24b_3621x1332.png 424w, https://substackcdn.com/image/fetch/$s_!l_14!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91de155-46d2-47e2-bffd-6fb8f1e3c24b_3621x1332.png 848w, https://substackcdn.com/image/fetch/$s_!l_14!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91de155-46d2-47e2-bffd-6fb8f1e3c24b_3621x1332.png 1272w, https://substackcdn.com/image/fetch/$s_!l_14!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91de155-46d2-47e2-bffd-6fb8f1e3c24b_3621x1332.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Additional Security Layers</h2><p>Consider these complementary defenses:</p><ul><li><p><strong>Rate limiting</strong>: Limit login attempts per IP address or user account</p></li><li><p><strong>Account lockout</strong>: Temporarily disable accounts after multiple failed attempts</p></li><li><p><strong>Adaptive hash parameters</strong>: Increase bcrypt &#8220;cost factor&#8221; over time as hardware improves</p></li><li><p><strong>Pepper (optional)</strong>: Add a secret key stored outside the database for an extra layer</p></li></ul><div><hr></div><h4><strong>Like posts like this?</strong></h4><p>By subscribing, you get a breakdown <strong>like this one every week</strong>.</p><p><strong>Free subscribers</strong> also get a little bonus:</p><p>&#127873; <strong>The System Design Interview Preparation Cheat Sheet</strong></p><p>If you&#8217;re into <strong>visuals</strong>, <strong>paid subscribers</strong> unlock:</p><p>&#8594; <strong>My Excalidraw system design template</strong> &#8211; so you have <strong>somewhere to start</strong><br>&#8594; <strong>My Excalidraw component library</strong> &#8211; used in <strong>the diagram of this issue</strong></p><p>No pressure though. <strong>Your support helps me keep writing</strong>, and I appreciate it <strong>more than you know</strong> &#10084;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[How to choose between SQL and NoSQL]]></title><description><![CDATA[Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/how-to-choose-between-sql-and-nosql</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/how-to-choose-between-sql-and-nosql</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 03 Nov 2025 12:12:41 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/a849abcc-eb00-4cbc-833e-e9a8d08dcc99_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>SQL and NoSQL solve the same problem (storing data) with fundamentally different approaches:</p><ul><li><p><strong>SQL</strong>: Structured data in tables with predefined schemas. Relationships between tables via JOINs.</p></li><li><p><strong>NoSQL</strong>: Flexible data storage (documents, key-value, graph, wide-column). No fixed schema required.</p></li></ul><h2>SQL Databases</h2><p>Key characteristic: Structured, relational, ACID-compliant</p><p><strong>Structure:</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OYp-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c91c3ba-72cb-492a-98a8-d8e0d96bc343_1888x729.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OYp-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c91c3ba-72cb-492a-98a8-d8e0d96bc343_1888x729.png 424w, https://substackcdn.com/image/fetch/$s_!OYp-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c91c3ba-72cb-492a-98a8-d8e0d96bc343_1888x729.png 848w, https://substackcdn.com/image/fetch/$s_!OYp-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c91c3ba-72cb-492a-98a8-d8e0d96bc343_1888x729.png 1272w, https://substackcdn.com/image/fetch/$s_!OYp-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c91c3ba-72cb-492a-98a8-d8e0d96bc343_1888x729.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OYp-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c91c3ba-72cb-492a-98a8-d8e0d96bc343_1888x729.png" width="1456" height="562" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3c91c3ba-72cb-492a-98a8-d8e0d96bc343_1888x729.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:562,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:85199,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/177087618?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c91c3ba-72cb-492a-98a8-d8e0d96bc343_1888x729.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OYp-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c91c3ba-72cb-492a-98a8-d8e0d96bc343_1888x729.png 424w, https://substackcdn.com/image/fetch/$s_!OYp-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c91c3ba-72cb-492a-98a8-d8e0d96bc343_1888x729.png 848w, https://substackcdn.com/image/fetch/$s_!OYp-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c91c3ba-72cb-492a-98a8-d8e0d96bc343_1888x729.png 1272w, https://substackcdn.com/image/fetch/$s_!OYp-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c91c3ba-72cb-492a-98a8-d8e0d96bc343_1888x729.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Examples:</strong> PostgreSQL, MySQL, Oracle</p><p><strong>Properties:</strong></p><ul><li><p><strong>ACID Transactions</strong> - All-or-nothing operations (critical for payments, banking)</p></li><li><p><strong>Complex Queries</strong> - JOINs across multiple tables, aggregations, filtering</p></li><li><p><strong>Data Integrity</strong> - Schema enforces structure, reduces errors</p></li><li><p><strong>Mature Tooling</strong> - Decades of optimisation, monitoring, backup tools</p></li><li><p><strong>Scaling</strong></p><ul><li><p><strong>Vertical</strong>: Adding CPU/RAM to one server is expensive</p></li><li><p><strong>Horizontal: </strong>Difficult to shard writes across multiple servers</p></li></ul></li><li><p><strong>Rigid Schema</strong> - Changes require migrations, can lock tables</p></li></ul><h2>NoSQL Databases</h2><p>Key characteristic: Flexible, distributed, eventually consistent</p><p><strong>Types:</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!b8Us!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a80b72b-633f-4764-b865-afac1fb771f6_3368x2725.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!b8Us!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a80b72b-633f-4764-b865-afac1fb771f6_3368x2725.png 424w, https://substackcdn.com/image/fetch/$s_!b8Us!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a80b72b-633f-4764-b865-afac1fb771f6_3368x2725.png 848w, https://substackcdn.com/image/fetch/$s_!b8Us!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a80b72b-633f-4764-b865-afac1fb771f6_3368x2725.png 1272w, https://substackcdn.com/image/fetch/$s_!b8Us!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a80b72b-633f-4764-b865-afac1fb771f6_3368x2725.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!b8Us!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a80b72b-633f-4764-b865-afac1fb771f6_3368x2725.png" width="1456" height="1178" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5a80b72b-633f-4764-b865-afac1fb771f6_3368x2725.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1178,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:550309,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/177087618?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a80b72b-633f-4764-b865-afac1fb771f6_3368x2725.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!b8Us!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a80b72b-633f-4764-b865-afac1fb771f6_3368x2725.png 424w, https://substackcdn.com/image/fetch/$s_!b8Us!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a80b72b-633f-4764-b865-afac1fb771f6_3368x2725.png 848w, https://substackcdn.com/image/fetch/$s_!b8Us!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a80b72b-633f-4764-b865-afac1fb771f6_3368x2725.png 1272w, https://substackcdn.com/image/fetch/$s_!b8Us!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a80b72b-633f-4764-b865-afac1fb771f6_3368x2725.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Properties:</strong></p><ul><li><p><strong>Horizontal Scaling</strong> - Add more servers to handle load</p></li><li><p><strong>Flexible Schema</strong> - Store different structures without migrations</p></li><li><p><strong>High Performance</strong> - Optimised for specific access patterns</p></li><li><p><strong>Distributed by Design</strong> - Natural fit for global, multi-region systems</p></li><li><p><strong>Eventual Consistency</strong> - Writes take time to propagate across nodes</p></li><li><p><strong>Limited Querying</strong> - Complex queries handled in application code</p></li><li><p><strong>Less Data Integrity</strong> - Schema validation happens in your application</p></li></ul><h2>A decision framework for interviews</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xxSL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feebe356b-b530-420e-960e-e0f5c789915c_4799x5323.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xxSL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feebe356b-b530-420e-960e-e0f5c789915c_4799x5323.png 424w, https://substackcdn.com/image/fetch/$s_!xxSL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feebe356b-b530-420e-960e-e0f5c789915c_4799x5323.png 848w, https://substackcdn.com/image/fetch/$s_!xxSL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feebe356b-b530-420e-960e-e0f5c789915c_4799x5323.png 1272w, https://substackcdn.com/image/fetch/$s_!xxSL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feebe356b-b530-420e-960e-e0f5c789915c_4799x5323.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xxSL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feebe356b-b530-420e-960e-e0f5c789915c_4799x5323.png" width="1456" height="1615" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eebe356b-b530-420e-960e-e0f5c789915c_4799x5323.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1615,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:914989,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/177087618?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feebe356b-b530-420e-960e-e0f5c789915c_4799x5323.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xxSL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feebe356b-b530-420e-960e-e0f5c789915c_4799x5323.png 424w, https://substackcdn.com/image/fetch/$s_!xxSL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feebe356b-b530-420e-960e-e0f5c789915c_4799x5323.png 848w, https://substackcdn.com/image/fetch/$s_!xxSL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feebe356b-b530-420e-960e-e0f5c789915c_4799x5323.png 1272w, https://substackcdn.com/image/fetch/$s_!xxSL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feebe356b-b530-420e-960e-e0f5c789915c_4799x5323.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Consistency Trade-off</h2><p><strong>Strong Consistency (SQL):</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Q_sO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0904a4d-d7d7-4356-bb44-bdc338036182_1058x884.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Q_sO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0904a4d-d7d7-4356-bb44-bdc338036182_1058x884.png 424w, https://substackcdn.com/image/fetch/$s_!Q_sO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0904a4d-d7d7-4356-bb44-bdc338036182_1058x884.png 848w, https://substackcdn.com/image/fetch/$s_!Q_sO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0904a4d-d7d7-4356-bb44-bdc338036182_1058x884.png 1272w, https://substackcdn.com/image/fetch/$s_!Q_sO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0904a4d-d7d7-4356-bb44-bdc338036182_1058x884.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Q_sO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0904a4d-d7d7-4356-bb44-bdc338036182_1058x884.png" width="462" height="386.01890359168243" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0904a4d-d7d7-4356-bb44-bdc338036182_1058x884.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:884,&quot;width&quot;:1058,&quot;resizeWidth&quot;:462,&quot;bytes&quot;:75170,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/177087618?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0904a4d-d7d7-4356-bb44-bdc338036182_1058x884.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Q_sO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0904a4d-d7d7-4356-bb44-bdc338036182_1058x884.png 424w, https://substackcdn.com/image/fetch/$s_!Q_sO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0904a4d-d7d7-4356-bb44-bdc338036182_1058x884.png 848w, https://substackcdn.com/image/fetch/$s_!Q_sO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0904a4d-d7d7-4356-bb44-bdc338036182_1058x884.png 1272w, https://substackcdn.com/image/fetch/$s_!Q_sO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0904a4d-d7d7-4356-bb44-bdc338036182_1058x884.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Eventual Consistency (NoSQL):</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RPzl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5029229c-39b2-4f73-a256-86bc076adce9_1642x970.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RPzl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5029229c-39b2-4f73-a256-86bc076adce9_1642x970.png 424w, https://substackcdn.com/image/fetch/$s_!RPzl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5029229c-39b2-4f73-a256-86bc076adce9_1642x970.png 848w, https://substackcdn.com/image/fetch/$s_!RPzl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5029229c-39b2-4f73-a256-86bc076adce9_1642x970.png 1272w, https://substackcdn.com/image/fetch/$s_!RPzl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5029229c-39b2-4f73-a256-86bc076adce9_1642x970.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RPzl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5029229c-39b2-4f73-a256-86bc076adce9_1642x970.png" width="506" height="298.8736263736264" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5029229c-39b2-4f73-a256-86bc076adce9_1642x970.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:860,&quot;width&quot;:1456,&quot;resizeWidth&quot;:506,&quot;bytes&quot;:114128,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/177087618?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5029229c-39b2-4f73-a256-86bc076adce9_1642x970.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RPzl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5029229c-39b2-4f73-a256-86bc076adce9_1642x970.png 424w, https://substackcdn.com/image/fetch/$s_!RPzl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5029229c-39b2-4f73-a256-86bc076adce9_1642x970.png 848w, https://substackcdn.com/image/fetch/$s_!RPzl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5029229c-39b2-4f73-a256-86bc076adce9_1642x970.png 1272w, https://substackcdn.com/image/fetch/$s_!RPzl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5029229c-39b2-4f73-a256-86bc076adce9_1642x970.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Scaling Patterns</h2><p><strong>SQL Scaling:</strong></p><ul><li><p>Vertical: Add CPU/RAM to main server (Read replicas for read-heavy loads)</p></li><li><p>Horizontal: Sharding (complex) - Split data across servers by key</p></li></ul><p><strong>NoSQL Scaling:</strong></p><ul><li><p>Horizontal: Add nodes to cluster (Automatic data distribution)</p></li></ul><h2>Common Use Cases</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Pi80!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b581eb-7b2d-44e4-8bdc-01c98f174cb2_691x260.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Pi80!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b581eb-7b2d-44e4-8bdc-01c98f174cb2_691x260.png 424w, https://substackcdn.com/image/fetch/$s_!Pi80!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b581eb-7b2d-44e4-8bdc-01c98f174cb2_691x260.png 848w, https://substackcdn.com/image/fetch/$s_!Pi80!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b581eb-7b2d-44e4-8bdc-01c98f174cb2_691x260.png 1272w, https://substackcdn.com/image/fetch/$s_!Pi80!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b581eb-7b2d-44e4-8bdc-01c98f174cb2_691x260.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Pi80!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b581eb-7b2d-44e4-8bdc-01c98f174cb2_691x260.png" width="691" height="260" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/23b581eb-7b2d-44e4-8bdc-01c98f174cb2_691x260.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:260,&quot;width&quot;:691,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:46630,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/177087618?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b581eb-7b2d-44e4-8bdc-01c98f174cb2_691x260.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Pi80!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b581eb-7b2d-44e4-8bdc-01c98f174cb2_691x260.png 424w, https://substackcdn.com/image/fetch/$s_!Pi80!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b581eb-7b2d-44e4-8bdc-01c98f174cb2_691x260.png 848w, https://substackcdn.com/image/fetch/$s_!Pi80!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b581eb-7b2d-44e4-8bdc-01c98f174cb2_691x260.png 1272w, https://substackcdn.com/image/fetch/$s_!Pi80!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b581eb-7b2d-44e4-8bdc-01c98f174cb2_691x260.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h4><strong>Like posts like this?</strong></h4><p>By subscribing, you get a breakdown <strong>like this one every week</strong>.</p><p><strong>Free subscribers</strong> also get a little bonus:</p><p>&#127873; <strong>The System Design Interview Preparation Cheat Sheet</strong></p><p>If you're into <strong>visuals</strong>, <strong>paid subscribers</strong> unlock:</p><p>&#8594; <strong>My Excalidraw system design template</strong> &#8211; so you have <strong>somewhere to start</strong><br>&#8594; <strong>My Excalidraw component library</strong> &#8211; used in <strong>the diagram of this issue</strong></p><p>No pressure though. <strong>Your support helps me keep writing</strong>, and I appreciate it <strong>more than you know</strong> &#10084;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Authentication (Session Vs JWT)]]></title><description><![CDATA[Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/authentication-session-vs-jwt</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/authentication-session-vs-jwt</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 27 Oct 2025 12:12:37 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/94367ece-8f06-42e5-bc60-380e57637b6c_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Authentication vs Authorization</h2><p><strong>Authentication</strong> and <strong>Authorization</strong> solve two fundamental security questions in any system:</p><ul><li><p><strong>Authentication</strong>: &#8220;Who are you?&#8221; - Proving and verifying user identity</p></li><li><p><strong>Authorization</strong>: &#8220;What are you allowed to do?&#8221; - Determining permissions and access rights</p></li></ul><p>After a user logs in once, the system needs a way to &#8220;remember&#8221; them across multiple requests without asking for credentials repeatedly. There are two fundamentally different approaches to maintaining logged-in state</p><ul><li><p><strong>session-based </strong>authentication</p></li><li><p><strong>JWT-based</strong> authentication</p></li></ul><h3>Session-Based Authentication</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Lt_O!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff17f23e8-d28a-427d-9e1e-ea21b4e9a972_949x481.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Lt_O!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff17f23e8-d28a-427d-9e1e-ea21b4e9a972_949x481.png 424w, https://substackcdn.com/image/fetch/$s_!Lt_O!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff17f23e8-d28a-427d-9e1e-ea21b4e9a972_949x481.png 848w, https://substackcdn.com/image/fetch/$s_!Lt_O!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff17f23e8-d28a-427d-9e1e-ea21b4e9a972_949x481.png 1272w, https://substackcdn.com/image/fetch/$s_!Lt_O!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff17f23e8-d28a-427d-9e1e-ea21b4e9a972_949x481.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Lt_O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff17f23e8-d28a-427d-9e1e-ea21b4e9a972_949x481.png" width="949" height="481" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f17f23e8-d28a-427d-9e1e-ea21b4e9a972_949x481.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:481,&quot;width&quot;:949,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:46022,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/177086976?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff17f23e8-d28a-427d-9e1e-ea21b4e9a972_949x481.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Lt_O!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff17f23e8-d28a-427d-9e1e-ea21b4e9a972_949x481.png 424w, https://substackcdn.com/image/fetch/$s_!Lt_O!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff17f23e8-d28a-427d-9e1e-ea21b4e9a972_949x481.png 848w, https://substackcdn.com/image/fetch/$s_!Lt_O!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff17f23e8-d28a-427d-9e1e-ea21b4e9a972_949x481.png 1272w, https://substackcdn.com/image/fetch/$s_!Lt_O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff17f23e8-d28a-427d-9e1e-ea21b4e9a972_949x481.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Key characteristic</strong>: The server stores session state, making it stateful. Session ID is just a reference key.</p><p><strong>Components:</strong></p><ul><li><p><strong>Cookie</strong>: Contains session ID (small, opaque string)</p></li><li><p><strong>Session Store</strong>: Centralized storage (Redis, database, Memcached)</p></li><li><p><strong>Session Data</strong>: User ID, expiration, metadata stored server-side</p></li></ul><h3>JWT-Based Authentication</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!L4pz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb925c75e-1795-40f4-a44a-9a3c6b5eaccd_874x621.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L4pz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb925c75e-1795-40f4-a44a-9a3c6b5eaccd_874x621.png 424w, https://substackcdn.com/image/fetch/$s_!L4pz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb925c75e-1795-40f4-a44a-9a3c6b5eaccd_874x621.png 848w, https://substackcdn.com/image/fetch/$s_!L4pz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb925c75e-1795-40f4-a44a-9a3c6b5eaccd_874x621.png 1272w, https://substackcdn.com/image/fetch/$s_!L4pz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb925c75e-1795-40f4-a44a-9a3c6b5eaccd_874x621.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L4pz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb925c75e-1795-40f4-a44a-9a3c6b5eaccd_874x621.png" width="874" height="621" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b925c75e-1795-40f4-a44a-9a3c6b5eaccd_874x621.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:621,&quot;width&quot;:874,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:56909,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/177086976?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb925c75e-1795-40f4-a44a-9a3c6b5eaccd_874x621.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!L4pz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb925c75e-1795-40f4-a44a-9a3c6b5eaccd_874x621.png 424w, https://substackcdn.com/image/fetch/$s_!L4pz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb925c75e-1795-40f4-a44a-9a3c6b5eaccd_874x621.png 848w, https://substackcdn.com/image/fetch/$s_!L4pz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb925c75e-1795-40f4-a44a-9a3c6b5eaccd_874x621.png 1272w, https://substackcdn.com/image/fetch/$s_!L4pz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb925c75e-1795-40f4-a44a-9a3c6b5eaccd_874x621.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Key characteristic</strong>: No server-side storage, making it stateless. All data is in the token itself.</p><p><strong>JWT Structure (three parts separated by dots):</strong></p><pre><code>header.payload.signature

Example:
eyJhbGc...  .  eyJ1c2Vy...  .  SflKxwRJ...
[algorithm]    [user data]     [signature]</code></pre><p><strong>Signing Algorithms:</strong></p><ul><li><p><strong>HMAC (HS256)</strong>: Symmetric - same key for sign &amp; verify (simpler, faster)</p></li><li><p><strong>RSA/ECDSA</strong>: Asymmetric - private key signs, public key verifies (more secure for distributed systems)</p></li></ul><p><strong>Token Refresh Pattern</strong> (Best Practice for JWT)</p><pre><code>Access Token (short-lived: 15 min) &#9472;&#9472;&#9472;&#9472;&#9488;
                                       &#9500;&#9472;&#9472;&#9654; Regular API requests
Refresh Token (long-lived: 7 days) &#9472;&#9472;&#9472;&#9472;&#9496;
         &#9474;
         &#9492;&#9472;&#9472;&#9654; Only sent to /refresh endpoint when access token expires</code></pre><h2>Trade-offs</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5B-n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9aedcc-4b96-4d84-bb2f-5050725d2e39_5849x1878.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5B-n!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9aedcc-4b96-4d84-bb2f-5050725d2e39_5849x1878.png 424w, https://substackcdn.com/image/fetch/$s_!5B-n!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9aedcc-4b96-4d84-bb2f-5050725d2e39_5849x1878.png 848w, https://substackcdn.com/image/fetch/$s_!5B-n!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9aedcc-4b96-4d84-bb2f-5050725d2e39_5849x1878.png 1272w, https://substackcdn.com/image/fetch/$s_!5B-n!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9aedcc-4b96-4d84-bb2f-5050725d2e39_5849x1878.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5B-n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9aedcc-4b96-4d84-bb2f-5050725d2e39_5849x1878.png" width="1456" height="467" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ba9aedcc-4b96-4d84-bb2f-5050725d2e39_5849x1878.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:467,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:583836,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/177086976?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9aedcc-4b96-4d84-bb2f-5050725d2e39_5849x1878.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5B-n!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9aedcc-4b96-4d84-bb2f-5050725d2e39_5849x1878.png 424w, https://substackcdn.com/image/fetch/$s_!5B-n!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9aedcc-4b96-4d84-bb2f-5050725d2e39_5849x1878.png 848w, https://substackcdn.com/image/fetch/$s_!5B-n!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9aedcc-4b96-4d84-bb2f-5050725d2e39_5849x1878.png 1272w, https://substackcdn.com/image/fetch/$s_!5B-n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9aedcc-4b96-4d84-bb2f-5050725d2e39_5849x1878.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h4><strong>Like posts like this?</strong></h4><p>By subscribing, you get a breakdown <strong>like this one every week</strong>.</p><p><strong>Free subscribers</strong> also get a little bonus:</p><p>&#127873; <strong>The System Design Interview Preparation Cheat Sheet</strong></p><p>If you're into <strong>visuals</strong>, <strong>paid subscribers</strong> unlock:</p><p>&#8594; <strong>My Excalidraw system design template</strong> &#8211; so you have <strong>somewhere to start</strong><br>&#8594; <strong>My Excalidraw component library</strong> &#8211; used in <strong>the diagram of this issue</strong></p><p>No pressure though. <strong>Your support helps me keep writing</strong>, and I appreciate it <strong>more than you know</strong> &#10084;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Every type of API you must know]]></title><description><![CDATA[Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/every-type-of-api-you-must-know</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/every-type-of-api-you-must-know</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 20 Oct 2025 11:28:45 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/3bdeb004-41be-4d1d-a257-4117399f0b01_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Whether you&#8217;re designing a social media platform, payment system, or real-time collaboration tool, choosing the right API architecture can make or break your system&#8217;s performance and scalability. This post breaks down the most important API types you&#8217;ll need to know in system design interviews.</p><h2>REST</h2><p>REST (Representational State Transfer) is the most widely adopted API architecture style. It uses standard HTTP methods to perform operations on resources identified by URLs.</p><p><strong>How it works:</strong></p><ul><li><p>Client sends HTTP request to a URL</p></li><li><p>Server processes request and returns data (usually JSON)</p></li><li><p>Each request is independent - server doesn&#8217;t remember previous requests</p></li></ul><p><strong>Key characteristics:</strong></p><ul><li><p><strong>Stateless</strong>: Each request contains all information needed to process it</p></li><li><p><strong>Resource-based</strong>: Everything is treated as a resource with a unique URI</p></li><li><p><strong>Standard HTTP methods</strong>: GET (read), POST (create), PUT (update), DELETE (remove)</p></li><li><p><strong>Multiple formats</strong>: Typically JSON, but can support XML, plain text, etc.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!smTe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59e0e297-71cb-41ec-80b3-2fe11899ebff_1716x406.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!smTe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59e0e297-71cb-41ec-80b3-2fe11899ebff_1716x406.png 424w, https://substackcdn.com/image/fetch/$s_!smTe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59e0e297-71cb-41ec-80b3-2fe11899ebff_1716x406.png 848w, https://substackcdn.com/image/fetch/$s_!smTe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59e0e297-71cb-41ec-80b3-2fe11899ebff_1716x406.png 1272w, https://substackcdn.com/image/fetch/$s_!smTe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59e0e297-71cb-41ec-80b3-2fe11899ebff_1716x406.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!smTe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59e0e297-71cb-41ec-80b3-2fe11899ebff_1716x406.png" width="1456" height="344" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/59e0e297-71cb-41ec-80b3-2fe11899ebff_1716x406.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:344,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:87826,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/176498772?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59e0e297-71cb-41ec-80b3-2fe11899ebff_1716x406.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!smTe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59e0e297-71cb-41ec-80b3-2fe11899ebff_1716x406.png 424w, https://substackcdn.com/image/fetch/$s_!smTe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59e0e297-71cb-41ec-80b3-2fe11899ebff_1716x406.png 848w, https://substackcdn.com/image/fetch/$s_!smTe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59e0e297-71cb-41ec-80b3-2fe11899ebff_1716x406.png 1272w, https://substackcdn.com/image/fetch/$s_!smTe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59e0e297-71cb-41ec-80b3-2fe11899ebff_1716x406.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption"><strong>Example REST API methods</strong></figcaption></figure></div><p><strong>When to use:</strong> CRUD operations, public APIs, and when you need broad compatibility across different platforms and languages.</p><h2>gRPC</h2><p>gRPC is Google&#8217;s high-performance RPC framework that uses Protocol Buffers for serialization and HTTP/2 for transport.</p><p><strong>How it works:</strong></p><ul><li><p>Define your API in a .proto file</p></li><li><p>gRPC generates code for client and server</p></li><li><p>Data transmitted as compressed binary</p></li><li><p>Supports streaming in both directions</p></li></ul><p><strong>Key characteristics:</strong></p><ul><li><p><strong>Binary protocol</strong>: Uses Protocol Buffers instead of JSON</p></li><li><p><strong>HTTP/2 based</strong>: Multiplexing, server push, header compression</p></li><li><p><strong>Four communication patterns</strong>:</p><ul><li><p>Unary (request-response)</p></li><li><p>Server streaming</p></li><li><p>Client streaming</p></li><li><p>Bidirectional streaming</p></li></ul></li><li><p><strong>Strongly typed</strong>: Contract-first development with .proto files</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ssky!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47f0dbb0-06b4-4b59-82a9-ca5817caa7a7_940x300.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ssky!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47f0dbb0-06b4-4b59-82a9-ca5817caa7a7_940x300.png 424w, https://substackcdn.com/image/fetch/$s_!ssky!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47f0dbb0-06b4-4b59-82a9-ca5817caa7a7_940x300.png 848w, https://substackcdn.com/image/fetch/$s_!ssky!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47f0dbb0-06b4-4b59-82a9-ca5817caa7a7_940x300.png 1272w, https://substackcdn.com/image/fetch/$s_!ssky!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47f0dbb0-06b4-4b59-82a9-ca5817caa7a7_940x300.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ssky!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47f0dbb0-06b4-4b59-82a9-ca5817caa7a7_940x300.png" width="940" height="300" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/47f0dbb0-06b4-4b59-82a9-ca5817caa7a7_940x300.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:300,&quot;width&quot;:940,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:92247,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/176498772?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47f0dbb0-06b4-4b59-82a9-ca5817caa7a7_940x300.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ssky!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47f0dbb0-06b4-4b59-82a9-ca5817caa7a7_940x300.png 424w, https://substackcdn.com/image/fetch/$s_!ssky!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47f0dbb0-06b4-4b59-82a9-ca5817caa7a7_940x300.png 848w, https://substackcdn.com/image/fetch/$s_!ssky!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47f0dbb0-06b4-4b59-82a9-ca5817caa7a7_940x300.png 1272w, https://substackcdn.com/image/fetch/$s_!ssky!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47f0dbb0-06b4-4b59-82a9-ca5817caa7a7_940x300.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong>Example .proto definition</strong></figcaption></figure></div><p><strong>When to use:</strong> Building microservices, need high performance, or require real-time streaming.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>GraphQL</h2><p>GraphQL is a query language and runtime that allows clients to request exactly what data they need, solving the over-fetching and under-fetching problems of REST.</p><p><strong>How it works:</strong></p><ul><li><p>Client sends a query specifying exact fields needed</p></li><li><p>Server returns only those fields</p></li><li><p>One endpoint handles all requests</p></li><li><p>Clients control the response shape</p></li></ul><p><strong>Key characteristics:</strong></p><ul><li><p><strong>Single endpoint</strong>: All requests go to one URL</p></li><li><p><strong>Flexible queries</strong>: Clients specify exact data requirements</p></li><li><p><strong>Type system</strong>: Strongly typed schema</p></li><li><p><strong>Real-time subscriptions</strong>: Built-in support for live updates</p></li><li><p><strong>Self-documenting</strong>: Introspection capabilities</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fQIJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F855d2eb6-6370-455c-8766-63c20c6c0d90_1682x460.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fQIJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F855d2eb6-6370-455c-8766-63c20c6c0d90_1682x460.png 424w, https://substackcdn.com/image/fetch/$s_!fQIJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F855d2eb6-6370-455c-8766-63c20c6c0d90_1682x460.png 848w, https://substackcdn.com/image/fetch/$s_!fQIJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F855d2eb6-6370-455c-8766-63c20c6c0d90_1682x460.png 1272w, https://substackcdn.com/image/fetch/$s_!fQIJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F855d2eb6-6370-455c-8766-63c20c6c0d90_1682x460.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fQIJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F855d2eb6-6370-455c-8766-63c20c6c0d90_1682x460.png" width="1456" height="398" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/855d2eb6-6370-455c-8766-63c20c6c0d90_1682x460.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:398,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:59904,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/176498772?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F855d2eb6-6370-455c-8766-63c20c6c0d90_1682x460.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fQIJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F855d2eb6-6370-455c-8766-63c20c6c0d90_1682x460.png 424w, https://substackcdn.com/image/fetch/$s_!fQIJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F855d2eb6-6370-455c-8766-63c20c6c0d90_1682x460.png 848w, https://substackcdn.com/image/fetch/$s_!fQIJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F855d2eb6-6370-455c-8766-63c20c6c0d90_1682x460.png 1272w, https://substackcdn.com/image/fetch/$s_!fQIJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F855d2eb6-6370-455c-8766-63c20c6c0d90_1682x460.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Example GraphQL query and response</figcaption></figure></div><p><strong>When to use:</strong> Different clients need different data, you have complex relationships, or want to prevent over/under-fetching.</p><h2>Webhooks</h2><p>Webhooks implement an event-driven architecture where the server pushes data to clients when specific events occur, eliminating the need for constant polling. Instead of clients asking for updates, the server tells them when something happens.</p><p><strong>How it works:</strong></p><ul><li><p>Client registers a URL with the server</p></li><li><p>When an event occurs, server sends HTTP POST to that URL</p></li><li><p>Client processes the event data</p></li></ul><p><strong>Key characteristics:</strong></p><ul><li><p><strong>Push-based</strong>: Server initiates communication</p></li><li><p><strong>Event-driven</strong>: Triggers on specific actions</p></li><li><p><strong>HTTP POST</strong>: Typically sends JSON payload to registered URLs</p></li><li><p><strong>Asynchronous</strong>: Fire-and-forget pattern</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!v6g6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febbfa52a-1bcd-449c-a3cb-a8a4fe5137ff_1748x968.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!v6g6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febbfa52a-1bcd-449c-a3cb-a8a4fe5137ff_1748x968.png 424w, https://substackcdn.com/image/fetch/$s_!v6g6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febbfa52a-1bcd-449c-a3cb-a8a4fe5137ff_1748x968.png 848w, https://substackcdn.com/image/fetch/$s_!v6g6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febbfa52a-1bcd-449c-a3cb-a8a4fe5137ff_1748x968.png 1272w, https://substackcdn.com/image/fetch/$s_!v6g6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febbfa52a-1bcd-449c-a3cb-a8a4fe5137ff_1748x968.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!v6g6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febbfa52a-1bcd-449c-a3cb-a8a4fe5137ff_1748x968.png" width="1456" height="806" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ebbfa52a-1bcd-449c-a3cb-a8a4fe5137ff_1748x968.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:806,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:102446,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/176498772?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febbfa52a-1bcd-449c-a3cb-a8a4fe5137ff_1748x968.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!v6g6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febbfa52a-1bcd-449c-a3cb-a8a4fe5137ff_1748x968.png 424w, https://substackcdn.com/image/fetch/$s_!v6g6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febbfa52a-1bcd-449c-a3cb-a8a4fe5137ff_1748x968.png 848w, https://substackcdn.com/image/fetch/$s_!v6g6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febbfa52a-1bcd-449c-a3cb-a8a4fe5137ff_1748x968.png 1272w, https://substackcdn.com/image/fetch/$s_!v6g6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febbfa52a-1bcd-449c-a3cb-a8a4fe5137ff_1748x968.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong>Simple example webhook flow </strong></figcaption></figure></div><p><strong>When to use:</strong> Payment notifications, CI/CD pipelines, third-party integrations, or any scenario where you need real-time event notifications.</p><h2>WebSockets</h2><p>WebSockets keep a connection open between client and server, allowing instant two-way communication.</p><p><strong>How it works:</strong></p><ul><li><p>Client and server establish connection with special handshake</p></li><li><p>Connection stays open</p></li><li><p>Either side can send messages anytime</p></li><li><p>No request-response pattern needed</p></li></ul><p><strong>Key characteristics:</strong></p><ul><li><p><strong>Persistent connection</strong>: Stays open after initial handshake</p></li><li><p><strong>Low latency</strong>: No HTTP overhead for each message</p></li><li><p><strong>Bidirectional</strong>: Both client and server can initiate messages</p></li><li><p><strong>Text or binary</strong>: Supports multiple data formats</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DhbS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7382de-6c1b-4189-9f4f-beeec3acbd0d_1070x198.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DhbS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7382de-6c1b-4189-9f4f-beeec3acbd0d_1070x198.png 424w, https://substackcdn.com/image/fetch/$s_!DhbS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7382de-6c1b-4189-9f4f-beeec3acbd0d_1070x198.png 848w, https://substackcdn.com/image/fetch/$s_!DhbS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7382de-6c1b-4189-9f4f-beeec3acbd0d_1070x198.png 1272w, https://substackcdn.com/image/fetch/$s_!DhbS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7382de-6c1b-4189-9f4f-beeec3acbd0d_1070x198.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DhbS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7382de-6c1b-4189-9f4f-beeec3acbd0d_1070x198.png" width="1070" height="198" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab7382de-6c1b-4189-9f4f-beeec3acbd0d_1070x198.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:198,&quot;width&quot;:1070,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:63537,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.systemdesignbutsimple.com/i/176498772?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7382de-6c1b-4189-9f4f-beeec3acbd0d_1070x198.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!DhbS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7382de-6c1b-4189-9f4f-beeec3acbd0d_1070x198.png 424w, https://substackcdn.com/image/fetch/$s_!DhbS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7382de-6c1b-4189-9f4f-beeec3acbd0d_1070x198.png 848w, https://substackcdn.com/image/fetch/$s_!DhbS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7382de-6c1b-4189-9f4f-beeec3acbd0d_1070x198.png 1272w, https://substackcdn.com/image/fetch/$s_!DhbS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7382de-6c1b-4189-9f4f-beeec3acbd0d_1070x198.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Example WebSocket setup</figcaption></figure></div><p><strong>When to use:</strong> Chat applications, live sports scores, collaborative editing, real-time dashboards, or multiplayer games.</p><h2>WebRTC</h2><p>WebRTC enables peer-to-peer communication directly between browsers and applications without data passing through your servers.</p><p><strong>How it works:</strong></p><ul><li><p>Browsers exchange connection info through your server</p></li><li><p>Once connected, they communicate directly peer-to-peer</p></li><li><p>Audio, video, and data flow directly between users</p></li><li><p>Your server doesn&#8217;t handle the media stream</p></li></ul><p><strong>Key characteristics:</strong></p><ul><li><p><strong>Peer-to-peer</strong>: Direct connection between clients</p></li><li><p><strong>Media streaming</strong>: Audio, video, and data channels</p></li><li><p><strong>NAT traversal</strong>: Works across different networks using STUN/TURN</p></li><li><p><strong>Encryption</strong>: Mandatory SRTP for media, DTLS for data</p></li></ul><p><strong>Example use case:</strong> In a video call application, after initial signaling through your server, participants exchange audio/video directly between their devices, reducing server load and latency.</p><p><strong>When to use:</strong> Video conferencing, screen sharing, file sharing between users, or real-time collaboration tools.</p><h2>Choosing the Right API</h2><p>In system design interviews, selecting the appropriate API depends on several factors:</p><ul><li><p><strong>Latency requirements</strong>: gRPC or WebSockets for low latency</p></li><li><p><strong>Data flexibility</strong>: GraphQL when clients need varied data shapes</p></li><li><p><strong>Real-time needs</strong>: WebSockets for bidirectional, Webhooks for server-push</p></li><li><p><strong>Bandwidth constraints</strong>: gRPC for efficient binary protocol</p></li><li><p><strong>Peer-to-peer</strong>: WebRTC for direct client communication</p></li></ul><p>Modern systems often combine multiple API types. A video conferencing system might use REST for user management, WebSockets for chat, WebRTC for video streams, and Webhooks for notifications.</p><div><hr></div><h4><strong>Like posts like this?</strong></h4><p>By subscribing, you get a breakdown <strong>like this one every week</strong>.</p><p><strong>Free subscribers</strong> also get a little bonus:</p><p>&#127873; <strong>The System Design Interview Preparation Cheat Sheet</strong></p><p>If you're into <strong>visuals</strong>, <strong>paid subscribers</strong> unlock:</p><p>&#8594; <strong>My Excalidraw system design template</strong> &#8211; so you have <strong>somewhere to start</strong><br>&#8594; <strong>My Excalidraw component library</strong> &#8211; used in <strong>the diagram of this issue</strong></p><p>No pressure though. <strong>Your support helps me keep writing</strong>, and I appreciate it <strong>more than you know</strong> &#10084;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System design, explained ridiculously simply. Finally, make sense of system design and pass your next interview!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Design Leetcode]]></title><description><![CDATA[Like you should in an interview. Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/design-leetcode</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/design-leetcode</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 13 Oct 2025 11:12:28 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/4039743e-a410-47bc-8fe9-a351d11da3c9_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this issue, I walk through the exact thinking I&#8217;d use in a system design interview out loud, step by step. Clear, practical, and including trade-offs you can defend.</p><p><strong>What you&#8217;ll learn in ~15 minutes</strong></p><ul><li><p>How I would scope the problem without missing important requirements (custom aliases, expirations, availability).</p></li><li><p><strong>Why choosing containers over serverless for code execution is better</strong></p></li><li><p><strong>The pattern that makes leaderboards lightning-fast instead of crushing your database with expensive GROUP BY queries</strong></p></li><li><p><strong>How to implement container security that prevents malicious code from taking down your entire platform</strong></p></li></ul><p><strong>How this issue is structured</strong><br>I split the write-up into the same sections I&#8217;d narrate at a whiteboard. Free readers get the full walkthrough up to the deep-dive parts. Paid members get the &#128274; sections.</p><ul><li><p>Initial Thoughts &amp; Clarifying Questions</p></li><li><p>Functional Requirements</p></li><li><p>Non-Functional Requirements</p></li><li><p>Back-of-the-envelope Estimations</p></li><li><p>&#128274; System Design (the architecture I&#8217;d draw and the excalidraw link for it!)</p></li><li><p>&#128274; Component Breakdown (why each piece exists + alternatives)</p></li><li><p>&#128274; Trade-offs Made</p></li><li><p>&#128274; Security &amp; Privacy</p></li><li><p>&#128274; Monitoring, Logging, and Alerting</p></li><li><p>&#128274; Final Thoughts</p></li></ul><blockquote><p>Quick note: If you&#8217;ve been getting value from these and want the full deep dives, becoming a paid member helps me keep writing&#8212;and you&#8217;ll immediately unlock the &#128274; sections above, plus a few extras I lean on when I practice.</p></blockquote><p><strong>Members also get</strong></p><ul><li><p><strong>12 Back-of-the-Envelope Calculations Every Engineer Should Know</strong></p></li><li><p><strong>My Excalidraw System Design Template</strong> &#8212; drop-in canvas you can copy and tweak.</p></li><li><p><strong>My System Design Component Library</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.systemdesignbutsimple.com/subscribe?"><span>Subscribe now</span></a></p><p>Let&#8217;s get to it!</p><div><hr></div><h2>Initial Thoughts &amp; Clarifying Questions</h2><p>To begin, I&#8217;d want to understand the scope and constraints we&#8217;re working with here. LeetCode is actually a more manageable system than many interview questions since it&#8217;s not dealing with billions of users, but it has some unique challenges around code execution that make it interesting.</p><p>Let me ask a few clarifying questions:</p><p><strong>What&#8217;s our user scale?</strong> I&#8217;d assume we&#8217;re looking at roughly 500,000 registered users with maybe 50,000 daily active users during normal periods, but potentially 100,000 concurrent users during major competitions. This is based on LeetCode&#8217;s actual scale being relatively modest compared to social media platforms.</p><p><strong>What types of problems are we supporting?</strong> I&#8217;m thinking we need to handle algorithmic problems with various input types - arrays, trees, graphs, etc. We probably have around 4,000 problems total, which is manageable from a data storage perspective.</p><p><strong>What&#8217;s our competition model?</strong> I&#8217;d assume competitions run for about 90 minutes, feature 10 problems, and need real-time leaderboards. Scoring would be based on number of problems solved, with time as a tiebreaker.</p><p><strong>What programming languages do we need to support?</strong> I&#8217;d expect at least Python, Java, C++, JavaScript, and maybe Go, Rust, and a few others. Each language needs proper execution environments.</p><p><strong>What&#8217;s our performance expectation for code execution?</strong> I&#8217;d target sub-5 second response times for code submissions, including compilation, execution against test cases, and result generation.</p><p><strong>How real-time does the leaderboard need to be?</strong> I&#8217;m thinking 5-10 second latency is acceptable - users don&#8217;t need instant updates, but they want to see their ranking relatively quickly during competitions.</p><h2>Functional Requirements</h2><p>From what I understand, the core requirements are:</p><ol><li><p><strong>Problem browsing and viewing</strong> - Users need to see a paginated list of problems and view individual problem statements with code stubs in their preferred language</p></li><li><p><strong>Code submission and execution</strong> - Users submit solutions that get executed against hidden test cases with pass/fail feedback</p></li><li><p><strong>Competition leaderboards</strong> - Real-time ranking during timed competitions based on problems solved and completion time</p></li><li><p><strong>Multi-language support</strong> - Same logical problem should work across different programming languages</p></li></ol><p>I&#8217;m deliberately keeping user authentication, profiles, and payment processing out of scope since those are standard components that don&#8217;t add much to the interesting system design aspects.</p><h2>Non-Functional Requirements</h2><p>I&#8217;d expect this system to handle:</p><p><strong>Availability over consistency</strong> - It&#8217;s better to show slightly stale leaderboard data than to have the system go down. Users can tolerate eventual consistency for rankings.</p><p><strong>Secure code execution</strong> - This is critical since we&#8217;re running arbitrary user code. We need complete isolation to prevent malicious code from affecting our infrastructure.</p><p><strong>Sub-5 second submission feedback</strong> - Users expect quick feedback on their solutions.</p><p><strong>Competition scale of 100,000 concurrent users</strong> - During major contests, we need to handle significant traffic spikes without degrading performance.</p><p><strong>High availability during competitions</strong> - A system outage during a major competition would be catastrophic.</p><h2>Back-of-the-envelope Estimations</h2><p>Let&#8217;s walk through the numbers to understand our scale:</p><p><strong>Daily active users</strong>: 50,000 normal days, 100,000 during competitions</p><p><strong>Submission patterns</strong>: Let&#8217;s say each active user makes 20 submissions per day on average. During competitions, this could spike to 50 submissions per user over 90 minutes.</p><ul><li><p>Normal day: 50,000 &#215; 20 = 1M submissions/day = ~12 submissions/second</p></li><li><p>Competition spike: 100,000 &#215; 50 = 5M submissions over 90 minutes = ~925 submissions/second</p></li></ul><p><strong>Read traffic for problems</strong>: Users browse problems frequently. Maybe 10 problem views per active user per day.</p><ul><li><p>Normal: 50,000 &#215; 10 = 500K problem views/day = ~6 views/second</p></li><li><p>Competition: Could be 2-3x higher as users read competition problems</p></li></ul><p><strong>Leaderboard requests</strong>: During competitions, all active users check leaderboard every 30 seconds.</p><ul><li><p>Competition: 100,000 users &#215; 2 requests/minute = ~3,300 requests/second for leaderboard</p></li></ul><p><strong>Storage requirements</strong>:</p><ul><li><p>4,000 problems &#215; 50KB average (including all language stubs, test cases) = 200MB for problems</p></li><li><p>1M submissions/day &#215; 5KB average = 5GB/day submission data</p></li><li><p>Over 5 years: ~9TB total storage (very manageable)</p></li></ul><p><strong>Bandwidth estimates</strong>:</p><ul><li><p>Code submissions: 925 peak submissions/second &#215; 5KB = ~4.6MB/second upload</p></li><li><p>Leaderboard responses: 3,300 requests/second &#215; 2KB = ~6.6MB/second download</p></li><li><p>Problem content: 6 views/second &#215; 50KB = 300KB/second</p></li></ul><p>The numbers show this is actually a quite manageable system from a scale perspective, but the complexity comes from the secure code execution requirements.</p><h2>&#128274; System Design</h2><p>Here&#8217;s how I&#8217;d think about the system design:</p>
      <p>
          <a href="https://www.systemdesignbutsimple.com/p/design-leetcode">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Get 10 free Notion Templates for Engineering Managers]]></title><description><![CDATA[Plus: weekly lessons to help you grow from engineer to a great leader.]]></description><link>https://www.systemdesignbutsimple.com/p/get-10-free-notion-templates-for-engineering-managers</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/get-10-free-notion-templates-for-engineering-managers</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Sun, 12 Oct 2025 18:14:30 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/fdc33630-f4b2-4e71-bbe7-85f1b9ab1838_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You know I love breaking down how great systems are built.</p><p>For most of the past decade, I&#8217;ve been focused on something just as hard &#8212; <strong>how great teams are built</strong>.</p><p>That&#8217;s why I write a second newsletter.</p><div class="embedded-publication-wrap" data-attrs="{&quot;id&quot;:3066820,&quot;name&quot;:&quot;Blog for Engineering Managers&quot;,&quot;logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!JYzs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb5762ee-4fb2-4d62-a921-bfc9caa1b5c0_256x256.png&quot;,&quot;base_url&quot;:&quot;https://www.blog4ems.com&quot;,&quot;hero_text&quot;:&quot;Get 50+ EM Notion templates ($79), The Engineering Manager's Field Guide ($29), and all the posts when you subscribe.&quot;,&quot;author_name&quot;:&quot;Stephane Moreau&quot;,&quot;show_subscribe&quot;:true,&quot;logo_bg_color&quot;:&quot;#ffffff&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPublicationToDOMWithSubscribe"><div class="embedded-publication show-subscribe"><a class="embedded-publication-link-part" native="true" href="https://www.blog4ems.com?utm_source=substack&amp;utm_campaign=publication_embed&amp;utm_medium=web"><img class="embedded-publication-logo" src="https://substackcdn.com/image/fetch/$s_!JYzs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb5762ee-4fb2-4d62-a921-bfc9caa1b5c0_256x256.png" width="56" height="56" style="background-color: rgb(255, 255, 255);"><span class="embedded-publication-name">Blog for Engineering Managers</span><div class="embedded-publication-hero-text">Get 50+ EM Notion templates ($79), The Engineering Manager's Field Guide ($29), and all the posts when you subscribe.</div><div class="embedded-publication-author-name">By Stephane Moreau</div></a><form class="embedded-publication-subscribe" method="GET" action="https://www.blog4ems.com/subscribe?"><input type="hidden" name="source" value="publication-embed"><input type="hidden" name="autoSubmit" value="true"><input type="email" class="email-input" name="email" placeholder="Type your email..."><input type="submit" class="button primary" value="Subscribe"></form></div></div><p>It&#8217;s for senior engineers, tech leads, and EMs who want to grow as leaders.<br>Each week, I share honest lessons on communication, trust, feedback, and team design, based on my experience, successes (and mistakes).</p><p>And to help you get started, you&#8217;ll get <strong>10 free Notion templates</strong> I use for:</p><ul><li><p>1:1s that actually help people grow</p></li><li><p>Clear performance reviews</p></li><li><p>Tracking team health and delivery</p></li></ul><p>If you&#8217;re ready to go from <strong>engineer to confident leader</strong>, you can join here</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.blog4ems.com/subscribe&quot;,&quot;text&quot;:&quot;Join Blog for Engineering Managers&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.blog4ems.com/subscribe"><span>Join Blog for Engineering Managers</span></a></p><p>You&#8217;ll get 10 templates right away for free + two issues every week.</p><p>See you there,<br>Stephane</p>]]></content:encoded></item><item><title><![CDATA[Design Instagram]]></title><description><![CDATA[Like you should in an interview. Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/design-instagram</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/design-instagram</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 06 Oct 2025 11:12:31 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/dafa1fcd-0015-459f-8d79-a1646b4324b6_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this issue, I walk through the exact thinking I&#8217;d use in a system design interview out loud, step by step. Clear, practical, and including trade-offs you can defend.</p><p><strong>What you&#8217;ll learn in ~15 minutes</strong></p><ul><li><p>How I would scope the problem without missing important requirements (custom aliases, expirations, availability).</p></li><li><p><strong>Why the &#8220;obvious&#8221; feed generation approach fails at scale and how Instagram&#8217;s hybrid fanout strategy solves the celebrity problem while keeping 99% of users happy.</strong></p></li><li><p><strong>The media upload architecture that handles 4GB videos by never touching your application servers.</strong></p></li></ul><p><strong>How this issue is structured</strong><br>I split the write-up into the same sections I&#8217;d narrate at a whiteboard. Free readers get the full walkthrough up to the deep-dive parts. Paid members get the &#128274; sections.</p><ul><li><p>Initial Thoughts &amp; Clarifying Questions</p></li><li><p>Functional Requirements</p></li><li><p>Non-Functional Requirements</p></li><li><p>Back-of-the-envelope Estimations</p></li><li><p>&#128274; System Design (the architecture I&#8217;d draw and the excalidraw link for it!)</p></li><li><p>&#128274; Component Breakdown (why each piece exists + alternatives)</p></li><li><p>&#128274; Trade-offs Made</p></li><li><p>&#128274; Security &amp; Privacy</p></li><li><p>&#128274; Monitoring, Logging, and Alerting</p></li><li><p>&#128274; Final Thoughts</p></li></ul><blockquote><p>Quick note: If you&#8217;ve been getting value from these and want the full deep dives, becoming a paid member helps me keep writing&#8212;and you&#8217;ll immediately unlock the &#128274; sections above, plus a few extras I lean on when I practice.</p></blockquote><p><strong>Members also get</strong></p><ul><li><p><strong>12 Back-of-the-Envelope Calculations Every Engineer Should Know</strong></p></li><li><p><strong>My Excalidraw System Design Template</strong> &#8212; drop-in canvas you can copy and tweak.</p></li><li><p><strong>My System Design Component Library</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.systemdesignbutsimple.com/subscribe?"><span>Subscribe now</span></a></p><p>Let&#8217;s get to it!</p><div><hr></div><h3>Initial Thoughts &amp; Clarifying Questions</h3><p>To begin, I&#8217;d want to understand the scope and scale we&#8217;re targeting before diving into the technical design. Let me ask some key questions:</p><p><strong>What&#8217;s our scale target?</strong> I&#8217;m assuming we&#8217;re looking at around 500M daily active users with roughly 100M posts created per day. This gives us a sense of the read-heavy nature of the system.</p><p><strong>What types of media are we supporting?</strong> I&#8217;ll assume we need to handle both photos (up to 8MB) and videos (up to 4GB).</p><p><strong>What&#8217;s our latency expectation?</strong> For a social media platform, I&#8217;d expect feed loading to be under 500ms end-to-end, and media should render almost instantly once requested.</p><p><strong>Are we building a global service?</strong> I&#8217;ll assume yes, which means we need to think about geographic distribution and CDN placement.</p><p><strong>What&#8217;s our consistency model?</strong> For social media, I&#8217;m assuming eventual consistency is acceptable - it&#8217;s fine if a new post takes up to 2 minutes to appear in all followers&#8217; feeds.</p><p><strong>How many people does an average user follow?</strong> This is crucial for feed generation strategy. I&#8217;ll assume most users follow 100-500 accounts, but we need to handle edge cases of users following 10,000+ accounts.</p><p><strong>What&#8217;s our read-to-write ratio?</strong> Social platforms are heavily read-skewed. I&#8217;d estimate each user views 100+ posts for every 1 post they create, which will heavily influence our caching and data distribution strategies.</p><h3>Functional Requirements</h3><p>From what I understand, the core requirements are:</p><p><strong>Post Creation</strong>: Users must be able to upload photos and videos with captions. This needs to handle large files efficiently and provide immediate feedback to users about upload progress.</p><p><strong>Social Graph Management</strong>: Users need to follow and unfollow other users. This creates a unidirectional relationship that drives our entire feed generation strategy.</p><p><strong>Feed Generation</strong>: Users should see a chronological timeline of posts from accounts they follow. This is the most technically challenging requirement given our scale.</p><p>These three requirements form the foundation - everything else we might add (likes, comments, stories) would build on this core architecture.</p><h3>Non-Functional Requirements</h3><p>I&#8217;d expect this system to handle several critical non-functional requirements:</p><p><strong>High Availability</strong>: We need 99.9% uptime minimum. Users expect Instagram to always be available, and downtime directly impacts user engagement and revenue.</p><p><strong>Low Latency</strong>: Feed requests should complete under 500ms, and media should start rendering immediately. Users will abandon the app if it feels slow.</p><p><strong>Massive Scale</strong>: Supporting 500M daily active users means handling potentially 100,000+ requests per second during peak hours. Our architecture needs to scale horizontally.</p><p><strong>Global Distribution</strong>: Users worldwide should have similar performance, requiring strategic CDN placement and potentially regional data centers.</p><p><strong>Eventual Consistency</strong>: It&#8217;s acceptable for new posts to take 1-2 minutes to appear in all followers&#8217; feeds, allowing us to optimize for performance over strict consistency.</p><h3>Back-of-the-envelope Estimations</h3><p>Let&#8217;s work through the numbers to understand what we&#8217;re dealing with:</p><p><strong>User Activity</strong>: With 500M daily active users, if each user checks their feed 10 times per day, that&#8217;s 5 billion feed requests daily. During peak hours (let&#8217;s say 8 hours), that&#8217;s roughly 175,000 feed requests per second.</p><p><strong>Content Creation</strong>: 100M posts per day means about 1,200 posts per second on average, with peaks potentially 3-5x higher during major events or peak social hours.</p><p><strong>Storage Requirements</strong>:</p><ul><li><p>If average media size is 2MB per post: 100M posts &#215; 2MB = 200TB of new media daily</p></li><li><p>Metadata per post (user ID, timestamp, caption, media reference): roughly 1KB &#215; 100M = 100GB daily</p></li><li><p>Over 10 years: ~750PB of media storage needed</p></li></ul><p><strong>Read/Write Patterns</strong>:</p><ul><li><p>Read QPS: ~175,000 feed requests/second + media requests (potentially 10x higher)</p></li><li><p>Write QPS: ~1,200 posts/second + follow operations</p></li><li><p>This confirms we&#8217;re dealing with a heavily read-skewed system</p></li></ul><p><strong>Memory Requirements</strong>: For feed caching, if we cache the last 100 posts for each active user&#8217;s feed (assuming 1KB per post summary), that&#8217;s 500M users &#215; 100 posts &#215; 1KB = 50TB of feed cache. This is manageable with distributed caching.</p><p><strong>Bandwidth</strong>: During peak viewing, if 100M users are simultaneously viewing media averaging 2MB each, that&#8217;s 200TB/hour of bandwidth. This absolutely requires CDN distribution.</p><h3>&#128274; System Design</h3><p>This is the design I am thinking of:</p>
      <p>
          <a href="https://www.systemdesignbutsimple.com/p/design-instagram">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Design FB Live Comments]]></title><description><![CDATA[Like you should in an interview. Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/design-fb-live-comments</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/design-fb-live-comments</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 29 Sep 2025 11:12:41 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b85122f3-acdf-48b3-8996-e324bdd4eed9_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this issue, I walk through the exact thinking I&#8217;d use in a system design interview out loud, step by step. Clear, practical, and including trade-offs you can defend.</p><p><strong>What you&#8217;ll learn in ~15 minutes</strong></p><ul><li><p>How I would scope the problem without missing important requirements (custom aliases, expirations, availability).</p></li><li><p><strong>Why Server-Sent Events are better than WebSockets for one-way real-time updates and how to implement SSE at Facebook scale</strong></p></li><li><p><strong>The pub-sub architecture pattern that enables millions of concurrent viewers without overwhelming your database</strong></p></li><li><p><strong>How cursor-based pagination outperforms offset pagination for infinite scroll in high-volume comment streams</strong></p></li></ul><p><strong>How this issue is structured</strong><br>I split the write-up into the same sections I&#8217;d narrate at a whiteboard. Free readers get the full walkthrough up to the deep-dive parts. Paid members get the &#128274; sections.</p><ul><li><p>Initial Thoughts &amp; Clarifying Questions</p></li><li><p>Functional Requirements</p></li><li><p>Non-Functional Requirements</p></li><li><p>Back-of-the-envelope Estimations</p></li><li><p>&#128274; System Design (the architecture I&#8217;d draw and the excalidraw link for it!)</p></li><li><p>&#128274; Component Breakdown (why each piece exists + alternatives)</p></li><li><p>&#128274; Trade-offs Made</p></li><li><p>&#128274; Security &amp; Privacy</p></li><li><p>&#128274; Monitoring, Logging, and Alerting</p></li><li><p>&#128274; Final Thoughts</p></li></ul><blockquote><p>Quick note: If you&#8217;ve been getting value from these and want the full deep dives, becoming a paid member helps me keep writing&#8212;and you&#8217;ll immediately unlock the &#128274; sections above, plus a few extras I lean on when I practice.</p></blockquote><p><strong>Members also get</strong></p><ul><li><p><strong>12 Back-of-the-Envelope Calculations Every Engineer Should Know</strong></p></li><li><p><strong>My Excalidraw System Design Template</strong> &#8212; drop-in canvas you can copy and tweak.</p></li><li><p><strong>My System Design Component Library</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.systemdesignbutsimple.com/subscribe?"><span>Subscribe now</span></a></p><p>Let&#8217;s get to it!</p><div><hr></div><h3>Initial Thoughts &amp; Clarifying Questions</h3><p>To begin, I&#8217;d want to understand the scope and constraints better before jumping into the design. Here are the key questions I&#8217;d ask the interviewer:</p><p><strong>&#8220;What&#8217;s the expected scale we&#8217;re designing for?&#8221;</strong> - I&#8217;m assuming we need to handle millions of concurrent videos with thousands of comments per second per video. This tells me we&#8217;re designing for massive scale.</p><p><strong>&#8220;How real-time do the comments need to be?&#8221;</strong> - I assume sub-200ms latency, which means we&#8217;re talking about truly real-time communication, not just &#8220;fast enough&#8221;.</p><p><strong>&#8220;Do we need to handle comment moderation or spam filtering?&#8221;</strong> - I&#8217;ll assume this is out of scope for now, but it&#8217;s good to acknowledge that production systems would need robust content filtering.</p><p><strong>&#8220;What about comment persistence - how long should we store comments?&#8221;</strong> - I&#8217;m assuming we need to store comments indefinitely for historical viewing, which impacts our storage design significantly.</p><p><strong>&#8220;Do we need to support features like reactions, replies, or threading?&#8221;</strong> - I&#8217;ll assume these are out of scope to keep the core problem manageable, though I&#8217;d mention them as potential extensions.</p><p><strong>&#8220;What platforms need to be supported?&#8221;</strong> - I&#8217;m assuming web and mobile clients, both of which can handle persistent connections reasonably well.</p><h3>Functional Requirements</h3><p>From what I understand, the core requirements are prioritized as follows:</p><p><strong>Primary Requirements:</strong></p><ul><li><p>Users can post comments on live video feeds with immediate persistence</p></li><li><p>Viewers see new comments in real-time as they&#8217;re posted by others</p></li><li><p>Users can view historical comments when joining a live stream</p></li><li><p>Comments must be displayed in chronological order with proper pagination</p></li></ul><p><strong>Secondary Requirements:</strong></p><ul><li><p>Users can scroll through comment history (infinite scroll pattern)</p></li><li><p>The system gracefully handles user connections and disconnections</p></li><li><p>Comments remain associated with the correct live video stream</p></li></ul><p>We&#8217;re building both a real-time messaging system and a persistent chat history system. The real-time aspect is what makes this challenging at scale.</p><h3>Non-Functional Requirements</h3><p>I&#8217;d expect this system to handle some serious performance and scale requirements:</p><p><strong>Scale Expectations:</strong></p><ul><li><p>Support millions of concurrent live videos simultaneously</p></li><li><p>Handle thousands of comments per second per popular live video</p></li><li><p>Accommodate millions of concurrent viewers across all streams</p></li></ul><p><strong>Performance Requirements:</strong></p><ul><li><p>Sub-200ms end-to-end latency for comment delivery</p></li><li><p>High availability with minimal downtime (99.9%+ uptime)</p></li><li><p>Eventual consistency is acceptable - comments don&#8217;t need to appear in exactly the same order for all users immediately</p></li></ul><p><strong>User Experience:</strong></p><ul><li><p>Seamless real-time experience that feels instantaneous</p></li><li><p>Reliable comment delivery without missing messages</p></li><li><p>Smooth infinite scrolling for historical comments</p></li><li><p>Graceful degradation when network conditions are poor</p></li></ul><p>The 200ms latency requirement is particularly important because that&#8217;s the threshold where humans perceive interactions as real-time versus delayed.</p><h3>Back-of-the-envelope Estimations</h3><p>Let&#8217;s work through the numbers to understand what we&#8217;re dealing with:</p><p><strong>User Activity Assumptions:</strong></p><ul><li><p>10 million daily active users watching live videos</p></li><li><p>Peak concurrent users: ~2 million (20% of DAU)</p></li><li><p>Average of 1,000 concurrent live videos during peak</p></li><li><p>Popular videos might have 100,000+ concurrent viewers</p></li></ul><p><strong>Comment Volume Calculations:</strong></p><ul><li><p>Average user posts 5 comments per session</p></li><li><p>Active commenting users: ~20% of viewers</p></li><li><p>For a popular video with 100K viewers: 20K active commenters</p></li><li><p>If each commenter posts once every 2 minutes: ~167 comments/second per popular video</p></li><li><p>Across 1,000 concurrent videos: ~167,000 comments/second system-wide</p></li></ul><p><strong>Storage Requirements:</strong></p><ul><li><p>Average comment size: ~100 bytes (including metadata)</p></li><li><p>Daily comments: 10M users &#215; 5 comments = 50M comments</p></li><li><p>Daily storage: 50M &#215; 100 bytes = 5GB per day</p></li><li><p>Annual storage: ~1.8TB (manageable, but we&#8217;ll want compression and archiving)</p></li></ul><p><strong>Bandwidth Estimates:</strong></p><ul><li><p>Each comment needs to be delivered to all viewers of that video</p></li><li><p>Popular video with 100K viewers receiving 167 comments/second</p></li><li><p>Outbound traffic per video: 167 &#215; 100 bytes &#215; 100K viewers = 1.67GB/second</p></li><li><p>This shows why we need efficient distribution mechanisms</p></li></ul><p><strong>Connection Requirements:</strong></p><ul><li><p>2 million concurrent SSE connections during peak</p></li><li><p>If each server handles 50K connections: need ~40 servers minimum</p></li><li><p>With redundancy and load distribution: ~100+ servers for connection handling</p></li></ul><p>These numbers confirm we need a distributed architecture with efficient real-time communication.</p><h3>&#128274; System Design</h3><p>This is the simple design I would draw:</p>
      <p>
          <a href="https://www.systemdesignbutsimple.com/p/design-fb-live-comments">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Design WhatsApp]]></title><description><![CDATA[Like you should in an interview. Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/design-whatsapp</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/design-whatsapp</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 22 Sep 2025 11:12:15 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/68754b24-afbe-477f-919b-70757aeb31e2_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this issue, I walk through the exact thinking I&#8217;d use in a system design interview out loud, step by step. Clear, practical, and including trade-offs you can defend.</p><p><strong>What you&#8217;ll learn in ~15 minutes</strong></p><ul><li><p>How I would scope the problem without missing important requirements</p></li><li><p>Why Layer 4 load balancers are critical for WebSocket scaling</p></li><li><p>The inbox table pattern for guaranteed message delivery (how to handle offline users without complex queuing systems)</p></li><li><p>When Redis Pub/Sub outperforms Kafka for messaging</p></li></ul><p><strong>How this issue is structured</strong><br>I split the write-up into the same sections I&#8217;d narrate at a whiteboard. Free readers get the full walkthrough up to the deep-dive parts. Paid members get the &#128274; sections.</p><ul><li><p>Initial Thoughts &amp; Clarifying Questions</p></li><li><p>Functional Requirements</p></li><li><p>Non-Functional Requirements</p></li><li><p>Back-of-the-envelope Estimations (QPS, storage, bandwidth, cardinality math)</p></li><li><p>&#128274; System Design (the architecture I&#8217;d draw and the excalidraw link for it!)</p></li><li><p>&#128274; Component Breakdown (why each piece exists + alternatives)</p></li><li><p>&#128274; Trade-offs Made</p></li><li><p>&#128274; Security &amp; Privacy</p></li><li><p>&#128274; Monitoring, Logging, and Alerting</p></li><li><p>&#128274; Extensions &amp; Advanced Considerations</p></li></ul><blockquote><p>Quick note: If you&#8217;ve been getting value from these and want the full deep dives, becoming a paid member helps me keep writing&#8212;and you&#8217;ll immediately unlock the &#128274; sections above, plus a few extras I lean on when I practice.</p></blockquote><p><strong>Members also get</strong></p><ul><li><p><strong>12 Back-of-the-Envelope Calculations Every Engineer Should Know</strong></p></li><li><p><strong>My Excalidraw System Design Template</strong> &#8212; drop-in canvas you can copy and tweak.</p></li><li><p><strong>My System Design Component Library</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.systemdesignbutsimple.com/subscribe?"><span>Subscribe now</span></a></p><p>Let&#8217;s get to it!</p><div><hr></div><h3><strong>Initial Thoughts &amp; Clarifying Questions</strong></h3><p>To begin, I'd want to understand the specific scope and constraints of this messaging system. Let me ask some clarifying questions to nail down the requirements:</p><p><strong>Q: Are we focusing on one-to-one messaging, group chats, or both?</strong> I'm assuming we need to support both, with group chats being a generalization where a "group of two" represents one-to-one messaging. This simplifies our data model.</p><p><strong>Q: What types of media should we support beyond text messages?</strong> I'll assume we need to handle images, videos, and file attachments - essentially any media type that users commonly share. This will significantly impact our storage and bandwidth considerations.</p><p><strong>Q: Should we support real-time features like typing indicators, read receipts, or online presence?</strong> For the core design, I'm focusing on message delivery, but I'll mention how we could extend this for presence indicators later since it's a common follow-up question.</p><p><strong>Q: What's our expected scale in terms of users and messages?</strong> Given that WhatsApp serves billions of users, I'm targeting a system that can handle billions of users sending hundreds of billions of messages daily.</p><p><strong>Q: Do we need to support multiple devices per user?</strong> Initially, I'll design for one device per user to keep things simple, then show how to extend for multiple devices since that's realistic for modern messaging apps.</p><p><strong>Q: What are our consistency requirements - do messages need to be delivered in order?</strong> I'm assuming eventual consistency is acceptable, but messages within a chat should maintain order.</p><p><strong>Q: Any specific privacy or data retention requirements?</strong> Following WhatsApp's model, I'll design for minimal data retention - messages should be deleted from servers once delivered to maintain privacy.</p><h3><strong>Functional Requirements</strong></h3><p>From what I understand, the core requirements are:</p><ol><li><p><strong>Create and manage group chats</strong> - Users can start conversations with individuals or groups</p></li><li><p><strong>Send and receive text messages</strong> - Real-time bidirectional messaging between participants</p></li><li><p><strong>Send and receive media attachments</strong> - Support for images, videos, and files</p></li><li><p><strong>Access messages after being offline</strong> - Message persistence and delivery to disconnected clients</p></li><li><p><strong>Message delivery guarantees</strong> - Ensure messages reach their intended recipients</p></li></ol><p>These requirements form the foundation of our system. Each one builds on the previous, creating natural stepping stones for our design evolution.</p><h3><strong>Non-Functional Requirements</strong></h3><p>I'd expect this system to handle several critical performance and operational characteristics:</p><p><strong>Latency</strong>: We'd likely need sub-500ms message delivery for users who are online. This feels natural - anything slower would make conversations feel sluggish, but the difference between 100ms and 500ms isn't particularly noticeable to users.</p><p><strong>Reliability</strong>: Message delivery must be guaranteed. It would be unacceptable for messages to simply disappear.</p><p><strong>Scale</strong>: Supporting billions of users sending hundreds of messages per day. The math here gets interesting when we calculate the actual throughput requirements.</p><p><strong>Privacy</strong>: Following WhatsApp's philosophy, we should minimize data retention. Messages should be deleted from servers after successful delivery.</p><p><strong>Availability</strong>: This is a global system that needs to tolerate individual component failures without taking down the entire service. We can't have single points of failure.</p><h3><strong>Back-of-the-envelope Estimations</strong></h3><p>Let's say we have 2 billion daily active users... If each user sends 50 messages per day on average, that gives us 100 billion messages daily.</p><p><strong>QPS Calculations:</strong></p><ul><li><p>Daily messages: 2B users &#215; 50 messages = 100B messages/day</p></li><li><p>Messages per second: 100B / (24 &#215; 3600) &#8776; 1.16M messages/sec</p></li><li><p>Read QPS: Assuming each message is read by 2.5 recipients on average = 2.9M reads/sec</p></li><li><p>Peak load (3x average): 3.5M writes/sec, 8.7M reads/sec</p></li></ul><p><strong>Storage Requirements:</strong></p><ul><li><p>Average message size: 1KB (including metadata)</p></li><li><p>Daily storage: 100B &#215; 1KB = 100TB/day</p></li><li><p>With 30-day retention: 100TB &#215; 30 = 3PB total</p></li><li><p>But most messages are delivered immediately and deleted, so steady state is probably 10-20% of this = 300-600TB</p></li></ul><p><strong>Bandwidth Estimates:</strong></p><ul><li><p>Message traffic: 1.16M/sec &#215; 1KB = 1.16 GB/sec</p></li><li><p>Media uploads (10% of messages, 100KB average): 116K/sec &#215; 100KB = 11.6 GB/sec</p></li><li><p>Total ingress: ~13 GB/sec</p></li><li><p>With replication and delivery overhead: ~40 GB/sec total bandwidth</p></li></ul><p><strong>Memory Requirements:</strong></p><ul><li><p>Active connections: Assuming 20% of users online simultaneously = 400M connections</p></li><li><p>Connection overhead: ~10KB per connection = 4TB memory for connection state</p></li><li><p>Message caching: Hot data cache of ~1 hour = 4TB</p></li><li><p>Total memory across all servers: ~8TB</p></li></ul><p>These numbers tell me we're definitely in distributed systems territory - no single machine can handle this load.</p><h3><strong>&#128274; System Design</strong></h3><p>Here&#8217;s the system design I am thinking of:</p>
      <p>
          <a href="https://www.systemdesignbutsimple.com/p/design-whatsapp">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Design Uber]]></title><description><![CDATA[Like you should in an interview. Explained as simply as possible&#8230; but not simpler.]]></description><link>https://www.systemdesignbutsimple.com/p/design-uber</link><guid isPermaLink="false">https://www.systemdesignbutsimple.com/p/design-uber</guid><dc:creator><![CDATA[Stephane Moreau]]></dc:creator><pubDate>Mon, 15 Sep 2025 11:12:25 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/dcd27208-ca27-4af8-a1ff-c6fd08b07114_2500x1406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this issue, I walk through the exact thinking I&#8217;d use in a system design interview out loud, step by step. Clear, practical, and including trade-offs you can defend.</p><p><strong>What you&#8217;ll learn in ~15 minutes</strong></p><ul><li><p>How I would scope the problem without missing important requirements (custom aliases, expirations, availability).</p></li><li><p>Geohashing and quadtrees comparison for high-frequency location updates (crucial for any proximity-based system design)</p></li><li><p>The distributed locking pattern that prevents double-booking drivers</p></li><li><p>Where to be strict about ACID properties and where eventual consistency is acceptable</p></li></ul><p><strong>How this issue is structured</strong><br>I split the write-up into the same sections I&#8217;d narrate at a whiteboard. Free readers get the full walkthrough up to the deep-dive parts. Paid members get the &#128274; sections.</p><ul><li><p>Initial Thoughts &amp; Clarifying Questions</p></li><li><p>Functional Requirements</p></li><li><p>Non-Functional Requirements</p></li><li><p>Back-of-the-envelope Estimations (QPS, storage, bandwidth, cardinality math)</p></li><li><p>&#128274; System Design (the architecture I&#8217;d draw and the excalidraw link for it!)</p></li><li><p>&#128274; Component Breakdown (why each piece exists + alternatives)</p></li><li><p>&#128274; Trade-offs Made</p></li><li><p>&#128274; Deep Dives (Location Service Architecture, Consistency in Matching)</p></li><li><p>&#128274; Security &amp; Privacy</p></li><li><p>&#128274; Monitoring, Logging, and Alerting</p></li></ul><blockquote><p>Quick note: If you&#8217;ve been getting value from these and want the full deep dives, becoming a paid member helps me keep writing&#8212;and you&#8217;ll immediately unlock the &#128274; sections above, plus a few extras I lean on when I practice.</p></blockquote><p><strong>Members also get</strong></p><ul><li><p><strong>12 Back-of-the-Envelope Calculations Every Engineer Should Know</strong></p></li><li><p><strong>My Excalidraw System Design Template</strong> &#8212; drop-in canvas you can copy and tweak.</p></li><li><p><strong>My System Design Component Library</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.systemdesignbutsimple.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.systemdesignbutsimple.com/subscribe?"><span>Subscribe now</span></a></p><p>Let&#8217;s get to it!</p><div><hr></div><h3>Initial Thoughts &amp; Clarifying Questions</h3><p>To begin, I'd want to understand the scope and constraints of what we're building here. Let me ask a few clarifying questions to make sure I'm designing the right system:</p><p><strong>What's the core functionality we need to support?</strong> I'm assuming we need ride matching between drivers and passengers, fare estimation, and real-time location tracking. Based on typical Uber usage, I'll focus on these core features.</p><p><strong>What's our scale?</strong> I'm thinking we're looking at millions of daily active users globally, with hundreds of thousands of concurrent rides during peak hours. This suggests we need a highly scalable, distributed system.</p><p><strong>What about different vehicle types?</strong> For this interview, I'll scope this down to just one vehicle type - let's say UberX - to keep things focused. We can always discuss how to extend this later.</p><p><strong>Real-time requirements?</strong> I'm assuming we need sub-minute matching times and real-time location updates. Users expect to be matched with a driver quickly, and drivers need accurate navigation.</p><p><strong>Geographic scope?</strong> I'll design for a global system with regional deployments, but focus on one region for the core design.</p><p>From what I understand, we're building a ride-sharing platform where users can request rides, get fare estimates, and be matched with nearby drivers in real-time.</p><h3>Functional Requirements</h3><p>From what I understand, the core requirements are:</p><ol><li><p><strong>Fare estimation</strong>: Users should be able to input a start location and destination and receive an estimated fare and ETA</p></li><li><p><strong>Ride requesting</strong>: Users should be able to request a ride based on an estimate and be matched with a nearby available driver in real-time</p></li><li><p><strong>Driver operations</strong>: Drivers should be able to accept/deny ride requests and navigate to pickup and drop-off locations</p></li></ol><p>I'm putting several features out of scope to stay focused: multiple car types, driver/rider ratings, scheduling rides in advance, and payment processing. These are important but secondary to the core matching functionality.</p><h3>Non-Functional Requirements</h3><p>I'd expect this system to handle several critical non-functional requirements:</p><p><strong>Low latency matching</strong>: We need to match riders with drivers in under one minute, or return a "no drivers available" message. Users won't wait around forever, and quick matching is core to the user experience.</p><p><strong>Consistency of matching</strong>: This is crucial - we need to ensure any given ride is only ever matched to one driver, and no driver gets multiple ride requests simultaneously. This is a classic consistency requirement where we can't afford duplicate bookings.</p><p><strong>High availability outside of matching</strong>: The system should be available 24/7 for fare estimates, driver location updates, and general operations. Only the actual matching process might occasionally fail due to consistency requirements.</p><p><strong>High throughput during surges</strong>: We need to handle massive spikes during big events - potentially hundreds of thousands of requests within a region in a short time window.</p><h3>Back-of-the-envelope Estimations</h3><p>Let me work through some numbers to understand the scale we're dealing with. I know that back-of-envelope calculations should only be done when they directly influence design decisions, and here they will - particularly for our location service.</p><p><strong>Active drivers and location updates</strong>: Let's say Uber has about 6 million drivers globally, with roughly 3 million active at any given time. If we update driver locations every 5 seconds (which we need for accurate matching), that's:</p><p>3 million drivers &#247; 5 seconds = <strong>600,000 location updates per second</strong></p><p>This is a massive write load that will definitely influence our database choice.</p><p><strong>Daily ride requests</strong>: With millions of daily active users, let's estimate 50 million ride requests globally per day. During peak hours (say 4 hours total), this could be 5x higher:</p><ul><li><p>Peak: ~175,000 ride requests per hour = ~50 requests per second</p></li><li><p>During major events or surges: Could spike to 10x normal = <strong>500+ requests per second</strong></p></li></ul><p><strong>Storage for ride data</strong>: Each ride record might be ~2KB (with all metadata). At 50M rides/day:</p><ul><li><p>Daily: 100 GB of new ride data</p></li><li><p>Annual: ~35 TB of ride data</p></li></ul><p><strong>Location data storage</strong>: 600K updates/second &#215; 100 bytes per update = 60 MB/second of location data. However, we only need current locations, so storage is manageable - maybe 300 MB total for 3M driver locations.</p><p>Our location service needs to handle 600K writes per second while providing sub-second proximity queries. This definitely rules out traditional relational databases and points us toward specialized solutions.</p><h3>&#128274; System Design</h3><p>Here&#8217;s the system design I am thinking of:</p>
      <p>
          <a href="https://www.systemdesignbutsimple.com/p/design-uber">
              Read more
          </a>
      </p>
   ]]></content:encoded></item></channel></rss>