<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>System Design on Tech Blog</title>
    <link>https://yashsachdeva.com/tags/system-design/</link>
    <description>Recent content in System Design on Tech Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>© 2026 Yash Sachdeva</copyright>
    <lastBuildDate>Sat, 09 May 2026 16:52:08 +0530</lastBuildDate><atom:link href="https://yashsachdeva.com/tags/system-design/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Designing a URL Shortener</title>
      <link>https://yashsachdeva.com/posts/designing-a-url-shortener/</link>
      <pubDate>Sat, 09 May 2026 16:52:08 +0530</pubDate>
      
      <guid>https://yashsachdeva.com/posts/designing-a-url-shortener/</guid>
      <description>&lt;h2 class=&#34;relative group&#34;&gt;Introduction&#xA;    &lt;div id=&#34;introduction&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#introduction&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;p&gt;As part of this post, we&amp;rsquo;ll be covering the design of a modern, highly available, and scalable URL shortening service like TinyURL or Bit.ly.&lt;/p&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;1. Requirements&#xA;    &lt;div id=&#34;1-requirements&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#1-requirements&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&#xA;&lt;h3 class=&#34;relative group&#34;&gt;Functional Requirements&#xA;    &lt;div id=&#34;functional-requirements&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#functional-requirements&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Shorten&lt;/strong&gt; - Given a long URL, generate a unique, short alias (e.g. &lt;code&gt;https://tny.li/abc123&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Redirect&lt;/strong&gt; - Given a short URL, redirect the user to the original long URL with minimal latency.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Custom Aliases&lt;/strong&gt; - Allow users to pick a custom human-readable alias (e.g. &lt;code&gt;tny.li/my-resume&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Link Expiration&lt;/strong&gt; - Support optional TTL (Time to Live) on links.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Analytics&lt;/strong&gt; - Track per-link click counts, device types, referrers, and geographic distribution.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3 class=&#34;relative group&#34;&gt;Non-Functional Requirements&#xA;    &lt;div id=&#34;non-functional-requirements&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#non-functional-requirements&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Low Latency&lt;/strong&gt; - Redirects must be served in &amp;lt; 10ms at the P99 level. Reads far outnumber writes.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;High Availability&lt;/strong&gt; - The redirect path is the core business operation. Any downtime directly impacts every shortened link on the internet that points to us. Target 99.99% availability.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Scalability&lt;/strong&gt; - The system should sustain &lt;strong&gt;100K+ redirects/s&lt;/strong&gt; and &lt;strong&gt;1K new URLs/s&lt;/strong&gt; with headroom to scale horizontally.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Durability&lt;/strong&gt; - Once a short URL is created, the mapping must never be lost.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Uniqueness Guarantee&lt;/strong&gt; - Two different long URLs must never produce the same short URL.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3 class=&#34;relative group&#34;&gt;Back-of-the-Envelope Calculation&#xA;    &lt;div id=&#34;back-of-the-envelope-calculation&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#back-of-the-envelope-calculation&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h3&gt;&#xA;&lt;p&gt;These numbers allow us to make concrete decisions about storage, caching and partitioning in later sections.&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>
