<?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 From Scratch]]></title><description><![CDATA[A newsletter about building software systems with first principles.]]></description><link>https://systemdesignfromscratch.org</link><image><url>https://substackcdn.com/image/fetch/$s_!hyee!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F678b5863-6e28-4ece-85b0-5aa8fe2632cc_608x608.png</url><title>System Design From Scratch</title><link>https://systemdesignfromscratch.org</link></image><generator>Substack</generator><lastBuildDate>Tue, 08 Sep 2026 08:41:10 GMT</lastBuildDate><atom:link href="https://systemdesignfromscratch.org/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Mandeep Singh]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[msdeep14@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[msdeep14@substack.com]]></itunes:email><itunes:name><![CDATA[Mandeep Singh Shekhawat]]></itunes:name></itunes:owner><itunes:author><![CDATA[Mandeep Singh Shekhawat]]></itunes:author><googleplay:owner><![CDATA[msdeep14@substack.com]]></googleplay:owner><googleplay:email><![CDATA[msdeep14@substack.com]]></googleplay:email><googleplay:author><![CDATA[Mandeep Singh Shekhawat]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[How to System Design?]]></title><description><![CDATA[Guidelines on designing better systems]]></description><link>https://systemdesignfromscratch.org/p/how-to-system-design</link><guid isPermaLink="false">https://systemdesignfromscratch.org/p/how-to-system-design</guid><dc:creator><![CDATA[Mandeep Singh Shekhawat]]></dc:creator><pubDate>Sun, 23 Aug 2026 14:42:26 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!shNT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ea5eac-1032-4bfb-a952-596e8f514590_1168x784.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There are a lot of recommendations floating around for how to build systems. Some of the example include follow domain-driven design and build stateless application servers. No recommendation is good or bad, any every choice has a trade-offs. Today&#8217;s blog covers some of the guidelines or suggestions for designing better and useful systems. </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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">Thanks for reading System Design From Scratch! Subscribe for free to receive new posts and support my work.</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>Assume you&#8217;ve to build a payments application supporting multiple payment options such as UPI, credit card. Each of these payment option state is synced using callbacks and synchronous APIs with the payment providers.</p><h3>Guideline of Isolation: Build it Modularly</h3><p>The system should be built as modules with each module being independent on its own. This helps with maintainability and reusability of modules.</p><p>Example includes keeping independent modules for different payment methods and separate module for callback processing. You can keep the common stuff in common module which can be imported as needed.</p><h3>Guideline of Simplicity: Keep it Simple, Silly</h3><p>You should always avoid unnecessary components. Only build what&#8217;s really needed. Iterate over the implementation - always test and improve. </p><p>Examples include trying to support a lot of payment methods in the beginning or thinking of going global on day zero. This could create extra churn and gets the project delayed.</p><p><em><strong>** </strong></em>The NOTES in this blog are taken from Chapter 01 of System Design on AWS. Explore the <a href="https://msdeepsingh.com/books/system-design-on-aws/">book</a>:</p><p>&#128213; O&#8217;Reilly: https://oreil.ly/ruQbc</p><p>&#128213; Amazon.in: https://amzn.to/4jExkte</p><p>&#128213; Amazon.com: https://amzn.to/3D3BIBJ</p><h3>Guideline of Performance: Metrics Don&#8217;t Lie</h3><p>Metrics (observability) are really important. They helps in debugging as well as how well your system is doing. </p><p>Example metrics include time taken for payment processing and payment failure rates.</p><h3>Guideline of Trade-offs: There is no such thing as Free Lunch</h3><p>Every choice has trade-offs. There are pros and cons with every approach. Choose what makes sense for your business use case and to your product&#8217;s scale. Take inspiration from others but don&#8217;t follow blindly. </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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">Thanks for reading System Design From Scratch! Subscribe for free to receive new posts and support my work.</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>Example, thinking of independent micro-services from day one because you can scale them independently. Well yes, but who will manage this?</p><h3>Guideline of Use-cases: It Always Depends</h3><p>The design of system can depend on a lot of factors. Some of the factors include system requirements, user needs, expertise, budget and regulations.</p><p>Reiterating from previous point, choose what works for you. Here is summary image (generated with Grok AI)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!shNT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ea5eac-1032-4bfb-a952-596e8f514590_1168x784.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!shNT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ea5eac-1032-4bfb-a952-596e8f514590_1168x784.jpeg 424w, https://substackcdn.com/image/fetch/$s_!shNT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ea5eac-1032-4bfb-a952-596e8f514590_1168x784.jpeg 848w, https://substackcdn.com/image/fetch/$s_!shNT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ea5eac-1032-4bfb-a952-596e8f514590_1168x784.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!shNT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ea5eac-1032-4bfb-a952-596e8f514590_1168x784.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!shNT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ea5eac-1032-4bfb-a952-596e8f514590_1168x784.jpeg" width="1168" height="784" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/45ea5eac-1032-4bfb-a952-596e8f514590_1168x784.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:784,&quot;width&quot;:1168,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:311790,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdesignfromscratch.org/i/212412647?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ea5eac-1032-4bfb-a952-596e8f514590_1168x784.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!shNT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ea5eac-1032-4bfb-a952-596e8f514590_1168x784.jpeg 424w, https://substackcdn.com/image/fetch/$s_!shNT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ea5eac-1032-4bfb-a952-596e8f514590_1168x784.jpeg 848w, https://substackcdn.com/image/fetch/$s_!shNT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ea5eac-1032-4bfb-a952-596e8f514590_1168x784.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!shNT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ea5eac-1032-4bfb-a952-596e8f514590_1168x784.jpeg 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 aria-hidden="true" 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><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>Happy Building!</strong></p>]]></content:encoded></item><item><title><![CDATA[Compute? Virtual Machines or Containers or Serverless Functions]]></title><description><![CDATA[Choosing compute is hard choice, let's try to simplify.]]></description><link>https://systemdesignfromscratch.org/p/compute-virtual-machines-or-containers</link><guid isPermaLink="false">https://systemdesignfromscratch.org/p/compute-virtual-machines-or-containers</guid><dc:creator><![CDATA[Mandeep Singh Shekhawat]]></dc:creator><pubDate>Sun, 16 Aug 2026 10:31:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!oXbw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a05e01c-d521-46b4-af3d-476c11e21c80_826x530.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The word<strong><span data-color="#741b47" style="color: rgb(116, 27, 71);"> </span><span data-color="rgb(230, 0, 14)" style="color: rgb(230, 0, 14);">Compute</span> </strong>basically means where the application is deployed and running. This could be your personal computer, serverless functions (e.g. AWS Lambda), virtual machines (e.g. Amazon EC2) or container services (e.g. AWS ECS/EKS).</p><h2>General Thoughts on Compute Selection</h2><ul><li><p>If you&#8217;re working in a company, the selection of compute is generally influence by what&#8217;s being already being used in other projects/services. This is because the team already has experience managing certain technology. Introducing new services brings in learning curve and extra operational burden.</p></li><li><p>For reference, the comparison of services is corresponding to AWS cloud but they hold across the cloud providers.</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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">Thanks for reading System Design From Scratch! Subscribe for free to receive new posts and support my work.</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>Let&#8217;s start the discussion, starting with virtual machines.</p><h2>Elastic Compute Cloud (EC2)</h2><p>There are two options with Amazon EC2. A shared tenancy or dedicated tenancy. The idea is you wish to buy the entire physical server or just a part of it. Most of needs are served with shared tenancy, don&#8217;t worry the customers workloads are properly isolated.</p><p>Once you decided on the tenancy (default is shared), the second choice you&#8217;ve to make is instance type. This depends on a variety of factors such as:</p><ul><li><p>Hardware and performance characteristics of an instance such as CPU, disk, memory and network.</p></li><li><p>Type of workloads such as huge AI training workflows vs running a web application.</p></li></ul><p>The third selection choice you&#8217;ve to make is billing model. There are three types, reserved, on-demand and spot instances. The default selection is an on-demand instance.</p><ul><li><p>Reserved: If you&#8217;re aware of scaling needs, you can pre-order the number of instances needed. The reserved instances are available at a discounted price.</p></li><li><p>On-Demand: You spawn the instances when needed and terminate once done. This is default pricing model. </p></li><li><p>Spot: For less critical workloads where uptime is not a hard requirement, spot instances could be chosen. You can bring up an instance but AWS can terminate it at anytime they wish.</p></li></ul><p>The content of this blog is influenced by <strong>Chapter 11</strong> of O&#8217;Reilly book <strong>System Design on AWS</strong>. Checkout the book at <a href="https://msdeepsingh.com/books/system-design-on-aws/">https://msdeepsingh.com/books/system-design-on-aws/</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!31Wh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc654fec-b99b-4a1d-99be-66ff5cd59226_1584x396.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!31Wh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc654fec-b99b-4a1d-99be-66ff5cd59226_1584x396.png 424w, https://substackcdn.com/image/fetch/$s_!31Wh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc654fec-b99b-4a1d-99be-66ff5cd59226_1584x396.png 848w, https://substackcdn.com/image/fetch/$s_!31Wh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc654fec-b99b-4a1d-99be-66ff5cd59226_1584x396.png 1272w, https://substackcdn.com/image/fetch/$s_!31Wh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc654fec-b99b-4a1d-99be-66ff5cd59226_1584x396.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!31Wh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc654fec-b99b-4a1d-99be-66ff5cd59226_1584x396.png" width="1456" height="364" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc654fec-b99b-4a1d-99be-66ff5cd59226_1584x396.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:364,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1102236,&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://systemdesignfromscratch.org/i/211293645?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc654fec-b99b-4a1d-99be-66ff5cd59226_1584x396.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_!31Wh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc654fec-b99b-4a1d-99be-66ff5cd59226_1584x396.png 424w, https://substackcdn.com/image/fetch/$s_!31Wh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc654fec-b99b-4a1d-99be-66ff5cd59226_1584x396.png 848w, https://substackcdn.com/image/fetch/$s_!31Wh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc654fec-b99b-4a1d-99be-66ff5cd59226_1584x396.png 1272w, https://substackcdn.com/image/fetch/$s_!31Wh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc654fec-b99b-4a1d-99be-66ff5cd59226_1584x396.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Let&#8217;s move to second compute option, containers.</p><h2>Containerisation Services</h2><p>The major problem that occurs in development is &#8220;it works on my machine&#8221;. The development environment could vary from engineer to engineer, from local setup to production environment and so on. This problem is solved via containers.</p><p>Another problem addressed via containers is optimising the resource usage on EC2 machines.</p><p>You package the application binary with all the dependencies and the same container can run on any machine. You can deploy these container images and manage them on your own but it&#8217;s hard job. So there are multiple orchestration tools built on top to manages the containers at scale, such as Kubernetes.</p><p>AWS offers two container orchestration services, namely Elastic Container Service (ECS) and Elastic Kubernetes Service (EKS).</p><p>Both of these services comes with two forms of deployment, either we can choose to deploy via EC2 or let AWS manage everything behind the scenes (serverless), called as Fargate. Let&#8217;s move on to next choice, Function-as-a-Service.</p><h2>Serverless Functions</h2><p>You just write functions and don&#8217;t worry about underlying infrastructure at all, everything is managed by the cloud provider. For example, AWS Lambda.</p><p>The code you write in functions can be invoked with the help of a trigger. For example, whenever there is new object uploaded to S3 bucket, read the object and perform some analysis.</p><h2>Decision Framework</h2><p>From earlier blog on this newsletter on choosing a database, the factors are applicable for compute selection as well.</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;046c466c-2dbc-4546-a0d3-d4c9df7e9df0&quot;,&quot;caption&quot;:&quot;Which database is the right choice for my use case? This is very common question that&#8217;s brought up for System Design interviews as well as while actually building systems. The decision depends on lot of factors, let&#8217;s discuss a very high level view.Thanks for reading The Scalability Times! Subscribe for free to receive new posts and support my work.&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;showDescription&quot;:true,&quot;showImage&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Which database makes sense?&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:231816531,&quot;name&quot;:&quot;Mandeep Singh Shekhawat&quot;,&quot;bio&quot;:&quot;Software Engineer | O'Reilly Author \&quot;System Design on AWS\&quot; | YouTube @MsDeepSingh&quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!C1xZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F281a9bed-8be5-42e2-a328-ad1ec6aeb3e0_1056x1056.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2026-05-09T11:50:47.000Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!aNcu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://systemdesignfromscratch.org/p/which-database-makes-sense&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:196777274,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:1,&quot;comment_count&quot;:0,&quot;publication_id&quot;:2597599,&quot;publication_name&quot;:&quot;System Design From Scratch&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!hyee!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F678b5863-6e28-4ece-85b0-5aa8fe2632cc_608x608.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p> The decision factors include:</p><ul><li><p>Solves the use case</p></li><li><p>Previous Expertise</p></li><li><p>Cost</p></li><li><p>Battle-tested software</p></li><li><p>Cloud Managed vs Self Managed (Operational Overhead)</p></li><li><p>Time to Market</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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">Thanks for reading System Design From Scratch! Subscribe for free to receive new posts and support my work.</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>With all this information, let&#8217;s conclude our discussion.</p><h2>Closing Remarks&#8230;</h2><p>Use the below table as reference for selection of compute along with some decision factors discussed in previous section.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oXbw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a05e01c-d521-46b4-af3d-476c11e21c80_826x530.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oXbw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a05e01c-d521-46b4-af3d-476c11e21c80_826x530.png 424w, https://substackcdn.com/image/fetch/$s_!oXbw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a05e01c-d521-46b4-af3d-476c11e21c80_826x530.png 848w, https://substackcdn.com/image/fetch/$s_!oXbw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a05e01c-d521-46b4-af3d-476c11e21c80_826x530.png 1272w, https://substackcdn.com/image/fetch/$s_!oXbw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a05e01c-d521-46b4-af3d-476c11e21c80_826x530.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oXbw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a05e01c-d521-46b4-af3d-476c11e21c80_826x530.png" width="826" height="530" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2a05e01c-d521-46b4-af3d-476c11e21c80_826x530.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:530,&quot;width&quot;:826,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:114831,&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://systemdesignfromscratch.org/i/211293645?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a05e01c-d521-46b4-af3d-476c11e21c80_826x530.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_!oXbw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a05e01c-d521-46b4-af3d-476c11e21c80_826x530.png 424w, https://substackcdn.com/image/fetch/$s_!oXbw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a05e01c-d521-46b4-af3d-476c11e21c80_826x530.png 848w, https://substackcdn.com/image/fetch/$s_!oXbw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a05e01c-d521-46b4-af3d-476c11e21c80_826x530.png 1272w, https://substackcdn.com/image/fetch/$s_!oXbw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a05e01c-d521-46b4-af3d-476c11e21c80_826x530.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 aria-hidden="true" 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><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>In summary:</p><ul><li><p>All compute options can work at high scale. Evaluate on what works for you. Do PoC if you&#8217;ve money and resources.</p></li></ul><p>Iterate on design if you require more control over time.</p><ul><li><p>Example started with EKS Fargate</p></li><li><p>Move to EKS EC2</p></li><li><p>Migrate away from managed offering and deploy your own EKS cluster to manage containers EC2 instances.</p></li></ul><p>Taking an example of Amazon Prime video monitoring architecture. The distributed architecture involved multiple AWS Lambda functions orchestrated via AWS Step Functions. This led to lot of operational overhead with extra dollars to spend. The team rearchitected the system by migrating to ECS. This saved cost plus network latency between the components of distributed system.</p><p>See you next week! Don&#8217;t forget to subscribe :)</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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://systemdesignfromscratch.org/subscribe?"><span>Subscribe now</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Thundering Herd Explained]]></title><description><![CDATA[What is Thundering Herd and How to fix?]]></description><link>https://systemdesignfromscratch.org/p/thundering-herd-explained</link><guid isPermaLink="false">https://systemdesignfromscratch.org/p/thundering-herd-explained</guid><dc:creator><![CDATA[Mandeep Singh Shekhawat]]></dc:creator><pubDate>Sun, 09 Aug 2026 10:53:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hyee!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F678b5863-6e28-4ece-85b0-5aa8fe2632cc_608x608.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>What will happen to a food item if a large group of animals (a herd) starts running towards it, all at once?</p><h2>Problem Statement</h2><p>Now think of a same scenario for a system or a component of a system. If a large number of requests arrives at once trying to acquire a resource, the system will be overloaded if not handled well. The sudden traffic spike can cause issues like high CPU utilisation, memory leaks, etc.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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">Thanks for reading System Design From Scratch! Subscribe for free to receive new posts and support my work.</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>Thundering Herd is often used in-relation to cache and databases. For a cache-miss scenario, all the requests trying to access same item will be routed to the database. This overloads the database if database is not scaled to handle this load. This causes a cascading failure in the system bringing down the entire system.</p><h2>Resolution</h2><p>The resolution has two directions, one is mitigation (come out of situation if thundering herd occurs) and other is prevention (system is designed in a way so thundering herd doesn&#8217;t occur). Let&#8217;s explore both of these directions.</p><h3>Thundering Herd Mitigation</h3><p>It&#8217;s really hard to come out of Thundering Herd situation. This can cause cascading failures and bring the entire infrastructure down. The best is dropping the user requests. This could be for all the users or a percentage of users depending on the situation.</p><p>The database might have queued up all the requests, so restart the database. Same applies to other infra components.</p><h3>Thundering Herd Prevention</h3><p>The system can be designed in a way ensuring it can come out of these situations easily if they happen and enhancements ensuring this situation doesn&#8217;t happen.</p><h4>Discard Requests</h4><p>The first solution is load shedding. Serving some requests is always better than serving none of them. This is the idea behind load shedding because an overloaded system can cause cascading failures. </p><p>Here are few suggestions on discarding requests:</p><ul><li><p>Discard lower priority requests. This could be some back-office jobs that can be scheduled for later point of time.</p></li><li><p>Discard % of user requests. If above doesn&#8217;t help, the system should drop some percentage of user requests.</p></li><li><p>Keep a request buffer. The requests are put in a queue for certain time and served if capacity is available (or system recovers).</p></li></ul><p>Watch the dive deep on Uber&#8217;s Load Shedding Framework <a href="https://www.youtube.com/watch?v=Owia_s0B74E">QALM</a> (QoS Load Management Framework) and Cinnamon architecture (<a href="https://youtu.be/OxTXcs5qJCM">Part I</a>, <a href="https://youtu.be/2nT2La3uoqU">Part II</a>, <a href="https://youtu.be/rv0dI_oxxOA">Part III</a>) for discussion on how these systems are built.</p><h4>Jitter in Retries</h4><p>If a request fails, what you do? Hit the refresh button. The retry could be user enforced (such as refresh) or system invoked on request failures. Retries are great to recover from transient failures but this can overload the system in case of thundering herd scenarios.</p><p>If the system is not able to process the requests, and all the users retried at the same time. This makes the situation even worse. Introducing Jitter means there is random lag between the retries ensuring not all requests arrive at the same time.</p><p>Exponential backoff in retries is only good if applied with Jitter else it doesn&#8217;t solve the problem it is supposed to. In summary, don&#8217;t retry at fixed intervals. Jitter is must, exponential backoff is good to have.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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">Thanks for reading System Design From Scratch! Subscribe for free to receive new posts and support my work.</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><h4>What&#8217;s Important Should Stay Alive?</h4><p>Big software architecture has a lot of components (or services). Each component does some job and might depend on other components for part of the job. There are also some good have components. Take an example of video feed generated by Netflix, it&#8217;s customised for an user. </p><p>In overloaded system scenarios, it&#8217;s ok to reflect same video feed to all users and stop the work from recommendation system. This is good to have and not critical. The critical component is video play. The video should start once user clicks on play button. </p><p>The recommendation is clear division between the services. General criteria followed by many companies is tier strategy. Tier 1 service is most critical, Tier 2 is less critical and so on. </p><p>The chaos and stress testing should focus majorly on Tier 1 services ensuring system operations in unknown scenarios.</p><h4>Scaling</h4><p>Automated Scaling is one of suggestions that floats around to unburden the servers from this load. For thundering herd, it doesn&#8217;t help much. Bringing up a server takes some time (even with light-weight application binaries and low startup time).</p><p>Pre-scaling is one recommendation if you&#8217;re aware of some upcoming event and loosening up the auto-scaling thresholds so the system doesn&#8217;t wait for hit upper bounds can help.</p><h4>Request Coalescing</h4><p>We discussed thundering herd occurs if a huge number of requests are trying to access the same resource. Can we deploy a mechanism so as only one request is processed and others wait for for its results, see Figure 1. </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NqaY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e11883-751c-4491-9337-d3600c1cd1bc_470x232.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NqaY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e11883-751c-4491-9337-d3600c1cd1bc_470x232.png 424w, https://substackcdn.com/image/fetch/$s_!NqaY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e11883-751c-4491-9337-d3600c1cd1bc_470x232.png 848w, https://substackcdn.com/image/fetch/$s_!NqaY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e11883-751c-4491-9337-d3600c1cd1bc_470x232.png 1272w, https://substackcdn.com/image/fetch/$s_!NqaY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e11883-751c-4491-9337-d3600c1cd1bc_470x232.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NqaY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e11883-751c-4491-9337-d3600c1cd1bc_470x232.png" width="470" height="232" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/68e11883-751c-4491-9337-d3600c1cd1bc_470x232.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:232,&quot;width&quot;:470,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:61574,&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://systemdesignfromscratch.org/i/210311331?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e11883-751c-4491-9337-d3600c1cd1bc_470x232.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_!NqaY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e11883-751c-4491-9337-d3600c1cd1bc_470x232.png 424w, https://substackcdn.com/image/fetch/$s_!NqaY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e11883-751c-4491-9337-d3600c1cd1bc_470x232.png 848w, https://substackcdn.com/image/fetch/$s_!NqaY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e11883-751c-4491-9337-d3600c1cd1bc_470x232.png 1272w, https://substackcdn.com/image/fetch/$s_!NqaY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e11883-751c-4491-9337-d3600c1cd1bc_470x232.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Figure 1 Request Coalescing</p><p> All the requests are trying get(x), only one request actually fetch the result and rest of them use the same. This shields the backend systems, resolving thundering herd issue. At the caching layer, this problem is solved with a cache promise.</p><p>Cache Promise works on the similar concept, it stores a promise till the results are retried by the primary query and other requests wait for this promise. Once the promise is fulfilled, all requests are served.</p><p>Interested in practical implementation of these concepts, STAY TUNED. Something exciting is coming &#8212; <a href="https://msdeepsingh.com/books/">https://msdeepsingh.com/books/</a></p><h2>Further&#8230;</h2><ul><li><p><a href="https://youtu.be/Pd3dt37A0yU">How to avoid thundering Herd?</a></p></li><li><p><a href="https://youtu.be/f-06wUzZf58">Instagram Architecture: Solving Thundering Herd with Cache Promise</a></p></li></ul><p></p>]]></content:encoded></item><item><title><![CDATA[Writing a Technical Book: Why I Did It and How You Can Too]]></title><description><![CDATA[Writing a technical book is a huge project, but it is one of the best things you can do for your career. If you are curious about what it takes to write a book, or if you are thinking about writing on]]></description><link>https://systemdesignfromscratch.org/p/writing-a-technical-book-why-i-did</link><guid isPermaLink="false">https://systemdesignfromscratch.org/p/writing-a-technical-book-why-i-did</guid><dc:creator><![CDATA[Mandeep Singh Shekhawat]]></dc:creator><pubDate>Sat, 25 Jul 2026 05:03:07 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Brsc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a9e5ee7-dbba-45f4-b548-145c0ddf65cf_2218x1402.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1><span>Motivation</span></h1><p><span>The primary motivation for writing a technical book should not be money. If it is, you should probably reconsider. Technical books have a highly niche audience. With the rise of AI tools, fewer people rely on books for technical answers.</span></p><p><span>Financial gain was never the motivation for me, so what inspired me to write &#8220;System Design on AWS&#8221;?</span></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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">Thanks for reading System Design From Scratch! Subscribe for free to receive new posts and support my work.</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><ul><li><p><strong>Personal Growth:</strong><span> Taking a complex idea and translating it for beginners forces you to deepen your own understanding.</span></p></li><li><p><strong>The Communication Challenge:</strong><span> Having deep technical knowledge is common, but delivering it effectively is rare. Writing the book was a test of communication and documentation skills. I credit much of this to the writing culture at Amazon.</span></p></li><li><p><strong>Building Trust:</strong><span> Being an author with a respected publisher like O&#8217;Reilly acts as a powerful credential. Much like having a top-tier university or top company on your resume.</span></p></li></ul><h2><span>Is It Really Worth It?</span></h2><p><span>Absolutely, but the ROI is in your network, not your bank account. As the saying goes, &#8220;Your network is your net worth.&#8221; Publishing the book opened doors to connect with industry leaders, CTOs, and senior engineers. I&#8217;ve been invited to multiple conferences to share my insights so it has been my way of giving back to the community. The connections allow you to learn from other leaders&#8217; failures, successes, and decision-making processes.</span></p><p><span>Adding to above, it&#8217;s not like you&#8217;ll make nothing. The idea is not setting high expectations on monetary terms.</span></p><h1><span>Project Initiation</span></h1><p><a href="https://www.linkedin.com/in/msdeep14/"><span>Me</span></a><span> and my co-author </span><a href="https://jaykmr.com/"><span>Jayanth Kumar</span></a><span> took close to 2.5 years to finish the project. The details outlined as part of this blog are specific to O&#8217;Reilly but it&#8217;s similar with other technical publishers as well. I&#8217;ll divide the process into multiple phases from initial thought process to hard copies in my hands.</span></p><h2><span>Proposal Submission</span></h2><p><span>Starting out is always hard. Jayanth shared this idea with me and had some details already put up in the proposal. We brainstormed among ourselves on the structure of the book so as readers are hooked to the content throughout.</span></p><p><span>You can find all the details on the O&#8217;Reilly </span><a href="https://www.oreilly.com/work-with-us.html"><span>Work With Us</span></a><span> page regarding different ways you can contribute.</span></p><h3><span>The Proposal Details</span></h3><p><span>Here is the high level description of what you need to fill in the proposal (make a copy of proposal from </span><a href="https://docs.google.com/document/d/16B8ZmpEj-DULGNb8X2NjpQPUnZMWUn5kM1ZBaN7pSUs/copy"><span>here</span></a><span>).</span></p><ul><li><p><strong>Book title and subtitle:</strong><span> The title of the book. For subtitles, you can also suggest multiple subtitles and decide later what works best.</span></p></li><li><p><strong>About the Author:</strong><span> This is basically an author biography and why do you feel you&#8217;re the best person to write the book on a particular topic. You can include your past work such as your industry experience, previous technical books/blogs/videos, speaking at conferences, etc.</span></p></li><li><p><strong>Marketing Description:</strong><span> This is something you find on the back cover of the book. You&#8217;re basically pitching to buy the book to a potential reader.</span></p></li><li><p><strong>About the topic:</strong><span> This section explains the book title in detail and why it&#8217;s important.</span></p></li><li><p><strong>Audience:</strong><span> Who will read this book?</span></p></li><li><p><strong>What the reader will learn:</strong><span> There is always some end goal if you&#8217;re selling a product. If the reader finishes the book, what kind of knowledge gain happens and how/where the reader will apply this knowledge.</span></p></li><li><p><strong>Competing titles:</strong><span> If there are similar titles in the market, how this book differs from them and what new values this book specifically offers.</span></p></li><li><p><strong>Book outline:</strong><span> Here you include a detailed chapter-wise table of contents.</span></p></li><li><p><strong>Schedule:</strong><span> How much time will you take to finish the first two chapters, half manuscript and full manuscript. Keep in mind that life happens and if you&#8217;re working on the book writing along with your full-time job then keep a buffer.</span></p></li></ul><p><span>Balancing the content takes effort, what you go into the book and what should be skipped is the decision you&#8217;ve to make. Be ready to spend so much time on choosing topics to be included as part of the book and then again striking them off because you found other things which are more important. Once the draft was ready, we directly emailed one the Content Acquisition Editors from O&#8217;Reilly.</span></p><h3><span>Proposal Submission Timeline</span></h3><p><span>We were hopeful of the proposal approval as we firmly believed this is a unique book and solves a lot of gaps in the content already available in the market. Good things happen if you&#8217;re hopeful, and we received a positive response to the proposal. At this point, it&#8217;s not 100% approved but the acquisitions editor will work with you to modify some details as needed. For example:</span></p><ul><li><p><span>We had a lot of discussion if Part II of the book (AWS specific content) should be included or not. The point being made was there is already a lot of AWS documentation available on the internet, so what new value does the book bring? We finally agreed to keep it so readers can find everything at single place and they are able to follow along from Chapter 1 to Chapter 21. You don&#8217;t want to ask the reader to go read on internet about a specific AWS service and then come back to the book on how it&#8217;s used practically.</span></p></li><li><p><span>We had 15 chapters in Part III of the book in the initial proposal which was trimmed down to 8 later. As I was saying earlier, you&#8217;ll have to balance the content.</span></p></li></ul><p><strong>TIP:</strong><span> We also wrote one chapter from Part III and shared after proposal submission on how we&#8217;re envisioning the content. I later scrapped it off and wrote it from scratch but if you can, it&#8217;s a good idea to have some content ready from the chapters.</span></p><p><span>After all this communications, the proposal was officially approved and we were presented with a contract to sign. Once signed, the actual work started.</span></p><h1><span>Book Writing Process</span></h1><p><span>You&#8217;re assigned a development editor to work with you throughout the book after contract signing. In the first meeting, the development editor shares details like:</span></p><ul><li><p><strong>Writing tool:</strong><span> You can either write in Google Docs or O&#8217;Reilly has an in-house tool called Atlas.</span></p></li><li><p><strong>Development Schedule:</strong><span> You agree on a chapter-wise schedule on when the chapters will be ready.</span></p></li><li><p><strong>Writing Style:</strong><span> Details around illustrations, writing style, content structuring, etc.</span></p></li></ul><p><span>Once you finish a chapter, you share the chapter with the development editor. The role of development editor is to share feedback on the first draft. You work on the shared feedback and it becomes a continuous loop for all the chapters.</span></p><p><span>After development review is done and feedback is addressed, the chapters are published to O&#8217;Reilly platform in early release form. The good thing is people can read chapters early and share reviews on the platform. It&#8217;s much similar launching a product MVP, gathering feedback and improving on it before the final launch of the product.</span></p><p><span>In parallel, the book chapters also goes through technical reviews. For technical reviews, O&#8217;Reilly has their own reviewers and you can also suggest from your network. The technical reviews are phased into generally 3 parts, first two chapters, then half manuscript and then full manuscript.</span></p><p><span>After development and technical review completion of the chapter, the next step is the production phase.</span></p><h1><span>Book Production Phase</span></h1><p><span>A production editor walks you through the book production timelines and different stages as part of this process. Here are few things taken care of as part of this phase:</span></p><ul><li><p><strong>Copy Editing:</strong><span> A copy editor goes through the entire manuscript to make sure it matches the O&#8217;Reilly style guidelines. This stage generally doesn&#8217;t require too much input from your end. This is divided into two parts, QC1 and QC2. You can suggest anything as part of QC1 and that is addressed as part of QC2.</span></p></li><li><p><strong>Illustrations:</strong><span> In parallel to copy editing, an illustrator works through the images and recreates them as per O&#8217;Reilly style. You can work through the illustrations for any suggestions from your end.</span></p></li><li><p><strong>Index:</strong><span> An indexer is assigned to the project responsible to create the final index of the book.</span></p></li></ul><p><span>The book is ready to go to print after all these steps as part of the production phase. The final version of the book is available within a week on O&#8217;Reilly platform and it generally takes 3-4 weeks for physical copies to be printed out.</span></p><p><span>Let&#8217;s talk a little about the book I wrote with O&#8217;Reilly - </span><em><strong>System Design on AWS</strong></em><span>.</span></p><h1><span>System Design on AWS</span></h1><p><strong>System Design on AWS</strong><span> was written with a clear philosophy: to be useful both &#8220;during the interview and after the interview.&#8221; It is designed to take your knowledge beyond basic whiteboard theory so you can make effective long-term architectural decisions when building actual products.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Brsc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a9e5ee7-dbba-45f4-b548-145c0ddf65cf_2218x1402.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Brsc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a9e5ee7-dbba-45f4-b548-145c0ddf65cf_2218x1402.png 424w, https://substackcdn.com/image/fetch/$s_!Brsc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a9e5ee7-dbba-45f4-b548-145c0ddf65cf_2218x1402.png 848w, https://substackcdn.com/image/fetch/$s_!Brsc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a9e5ee7-dbba-45f4-b548-145c0ddf65cf_2218x1402.png 1272w, https://substackcdn.com/image/fetch/$s_!Brsc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a9e5ee7-dbba-45f4-b548-145c0ddf65cf_2218x1402.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Brsc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a9e5ee7-dbba-45f4-b548-145c0ddf65cf_2218x1402.png" width="1456" height="920" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5a9e5ee7-dbba-45f4-b548-145c0ddf65cf_2218x1402.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:920,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1732564,&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://systemdesignfromscratch.org/i/208417478?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a9e5ee7-dbba-45f4-b548-145c0ddf65cf_2218x1402.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_!Brsc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a9e5ee7-dbba-45f4-b548-145c0ddf65cf_2218x1402.png 424w, https://substackcdn.com/image/fetch/$s_!Brsc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a9e5ee7-dbba-45f4-b548-145c0ddf65cf_2218x1402.png 848w, https://substackcdn.com/image/fetch/$s_!Brsc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a9e5ee7-dbba-45f4-b548-145c0ddf65cf_2218x1402.png 1272w, https://substackcdn.com/image/fetch/$s_!Brsc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a9e5ee7-dbba-45f4-b548-145c0ddf65cf_2218x1402.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 aria-hidden="true" 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><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><span>Book Content</span></h2><ul><li><p><strong>Part 1 - Fundamentals:</strong><span> Covers core distributed building blocks like load balancers, caching layers, databases, network protocols, containerisation and general architecture patterns.</span></p></li><li><p><strong>Part 2 - AWS Services:</strong><span> Maps out the specific AWS services available across different operational domains (compute, databases, networking, event-driven, observability, big data, machine learning etc.).</span></p></li><li><p><strong>Part 3 - Practical Implementation:</strong><span> Focuses on real-world system design philosophy. It walks through building complex applications from scratch such as a stock broker platform or a hotel reservation system. From gathering initial requirements to deploying the actual AWS components. It emphasizes that drawing boxes on a whiteboard is not enough; you need to know how to actually run the system.</span></p></li></ul><p><span>You can find everything about the book on </span><a href="https://msdeepsingh.com/books/"><span>https://msdeepsingh.com/books/</span></a></p><h2><span>Get System Design on AWS</span></h2><p><span>&#128213; O&#8217;Reilly: </span><a href="https://learning.oreilly.com/library/view/system-design-on/9781098146887/"><span>https://learning.oreilly.com/library/view/system-design-on/9781098146887/</span></a></p><p><span>&#128213; Amazon.in: </span><a href="https://amzn.to/4jExkte"><span>https://amzn.to/4jExkte</span></a></p><p><span>&#128213; Amazon.com: </span><a href="https://amzn.to/3D3BIBJ"><span>https://amzn.to/3D3BIBJ</span></a></p><p><span>&#128213; Amazon.co.uk: </span><a href="https://amzn.to/3QW6Fvf"><span>https://amzn.to/3QW6Fvf</span></a></p><p><span>&#128213; Shroff Publishers (Indian Subcontinent): </span><a href="https://www.shroffpublishers.com/books/9789355428035/"><span>https://www.shroffpublishers.com/books/9789355428035/</span></a></p><p><span>Before closing, I want to share my opinions on the choice of publisher.</span></p><h1><span>Self Publishing or Publishing House?</span></h1><p><span>Self publishing means you&#8217;re already well-known in the industry and people will buy the book looking at your name as author. If you&#8217;re a first time author like me, you&#8217;ve to give some reason to readers so they can trust you. O&#8217;Reilly solved this problem for me. O&#8217;Reilly is a trusted name and they don&#8217;t publish random jargon, the book goes through a strict process so readers clear the first barrier of buying the book.</span></p><p><span>Also, we were not aware of the overall process. You&#8217;ve to spend some additional time on marketing, content reviews, copy editing, etc which are taken care of by O&#8217;Reilly in-house. Given we both had full time jobs, O&#8217;Reilly was the preferred choice and I&#8217;m very glad we pursued this project.</span></p><p><span>On a closing note, writing a technical book may not make you a millionaire, but it will sharpen your communication, expand your professional network and strengthen your domain expertise.</span></p><p><span>Best of Luck!!!</span></p><p><span>You can reach out to me on </span><a href="https://www.linkedin.com/in/msdeep14/"><span>LinkedIn</span></a><span> for specific queries.</span></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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">Thanks for reading System Design From Scratch! Subscribe for free to receive new posts and support my work.</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[Which database makes sense?]]></title><description><![CDATA[Choosing database for your next project]]></description><link>https://systemdesignfromscratch.org/p/which-database-makes-sense</link><guid isPermaLink="false">https://systemdesignfromscratch.org/p/which-database-makes-sense</guid><dc:creator><![CDATA[Mandeep Singh Shekhawat]]></dc:creator><pubDate>Sat, 09 May 2026 11:50:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!aNcu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Which database is the right choice for my use case? This is very common question that&#8217;s brought up for System Design interviews as well as while actually building systems. The decision depends on lot of factors, let&#8217;s discuss a very high level view.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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">Thanks for reading The Scalability Times! Subscribe for free to receive new posts and support my work.</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>Decision Flowchart</h2><p>Let me take a reference from my O&#8217;Reilly book &#8220;<a href="https://oreil.ly/ruQbc">System Design on AWS</a>&#8221; Chapter 3. Figure 1 shows a flow chart on how can you navigate through the choice of database over multiple options available in the market.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aNcu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aNcu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.png 424w, https://substackcdn.com/image/fetch/$s_!aNcu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.png 848w, https://substackcdn.com/image/fetch/$s_!aNcu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.png 1272w, https://substackcdn.com/image/fetch/$s_!aNcu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aNcu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.png" width="690" height="684" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:684,&quot;width&quot;:690,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:257539,&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://msdeep14.substack.com/i/196777274?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.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_!aNcu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.png 424w, https://substackcdn.com/image/fetch/$s_!aNcu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.png 848w, https://substackcdn.com/image/fetch/$s_!aNcu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.png 1272w, https://substackcdn.com/image/fetch/$s_!aNcu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d3ca9c7-ed0a-4b96-8ac6-3fadde3de18c_690x684.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 aria-hidden="true" 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><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>Figure 1 Decision Flowchart for Database Choice</p><p>The question that comes to your mind, can I follow this flowchart blindly to answer database choice questions? The answer is NO. In Software Architecture and design decisions, there are always trade-offs with any direction you go with. So saying, a particular database is perfect is wrong. In addition to the above flowchart, database choice should be combination of below factors:</p><h3>Business Requirements</h3><p>The most important decision criteria is that the database choice should meet the requirements. All other things comes later.</p><p>You can start by looking at data access patterns. The databases such as DynamoDB only makes sense if you know the access patterns. If there so many joins required, and you don&#8217;t what kind of queries will be there, relational database is better choice. This can very much happen for a new project or a startup; relational database is good choice to start with.</p><p>Don&#8217;t forget to checkout the &#8220;System Design on AWS&#8221; book for detailed dive deep on relational, non-relational databases and how best to use them.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hkD-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F026a807c-91b8-446c-81a4-964fc2c210c5_1024x1366.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hkD-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F026a807c-91b8-446c-81a4-964fc2c210c5_1024x1366.png 424w, https://substackcdn.com/image/fetch/$s_!hkD-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F026a807c-91b8-446c-81a4-964fc2c210c5_1024x1366.png 848w, https://substackcdn.com/image/fetch/$s_!hkD-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F026a807c-91b8-446c-81a4-964fc2c210c5_1024x1366.png 1272w, https://substackcdn.com/image/fetch/$s_!hkD-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F026a807c-91b8-446c-81a4-964fc2c210c5_1024x1366.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hkD-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F026a807c-91b8-446c-81a4-964fc2c210c5_1024x1366.png" width="166" height="221.44140625" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/026a807c-91b8-446c-81a4-964fc2c210c5_1024x1366.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1366,&quot;width&quot;:1024,&quot;resizeWidth&quot;:166,&quot;bytes&quot;:905382,&quot;alt&quot;:&quot;System Design on AWS&quot;,&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://msdeep14.substack.com/i/196777274?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F026a807c-91b8-446c-81a4-964fc2c210c5_1024x1366.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="System Design on AWS" title="System Design on AWS" srcset="https://substackcdn.com/image/fetch/$s_!hkD-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F026a807c-91b8-446c-81a4-964fc2c210c5_1024x1366.png 424w, https://substackcdn.com/image/fetch/$s_!hkD-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F026a807c-91b8-446c-81a4-964fc2c210c5_1024x1366.png 848w, https://substackcdn.com/image/fetch/$s_!hkD-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F026a807c-91b8-446c-81a4-964fc2c210c5_1024x1366.png 1272w, https://substackcdn.com/image/fetch/$s_!hkD-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F026a807c-91b8-446c-81a4-964fc2c210c5_1024x1366.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://msdeepsingh.com/books/&quot;,&quot;text&quot;:&quot;Everything about \&quot;System Design on AWS\&quot;&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://msdeepsingh.com/books/"><span>Everything about "System Design on AWS"</span></a></p><h3>Previous Expertise</h3><p>If you already have expertise with some technology then you know how to use it in the best way possible. If something meets the requirements and you also have previous working experience, nothing beats this combination.</p><p>In case you&#8217;re new to databases or your use case is totally new, try to stick with battle-tested software. If a lot of people have used something at scale already, you&#8217;ll get ton of support from community. </p><h3>Cost</h3><p>You should be able to afford something to use it. Cost is important consideration, this is mostly applicable to managed offerings. When it comes to cost, I recommend to look at total cost of operations and not just the monthly bill paid to the provider.</p><p>See,</p><ul><li><p>How much time you&#8217;re saving in launching your product by leveraging managed offering. This is also applicable to other solutions as well and not just databases.</p></li><li><p>How much operational burden it takes off from your plate.</p></li></ul><p>With this, let&#8217;s conclude the discussion.</p><h2>Conclusion</h2><p>Always consider trade-offs for any decision you make, what are the pros and cons for any choice being made. Also, there is thin line between database features these days. There are a lot of managed relational database offerings with horizontal scaling support so you don&#8217;t have to implement this in-house. There are a lot of non-relational database offerings with transactional support.</p><p>I&#8217;ll recommend to choose non-relational only if you know you need it. Else stick to relational databases, they solves most of the requirements. Happy Building!</p><p><strong>Check out the YouTube video for the discussion with the community -</strong> </p><div id="youtube2-9nXYR3vt6f0" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;9nXYR3vt6f0&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/9nXYR3vt6f0?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div>]]></content:encoded></item><item><title><![CDATA[Designing Data-Intensive Applications Book Summary]]></title><description><![CDATA[Don't have time to read the entire book, read the summary instead]]></description><link>https://systemdesignfromscratch.org/p/designing-data-intensive-applications</link><guid isPermaLink="false">https://systemdesignfromscratch.org/p/designing-data-intensive-applications</guid><dc:creator><![CDATA[Mandeep Singh Shekhawat]]></dc:creator><pubDate>Sat, 14 Feb 2026 11:01:30 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hyee!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F678b5863-6e28-4ece-85b0-5aa8fe2632cc_608x608.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Designing Data-Intensive Applications, often referred to as DDIA, is popular and recommended book in Software Engineering domain. I personally read this book and it contains mix of theoretical and practical knowledge. Completing the book definitely requires time and concentration. </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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">Thanks for reading The Scalability Times! Subscribe for free to receive new posts and support my work.</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><p>As I was going through the book, I created chapter-wise short notes and YouTube videos as a summary.</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">DDIA Chapter 1-12 Notes</div><div class="file-embed-details-h2">70.1MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://msdeep14.substack.com/api/v1/file/0a69db6d-b47c-4472-93ba-a77e99d3161c.pdf"><span class="file-embed-button-text">Download</span></a></div><div class="file-embed-description">Chapter-wise summary of Designing Data-Intensive Applications book</div><a class="file-embed-button narrow" href="https://msdeep14.substack.com/api/v1/file/0a69db6d-b47c-4472-93ba-a77e99d3161c.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.youtube.com/watch?v=BDxGNhnZaEc&amp;list=PLGPe9uvn5fMZ1__Z6yrvcMqiyo5SEeSqP&amp;index=1&quot;,&quot;text&quot;:&quot;Watch on YouTube&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.youtube.com/watch?v=BDxGNhnZaEc&amp;list=PLGPe9uvn5fMZ1__Z6yrvcMqiyo5SEeSqP&amp;index=1"><span>Watch on YouTube</span></a></p><h3>Should you read the book?</h3><p>An excerpt from the O&#8217;Reilly around usefulness of the book</p><blockquote><ul><li><p>Peer under the hood of the systems you already use, and learn how to use and operate them more effectively</p></li><li><p>Make informed decisions by identifying the strengths and weaknesses of different tools</p></li><li><p>Navigate the trade-offs around consistency, scalability, fault tolerance, and complexity</p></li><li><p>Understand the distributed systems research upon which modern databases are built</p></li><li><p>Peek behind the scenes of major online services, and learn from their architectures</p></li></ul></blockquote><h3>Where can I get a copy?</h3><ul><li><p><a href="https://amzn.to/3O6laOU">amazon.com</a></p></li><li><p><a href="https://amzn.to/3O4uzGA">amazon.in</a></p></li><li><p><a href="http://oreillymedia.pxf.io/ZVbdLq">O&#8217;Reilly online</a></p></li><li><p><a href="https://www.scylladb.com/wp-content/uploads/ScyllaDB-Designing-Data-Intensive-Applications.pdf">ScyllaDB sponsored chapters</a> for free</p></li></ul><p> </p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[The WHY of Databases?]]></title><description><![CDATA[Why do I need a Database if I can directly store data in files?]]></description><link>https://systemdesignfromscratch.org/p/the-why-of-databases</link><guid isPermaLink="false">https://systemdesignfromscratch.org/p/the-why-of-databases</guid><dc:creator><![CDATA[Mandeep Singh Shekhawat]]></dc:creator><pubDate>Mon, 09 Feb 2026 17:03:57 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!tE9n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe195cdb9-9cfa-4adb-9539-b58ed8b45bff_1366x768.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Back in 2nd year of my college, I built a train-ticket booking application (somewhat similar to IRCTC in India). The application was built in C++ with Qt framework. Not sure if you heard about this framework but it&#8217;s good and get&#8217;s the job done. The below image is the landing page:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tE9n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe195cdb9-9cfa-4adb-9539-b58ed8b45bff_1366x768.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tE9n!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe195cdb9-9cfa-4adb-9539-b58ed8b45bff_1366x768.png 424w, https://substackcdn.com/image/fetch/$s_!tE9n!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe195cdb9-9cfa-4adb-9539-b58ed8b45bff_1366x768.png 848w, https://substackcdn.com/image/fetch/$s_!tE9n!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe195cdb9-9cfa-4adb-9539-b58ed8b45bff_1366x768.png 1272w, https://substackcdn.com/image/fetch/$s_!tE9n!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe195cdb9-9cfa-4adb-9539-b58ed8b45bff_1366x768.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tE9n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe195cdb9-9cfa-4adb-9539-b58ed8b45bff_1366x768.png" width="1366" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e195cdb9-9cfa-4adb-9539-b58ed8b45bff_1366x768.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1366,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:869646,&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://msdeep14.substack.com/i/186725224?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe195cdb9-9cfa-4adb-9539-b58ed8b45bff_1366x768.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_!tE9n!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe195cdb9-9cfa-4adb-9539-b58ed8b45bff_1366x768.png 424w, https://substackcdn.com/image/fetch/$s_!tE9n!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe195cdb9-9cfa-4adb-9539-b58ed8b45bff_1366x768.png 848w, https://substackcdn.com/image/fetch/$s_!tE9n!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe195cdb9-9cfa-4adb-9539-b58ed8b45bff_1366x768.png 1272w, https://substackcdn.com/image/fetch/$s_!tE9n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe195cdb9-9cfa-4adb-9539-b58ed8b45bff_1366x768.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 aria-hidden="true" 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><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>Figure 1. Train booking application</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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 for free to receive new posts and support my work.</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>There was something interesting about the project. There was no underlying database. The data was directly dumped to files, including login details, train details, booking details, etc. Example, train details for sun stored in <a href="https://github.com/msdeep14/IRCTC/blob/master/sun.txt">sun.txt</a>. Checkout code on Github - <a href="https://github.com/msdeep14/irctc">https://github.com/msdeep14/irctc</a></p><pre><code>1 2 12956 jp-pune_exp 3:20PM 51 587
2 1 12957 jp-pune_exp 9:15AM 87 501
20 21 19876 goa_exp 5:00PM 54 709
3 2 10786 jhelum 5:25PM 112 654
1 9 11760 jp-mumbai-exp 2:00PM 67 543
1 2 34561 premium 11:00AM 45 1700</code></pre><p>So I think I&#8217;m eligible to answer the question; why do we need database if you can store data in files?</p><h2>Bottlenecks</h2><p>If there is already classic file storage available, what&#8217;s the need for all kind of databases? Let&#8217;s take an quick example, you wish to get all the trains from Jaipur to Pune:</p><ul><li><p>The code snippet above shares trains availability as per source to destination. The beginning two numbers are keys mapped to locations.</p></li><li><p>Essentially, you&#8217;ll pick the file for a day and find the train.</p></li><li><p>What if there is no direct trains? It constructs a graph from file data and finds the trains matching to source and destination.</p></li></ul><p>It&#8217;s works all great for college project because there is not much data but soon it will face problems:</p><ul><li><p>Increased latency</p></li><li><p>Supporting different query patterns</p></li></ul><h2>Introducing Databases </h2><p>At a very high level, databases offers structured way of accessing the data. Depending on the use case, the data is stored in a way that it&#8217;s retrieval is fast. There are different kind of databases depending on the requirements. Chapter 2, 3 &amp; 10 of O&#8217;Reilly title &#8220;System Design on AWS&#8221; explores multiple databases with their architectures.</p><p>Here is a diagrammatic representation:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qehK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45b63f8-23a7-41b4-b0c1-a8e142f5f2fa_690x684.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qehK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45b63f8-23a7-41b4-b0c1-a8e142f5f2fa_690x684.png 424w, https://substackcdn.com/image/fetch/$s_!qehK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45b63f8-23a7-41b4-b0c1-a8e142f5f2fa_690x684.png 848w, https://substackcdn.com/image/fetch/$s_!qehK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45b63f8-23a7-41b4-b0c1-a8e142f5f2fa_690x684.png 1272w, https://substackcdn.com/image/fetch/$s_!qehK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45b63f8-23a7-41b4-b0c1-a8e142f5f2fa_690x684.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qehK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45b63f8-23a7-41b4-b0c1-a8e142f5f2fa_690x684.png" width="690" height="684" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d45b63f8-23a7-41b4-b0c1-a8e142f5f2fa_690x684.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:684,&quot;width&quot;:690,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:257539,&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://msdeep14.substack.com/i/186725224?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45b63f8-23a7-41b4-b0c1-a8e142f5f2fa_690x684.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_!qehK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45b63f8-23a7-41b4-b0c1-a8e142f5f2fa_690x684.png 424w, https://substackcdn.com/image/fetch/$s_!qehK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45b63f8-23a7-41b4-b0c1-a8e142f5f2fa_690x684.png 848w, https://substackcdn.com/image/fetch/$s_!qehK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45b63f8-23a7-41b4-b0c1-a8e142f5f2fa_690x684.png 1272w, https://substackcdn.com/image/fetch/$s_!qehK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45b63f8-23a7-41b4-b0c1-a8e142f5f2fa_690x684.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 aria-hidden="true" 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><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>Figure 2 Decision Flowchart for Database selection</p><p>Let&#8217;s take an example from train ticket booking. Instead of storing the data in the files, if it&#8217;s stored in relational database such as PostgreSQL then it makes easier. For the query pattern, get all the trains from Jaipur to Pune. The point of consideration was how can we skip the reading all the records. The database indexes can be created location and time wise, reducing the data footprint.</p><p>Figure 2 offers some clarity on decisions can be made. Further, database choice is not just the use case, it&#8217;s combination of all below factors. This is also covered in YouTube channel video.</p><ul><li><p>Solves the use case (read/write access patterns)</p></li><li><p>Previous Expertise with the database</p></li><li><p>Cost</p></li><li><p>Battle-tested software</p></li><li><p>Cloud Managed vs Self Managed (Operational Overhead)</p></li><li><p>Time to Market</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://youtu.be/9nXYR3vt6f0&quot;,&quot;text&quot;:&quot;Watch on YouTube&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://youtu.be/9nXYR3vt6f0"><span>Watch on YouTube</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Facebook Architecture From 2005]]></title><description><![CDATA[Early architecture of Facebook]]></description><link>https://systemdesignfromscratch.org/p/facebook-architecture-from-2005</link><guid isPermaLink="false">https://systemdesignfromscratch.org/p/facebook-architecture-from-2005</guid><dc:creator><![CDATA[Mandeep Singh Shekhawat]]></dc:creator><pubDate>Wed, 21 Jan 2026 13:54:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hyee!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F678b5863-6e28-4ece-85b0-5aa8fe2632cc_608x608.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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://systemdesignfromscratch.org/subscribe?"><span>Subscribe now</span></a></p><p>The architecture evolves over time and the idea should always be we&#8217;re able to iterate over it. </p><ul><li><p>It&#8217;s nice when you get stuff right the first time but we don&#8217;t need to</p></li><li><p>As long as you get the architecture as right as possible; the implementation stuff isn&#8217;t going to be big of a deal</p></li></ul><p>This article captures the very early architecture of Facebook, how it started and challenges faced with scaling.</p><h3>Initial Architecture</h3><p>Facebook was launched in February 2004 with focus on connecting people for one school</p><h4>Tech Stack</h4><ul><li><p>Programming Language: PHP</p></li><li><p>Database: MySQL</p></li><li><p>Apache Web server</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hEwM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17c35a72-8561-4549-bc0a-196da341d77f_316x118.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hEwM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17c35a72-8561-4549-bc0a-196da341d77f_316x118.png 424w, https://substackcdn.com/image/fetch/$s_!hEwM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17c35a72-8561-4549-bc0a-196da341d77f_316x118.png 848w, https://substackcdn.com/image/fetch/$s_!hEwM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17c35a72-8561-4549-bc0a-196da341d77f_316x118.png 1272w, https://substackcdn.com/image/fetch/$s_!hEwM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17c35a72-8561-4549-bc0a-196da341d77f_316x118.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hEwM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17c35a72-8561-4549-bc0a-196da341d77f_316x118.png" width="316" height="118" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/17c35a72-8561-4549-bc0a-196da341d77f_316x118.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:118,&quot;width&quot;:316,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:16178,&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://msdeep14.substack.com/i/185182416?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17c35a72-8561-4549-bc0a-196da341d77f_316x118.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_!hEwM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17c35a72-8561-4549-bc0a-196da341d77f_316x118.png 424w, https://substackcdn.com/image/fetch/$s_!hEwM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17c35a72-8561-4549-bc0a-196da341d77f_316x118.png 848w, https://substackcdn.com/image/fetch/$s_!hEwM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17c35a72-8561-4549-bc0a-196da341d77f_316x118.png 1272w, https://substackcdn.com/image/fetch/$s_!hEwM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17c35a72-8561-4549-bc0a-196da341d77f_316x118.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>                                             Figure 1 Early Facebook Architecture</p><p>The simple architecture served well for single school, but soon there were challenges with more interest and increasing scale.</p><h3>Scaling Challenges</h3><p>Let&#8217;s discuss few of the challenges faced due to architecture limitations:</p><ul><li><p>Privacy: Data and feed separation between the schools</p></li><li><p>Traffic Distribution: </p><ul><li><p>How the data should be distributed for different schools</p></li><li><p>Some schools have heavier usage as compared to others.</p></li></ul></li><li><p> Figure out friends connections with higher degree (friend-of-friend or friend-of-friend-of-friend)</p></li></ul><p>Let&#8217;s discuss on the improvements in the architecture to handle the bottlenecks. </p><h3>Improving Architecture</h3><p>The key aspect is hiring more and more smart people and give them independence to work on the improvements.</p><h4>Onboarding More Schools</h4><p>The first thing that comes to mind for handling more traffic is adding more machines. </p><ul><li><p>We mentioned web server and MySQL coupled on same machine, so the idea is to decouple the storage from application server and introduce load balancing between the machines. </p></li><li><p>This also removed single point of failure. Consistent database layer ensures traffic can be served from any operational machine.</p></li></ul><h4>Handling Friend-Of-Friend</h4><p>If you wish to figure out friend of a person, it&#8217;s a direct query to database. For friend-of-friend:</p><ul><li><p>Retrieve friend list of a person</p></li><li><p>Iterate over this list and get friend list of all the items</p></li><li><p>This becomes n*n operation.</p></li></ul><p>For friend-of-friend-of-friend, it becomes n*n*n operation; so it&#8217;s compute-intensive. The current architecture uses dedicated graph database, but back then: </p><ul><li><p>Split the database and create one instance of mysql database for each school in the network</p></li><li><p>How does this help? Now you&#8217;ve to compute n*n*n for 10k (approximate number of people signed up from one school) instead of n*n*n over 6 million (all people across the schools)</p></li></ul><p>The above is in addition to decoupling application servers and database compute. This helped a lot but further the traffic was reaching 100 Million pages/day, a query approximately takes 2-4 milliseconds. The problem lies in each page repeating on the same queries.</p><h4>Improving Database Performance</h4><p>What comes to mind to solves the same query problem? Cache the results to avoid hitting the database. Facebook introduced Memcached as caching layer; this brought down query performance to 0.3-0.5 milliseconds.</p><p>There were couple of issues though with the distributed architecture of memcached instances; If a memcached instances go down: </p><ul><li><p>There is no redundancy on information.</p></li></ul><ul><li><p>Cache miss occurs; and all the traffic routes to database.</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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">We&#8217;ll discuss more on scaling memcached in future posts.  Subscribe for free to receive new posts and support my work.</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>Facebook introduced photo sharing feature, let&#8217;s discuss on how it&#8217;s implemented.</p><h4>Photo Storage</h4><p>From early stage, Facebook chose to smaller machines instead of one big machine. The disk is relatively slow but stable, to overcome the slowness:</p><ul><li><p>High RAM Caching machines to hold most of the thumbnails and frequently accessed images.</p></li></ul><p><strong>The space consumed by photos is on higher side, some issues uncovered:</strong></p><ul><li><p>If you wish to upload a photo album with 30 photos (3 MB each), then 90MB is total size; Networking issues with slow internet. </p></li><li><p>Router used was built to support 1GB at a time.</p></li></ul><p><strong>Solution:</strong></p><ul><li><p>Built Java applet and ActiveX control to couple the choosing of photos</p></li><li><p>Compression at client side.</p></li></ul><p><strong>It helps:</strong></p><ul><li><p>Upload photos quickly</p></li><li><p>Resource optimisation - less server CPU utilisation</p></li></ul><p>Even with caching machines, transferring images to users takes time. So the solution is to move caching near to users, aka, Content Delivery Networks (CDNs).</p><h3>Conclusion</h3><p>Follow Iterative Design Process; Remember you don&#8217;t have built it right (or perfect) the first time. Happy Building!</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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">Thanks for reading The Scalability Times! Subscribe for free to receive new posts and support my work.</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[Coming soon]]></title><description><![CDATA[This is System Design From Scratch.]]></description><link>https://systemdesignfromscratch.org/p/coming-soon</link><guid isPermaLink="false">https://systemdesignfromscratch.org/p/coming-soon</guid><dc:creator><![CDATA[Mandeep Singh Shekhawat]]></dc:creator><pubDate>Sun, 05 May 2024 14:14:38 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hyee!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F678b5863-6e28-4ece-85b0-5aa8fe2632cc_608x608.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is System Design From Scratch.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdesignfromscratch.org/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://systemdesignfromscratch.org/subscribe?"><span>Subscribe now</span></a></p>]]></content:encoded></item></channel></rss>