<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gouranga Das Samrat</title>
    <description>The latest articles on DEV Community by Gouranga Das Samrat (@gouranga-das-khulna).</description>
    <link>https://dev.to/gouranga-das-khulna</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2193879%2F834a1499-2027-4355-87be-bb678e90ae5c.jpg</url>
      <title>DEV Community: Gouranga Das Samrat</title>
      <link>https://dev.to/gouranga-das-khulna</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gouranga-das-khulna"/>
    <language>en</language>
    <item>
      <title>Database Scaling</title>
      <dc:creator>Gouranga Das Samrat</dc:creator>
      <pubDate>Sun, 07 Jun 2026 02:00:00 +0000</pubDate>
      <link>https://dev.to/gouranga-das-khulna/database-scaling-56fa</link>
      <guid>https://dev.to/gouranga-das-khulna/database-scaling-56fa</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;One-liner:&lt;/strong&gt; Databases are the hardest part to scale — the strategy is: vertical first → read replicas → caching → sharding.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📌 Scaling Ladder
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Stage 1: Single DB (&amp;lt; 10K users)
Stage 2: Separate DB server from app server
Stage 3: Add caching (Redis) — reduce DB reads by 80%
Stage 4: Read Replicas — distribute read traffic
Stage 5: Database Sharding — distribute write traffic + data
Stage 6: CQRS + Event Sourcing (advanced)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Never jump to Stage 5 without exhausting Stages 3 and 4.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📊 The Read/Write Split
&lt;/h2&gt;

&lt;p&gt;Most web apps: ~90% reads, ~10% writes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Optimize reads first:
  → Add Redis cache (most impactful)
  → Add read replicas
  → Add CDN for static data

Only then optimize writes:
  → Sharding
  → Async writes (queue + batch)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🗃️ Connection Pooling
&lt;/h2&gt;

&lt;p&gt;Never create a new DB connection per request. Use a pool.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// pg (Node.js PostgreSQL)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Pool&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;max&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// max 20 connections&lt;/span&gt;
  &lt;span class="na"&gt;idleTimeoutMillis&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;connectionTimeoutMillis&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;SELECT * FROM users WHERE id = $1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without pooling: 1000 req/sec = 1000 new connections = DB crashes.&lt;/p&gt;

</description>
      <category>database</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Consistent Hashing</title>
      <dc:creator>Gouranga Das Samrat</dc:creator>
      <pubDate>Sat, 06 Jun 2026 02:00:00 +0000</pubDate>
      <link>https://dev.to/gouranga-das-khulna/consistent-hashing-3fn7</link>
      <guid>https://dev.to/gouranga-das-khulna/consistent-hashing-3fn7</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;One-liner:&lt;/strong&gt; A hashing technique that minimizes the number of keys that need to be remapped when servers are added or removed.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📌 The Problem It Solves
&lt;/h2&gt;

&lt;p&gt;Imagine you have 3 cache servers and you distribute keys using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server = hash(key) % N  (N = number of servers)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Works fine until N changes:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;N=3: hash("user123") % 3 = 1 → Server 1
N=4: hash("user123") % 4 = 3 → Server 3  ← DIFFERENT!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you add or remove a server, &lt;strong&gt;almost ALL keys remap&lt;/strong&gt; → massive cache miss storm → database gets hammered.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 The Solution: Consistent Hashing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How It Works
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Map both &lt;strong&gt;servers&lt;/strong&gt; and &lt;strong&gt;keys&lt;/strong&gt; onto the same circular hash ring (0 to 2³²)&lt;/li&gt;
&lt;li&gt;Each key is assigned to the &lt;strong&gt;first server clockwise&lt;/strong&gt; from its position&lt;/li&gt;
&lt;li&gt;Adding/removing a server only affects &lt;strong&gt;adjacent keys&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;         0
      /     \
  S3         S1
    \       /
         S2
        360°

Key K1 → clockwise → lands on S1
Key K2 → clockwise → lands on S2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Adding a Server
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before:  K1→S1, K2→S1, K3→S2, K4→S3
Add S4 between S1 and S2:
After:   K1→S1, K2→S4, K3→S2, K4→S3  ← Only K2 moved!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Removing a Server
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before: K1→S1, K2→S2, K3→S2, K4→S3
Remove S2:
After:  K1→S1, K2→S3, K3→S3, K4→S3  ← K2 and K3 moved to next server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ⚖️ Problem: Uneven Distribution
&lt;/h2&gt;

&lt;p&gt;With few servers, the ring can be unbalanced:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;S1 handles 60% of keyspace
S2 handles 30% of keyspace
S3 handles 10% of keyspace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Solution: Virtual Nodes (VNodes)
&lt;/h3&gt;

&lt;p&gt;Instead of 1 point per server, use &lt;strong&gt;many virtual points&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;S1 → S1_1, S1_2, S1_3 ... S1_100  (spread around ring)
S2 → S2_1, S2_2, S2_3 ... S2_100
S3 → S3_1, S3_2, S3_3 ... S3_100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result: Much more even distribution. Each physical server maps to ~N/total keys.&lt;/p&gt;




&lt;h2&gt;
  
  
  🏗️ Implementation Sketch
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConsistentHash&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;replicas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replicas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;replicas&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// virtual nodes per server&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ring&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// hash → serverName&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sortedKeys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;addServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replicas&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;md5&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ring&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sortedKeys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sortedKeys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;getServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;md5&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Find first server clockwise&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;k&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sortedKeys&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ring&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;k&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ring&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sortedKeys&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="c1"&gt;// wrap around&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  📊 Consistent Hashing vs Modulo Hashing
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dimension&lt;/th&gt;
&lt;th&gt;Modulo Hashing&lt;/th&gt;
&lt;th&gt;Consistent Hashing&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Keys remapped on resize&lt;/td&gt;
&lt;td&gt;~100%&lt;/td&gt;
&lt;td&gt;~1/N&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Uneven distribution&lt;/td&gt;
&lt;td&gt;Even&lt;/td&gt;
&lt;td&gt;Possible (fix with VNodes)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Complexity&lt;/td&gt;
&lt;td&gt;O(1)&lt;/td&gt;
&lt;td&gt;O(log N) per lookup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Use case&lt;/td&gt;
&lt;td&gt;Fixed set of servers&lt;/td&gt;
&lt;td&gt;Dynamic server pool&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🌍 Real-World Use Cases
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;How it's used&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cassandra&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Partitions data across nodes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;DynamoDB&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Key-based partitioning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Memcached/Redis Cluster&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Distributing cache keys&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Nginx&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Consistent upstream selection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;CDN&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Routing requests to edge nodes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Kafka&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Partition assignment&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🎨 Excalidraw Diagram
&lt;/h2&gt;

&lt;p&gt;The diagram shows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The hash ring as a circle&lt;/li&gt;
&lt;li&gt;Server nodes placed on the ring&lt;/li&gt;
&lt;li&gt;Keys mapped to nearest server clockwise&lt;/li&gt;
&lt;li&gt;Virtual nodes distributed around the ring&lt;/li&gt;
&lt;li&gt;Before/after adding a server (minimal key movement)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔑 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Modulo hashing causes thundering herd on any server change&lt;/li&gt;
&lt;li&gt;Consistent hashing limits disruption to ~1/N keys per change&lt;/li&gt;
&lt;li&gt;Virtual nodes (VNodes) solve the uneven distribution problem&lt;/li&gt;
&lt;li&gt;This is used &lt;strong&gt;everywhere&lt;/strong&gt; in distributed databases and caches&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>distributedsystems</category>
      <category>systemdesign</category>
      <category>kafka</category>
    </item>
    <item>
      <title>Back of Envelope Calculations</title>
      <dc:creator>Gouranga Das Samrat</dc:creator>
      <pubDate>Fri, 05 Jun 2026 02:00:00 +0000</pubDate>
      <link>https://dev.to/gouranga-das-khulna/back-of-envelope-calculations-22d7</link>
      <guid>https://dev.to/gouranga-das-khulna/back-of-envelope-calculations-22d7</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;One-liner:&lt;/strong&gt; Rough estimates done quickly to understand the scale of a system before designing it. They tell you what tier of infrastructure you need.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📌 Why This Matters
&lt;/h2&gt;

&lt;p&gt;Before designing ANY system, you need to know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How many &lt;strong&gt;users&lt;/strong&gt; will use it?&lt;/li&gt;
&lt;li&gt;How many &lt;strong&gt;requests per second&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;How much &lt;strong&gt;storage&lt;/strong&gt; do we need?&lt;/li&gt;
&lt;li&gt;How much &lt;strong&gt;bandwidth&lt;/strong&gt; is required?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These estimates shape every architectural decision.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔢 Numbers Every Engineer Should Know
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Time
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1 millisecond&lt;/td&gt;
&lt;td&gt;10⁻³ seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 microsecond&lt;/td&gt;
&lt;td&gt;10⁻⁶ seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 nanosecond&lt;/td&gt;
&lt;td&gt;10⁻⁹ seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Seconds in a day&lt;/td&gt;
&lt;td&gt;~86,400 ≈ 10⁵&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Seconds in a month&lt;/td&gt;
&lt;td&gt;~2.5M ≈ 2.5 × 10⁶&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Seconds in a year&lt;/td&gt;
&lt;td&gt;~31.5M ≈ 3 × 10⁷&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Latency Numbers (Approximate)
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operation&lt;/th&gt;
&lt;th&gt;Latency&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;L1 cache reference&lt;/td&gt;
&lt;td&gt;1 ns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;L2 cache reference&lt;/td&gt;
&lt;td&gt;4 ns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RAM reference&lt;/td&gt;
&lt;td&gt;100 ns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SSD random read&lt;/td&gt;
&lt;td&gt;150 µs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HDD seek&lt;/td&gt;
&lt;td&gt;10 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Network: same datacenter&lt;/td&gt;
&lt;td&gt;500 µs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Network: cross-region (US→EU)&lt;/td&gt;
&lt;td&gt;150 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Network: cross-continent&lt;/td&gt;
&lt;td&gt;200–300 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Storage Units
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1 KB&lt;/td&gt;
&lt;td&gt;10³ bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 MB&lt;/td&gt;
&lt;td&gt;10⁶ bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 GB&lt;/td&gt;
&lt;td&gt;10⁹ bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 TB&lt;/td&gt;
&lt;td&gt;10¹² bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 PB&lt;/td&gt;
&lt;td&gt;10¹⁵ bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  📐 The Estimation Framework
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: DAU → QPS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Daily Active Users (DAU)    = 10 million
Avg requests per user/day   = 10
Total daily requests        = 100 million

QPS = 100M / 86,400 ≈ 1,200 req/sec
Peak QPS (2-3x average)     ≈ 3,000 req/sec
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Storage
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;New posts per day    = 1M
Avg post size        = 1 KB (text) + 500 KB (image)
Daily storage        = 1M × 501 KB ≈ 500 GB/day
Yearly storage       = 500 GB × 365 ≈ 180 TB/year
5-year storage       ≈ 1 PB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Bandwidth
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Reads per second     = 100K req/sec
Avg response size    = 10 KB
Outbound bandwidth   = 100K × 10 KB = 1 GB/sec
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔬 Real Example: Design Twitter
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Assumptions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;300M DAU&lt;/li&gt;
&lt;li&gt;Each user reads 10 tweets/day&lt;/li&gt;
&lt;li&gt;Each user writes 1 tweet/week ≈ 0.14 tweets/day&lt;/li&gt;
&lt;li&gt;Avg tweet: 280 chars = 280 bytes ≈ 300 bytes&lt;/li&gt;
&lt;li&gt;10% of tweets have an image (~200 KB)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Read QPS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;300M users × 10 reads/day = 3B reads/day
QPS = 3B / 86,400 ≈ 35,000 reads/sec
Peak QPS ≈ 100,000 reads/sec
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Write QPS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;300M × 0.14 = 42M tweets/day
QPS = 42M / 86,400 ≈ 500 writes/sec
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Storage per day
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Text: 42M × 300 bytes = 12.6 GB
Images: 42M × 10% × 200 KB = 840 GB
Total: ~850 GB/day ≈ 310 TB/year
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Bandwidth
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Read traffic: 35K req/sec × 1 KB/response ≈ 35 MB/sec = ~300 Gbps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔬 Real Example: Design WhatsApp
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Assumptions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;2B DAU&lt;/li&gt;
&lt;li&gt;Each user sends 20 messages/day&lt;/li&gt;
&lt;li&gt;Avg message: 100 bytes&lt;/li&gt;
&lt;li&gt;30% are media messages (500 KB avg)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  QPS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2B × 20 = 40B messages/day
QPS = 40B / 86,400 ≈ 460,000 msg/sec
Peak QPS ≈ 1M msg/sec
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Storage per day
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Text: 40B × 100B = 4 TB
Media: 40B × 30% × 500 KB = 6 PB/day (too high → add retention/compression policy)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  💡 Tips for Interviews
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Always ask&lt;/strong&gt; before estimating — "Should I assume 10M or 100M users?"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Round aggressively&lt;/strong&gt; — 86,400 → 10⁵, 3.14 → 3&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Peak = 2-3× average&lt;/strong&gt; (or 5-10× for viral/event-based systems)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Show your math&lt;/strong&gt; — interviewers care about the process, not the exact number&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Derive storage needs from estimates&lt;/strong&gt; — don't pull numbers from thin air&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1 char = 1 byte (ASCII)&lt;/strong&gt;, 1 char = 2-4 bytes (Unicode)&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  📋 Estimation Cheat Sheet
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1K users  → Single server fine
10K users → Need to think about DB separation
100K users → Load balancer, read replicas
1M users  → Caching layer, CDN, sharding
10M users → Distributed systems, microservices
100M+     → You work at a FAANG (or interview there)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔑 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Back-of-envelope is about &lt;strong&gt;order of magnitude&lt;/strong&gt;, not precision&lt;/li&gt;
&lt;li&gt;Know the key numbers cold: bytes, seconds in a day, latency tiers&lt;/li&gt;
&lt;li&gt;Always separate &lt;strong&gt;read QPS&lt;/strong&gt; from &lt;strong&gt;write QPS&lt;/strong&gt; — they're usually very different&lt;/li&gt;
&lt;li&gt;Storage estimations reveal whether you need sharding/archival early&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>systemdesign</category>
      <category>backend</category>
    </item>
    <item>
      <title>TypeScript 7.0 Beta is Here — and It's Rewritten in Go. Here's What Actually Changed.</title>
      <dc:creator>Gouranga Das Samrat</dc:creator>
      <pubDate>Thu, 04 Jun 2026 04:00:00 +0000</pubDate>
      <link>https://dev.to/gouranga-das-khulna/typescript-70-beta-is-here-and-its-rewritten-in-go-heres-what-actually-changed-4l78</link>
      <guid>https://dev.to/gouranga-das-khulna/typescript-70-beta-is-here-and-its-rewritten-in-go-heres-what-actually-changed-4l78</guid>
      <description>&lt;p&gt;I've been watching the TypeScript Go port news since it first leaked, and I'll be honest — when they said "10x faster," I was ready to call marketing spin. Then I ran it on a real codebase.&lt;/p&gt;

&lt;p&gt;It's fast. Like, uncomfortably fast. The kind of fast where you assume something must be broken.&lt;/p&gt;

&lt;p&gt;TypeScript 7.0 Beta dropped on April 21st, and it's not your usual TypeScript release. This isn't "we added a few new types and fixed some edge cases." The entire compiler was ported from TypeScript (the language) to &lt;strong&gt;Go&lt;/strong&gt; — and then they're calling the result TypeScript 7.0.&lt;/p&gt;

&lt;p&gt;Let me break down what this actually means for you.&lt;/p&gt;




&lt;h2&gt;
  
  
  Wait, Why Go?
&lt;/h2&gt;

&lt;p&gt;First question everyone asks. Why not Rust? Why not WASM?&lt;/p&gt;

&lt;p&gt;The honest answer: speed of porting, not peak performance. Go's concurrency model and memory layout happened to align well with how the existing TypeScript compiler was structured. A Rust rewrite would've taken years and needed a ground-up redesign. The Go port took roughly a year, and it's architecturally identical to TypeScript 6.0's type-checking logic — same semantics, same results.&lt;/p&gt;

&lt;p&gt;Pragmatic call. I think it was the right one.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to Try It Right Now
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; @typescript/native-preview@beta
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run &lt;code&gt;tsgo&lt;/code&gt; instead of &lt;code&gt;tsc&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx tsgo &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;span class="c"&gt;# Version 7.0.0-beta&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: the package is &lt;code&gt;@typescript/native-preview&lt;/code&gt; for now. The stable release will eventually ship as the regular &lt;code&gt;typescript&lt;/code&gt; package with the normal &lt;code&gt;tsc&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;For VS Code, grab the &lt;strong&gt;TypeScript Native Preview&lt;/strong&gt; extension. It's not a rough prototype — teams at Bloomberg, Figma, Slack, Google, and others have been running pre-release builds for over a year. It's been solid for months.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Performance Is the Main Event
&lt;/h2&gt;

&lt;p&gt;The Go rewrite isn't just a compiler curiosity. It unlocks parallelization that the old JS runtime couldn't do:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;--checkers&lt;/code&gt;&lt;/strong&gt; controls how many type-checking workers run in parallel (default: 4). Bigger codebases on beefy machines can push this higher. CI runners with limited cores should drop it down.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;--builders&lt;/code&gt;&lt;/strong&gt; controls parallel project reference builds — a big deal for monorepos. Combined with &lt;code&gt;--checkers&lt;/code&gt;, it multiplies. &lt;code&gt;--checkers 4 --builders 4&lt;/code&gt; = up to 16 type-checkers running simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;--singleThreaded&lt;/code&gt;&lt;/strong&gt; if you need to debug or benchmark against TypeScript 6 without parallelism noise.&lt;/p&gt;

&lt;p&gt;The team reports ~10x speedups on large codebases. Based on what early adopters are saying publicly, that tracks.&lt;/p&gt;




&lt;h2&gt;
  
  
  Running 7.0 Alongside 6.0 (Without Chaos)
&lt;/h2&gt;

&lt;p&gt;This part tripped me up at first. Here's the clean way to handle it.&lt;/p&gt;

&lt;p&gt;There's a new compatibility package: &lt;code&gt;@typescript/typescript6&lt;/code&gt;. It exposes a &lt;code&gt;tsc6&lt;/code&gt; entry point, so you can run both without naming collisions.&lt;/p&gt;

&lt;p&gt;If you use tools like &lt;code&gt;typescript-eslint&lt;/code&gt; that peer-depend on &lt;code&gt;typescript&lt;/code&gt; directly, do this in your &lt;code&gt;package.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"devDependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"typescript"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npm:@typescript/typescript6@^6.0.0"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This aliases the &lt;code&gt;typescript&lt;/code&gt; package to 6.0, so your existing tooling stays happy while you experiment with &lt;code&gt;tsgo&lt;/code&gt; on the side.&lt;/p&gt;




&lt;h2&gt;
  
  
  Breaking Changes — The Ones That Will Actually Bite You
&lt;/h2&gt;

&lt;p&gt;TypeScript 7.0 adopts 6.0's defaults as hard requirements. A lot of these were opt-in before. Now they're just on, with no escape hatch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Defaults that changed:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;strict&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt; by default&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;module&lt;/code&gt; defaults to &lt;code&gt;esnext&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;noUncheckedSideEffectImports&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;types&lt;/code&gt; defaults to &lt;code&gt;[]&lt;/code&gt; — your &lt;code&gt;@types/node&lt;/code&gt; won't be picked up automatically anymore&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The &lt;code&gt;rootDir&lt;/code&gt; change is subtle but will catch you:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If your &lt;code&gt;tsconfig.json&lt;/code&gt; sits outside your &lt;code&gt;src/&lt;/code&gt; folder (pretty common), you need to add this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"rootDir"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./src"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"include"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"./src"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The &lt;code&gt;types&lt;/code&gt; change will also catch you:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"types"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"node"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"jest"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List every &lt;code&gt;@types&lt;/code&gt; package your project needs explicitly. No more implicit globals from everything in your &lt;code&gt;node_modules/@types&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Things that are just gone:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;target: es5&lt;/code&gt; — not supported&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;moduleResolution: node&lt;/code&gt; / &lt;code&gt;node10&lt;/code&gt; — use &lt;code&gt;nodenext&lt;/code&gt; or &lt;code&gt;bundler&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;module: amd&lt;/code&gt;, &lt;code&gt;umd&lt;/code&gt;, &lt;code&gt;systemjs&lt;/code&gt;, &lt;code&gt;none&lt;/code&gt; — gone&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;baseUrl&lt;/code&gt; — use &lt;code&gt;paths&lt;/code&gt; relative to the project root instead&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;downlevelIteration&lt;/code&gt; — gone&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're still on any of these, migrating to TypeScript 6.0 first will make the 7.0 transition cleaner.&lt;/p&gt;




&lt;h2&gt;
  
  
  JavaScript Support Got a Full Rethink
&lt;/h2&gt;

&lt;p&gt;This one flew under my radar until I read the details. TypeScript 7.0 rewrites how &lt;code&gt;.js&lt;/code&gt; files are handled — moving away from Closure-style JSDoc support toward patterns consistent with &lt;code&gt;.ts&lt;/code&gt; files.&lt;/p&gt;

&lt;p&gt;Key changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;@enum&lt;/code&gt; is no longer special — you need &lt;code&gt;@typedef&lt;/code&gt; instead&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@class&lt;/code&gt; on a function doesn't make it a constructor anymore — use a class declaration&lt;/li&gt;
&lt;li&gt;Closure-style function syntax like &lt;code&gt;function(string): void&lt;/code&gt; is dropped — use &lt;code&gt;(s: string) =&amp;gt; void&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;values&lt;/code&gt; can't be used where types are expected — use &lt;code&gt;typeof someValue&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have a pure-JS codebase that relied on TypeScript's JSDoc inference, check the &lt;a href="https://github.com/microsoft/TypeScript-Go" rel="noopener noreferrer"&gt;CHANGES.md&lt;/a&gt; before upgrading.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Still Missing
&lt;/h2&gt;

&lt;p&gt;The beta label is real, but it's not hiding a disaster — it's flagging a few known gaps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No stable programmatic API yet (that's TypeScript 7.1 at earliest)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--watch&lt;/code&gt; mode is less efficient than it'll eventually be&lt;/li&gt;
&lt;li&gt;Some VS Code features are still coming: semantics-enhanced highlighting, more granular import commands&lt;/li&gt;
&lt;li&gt;Declaration file emit from &lt;code&gt;.js&lt;/code&gt; files is still being finished&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you depend on the TypeScript compiler API for custom tooling, wait for 7.1. For everything else — type-checking in CI, editor experience, build times — 7.0 Beta is ready.&lt;/p&gt;




&lt;h2&gt;
  
  
  My Take
&lt;/h2&gt;

&lt;p&gt;The Go port is a genuinely impressive engineering decision. Not the most glamorous language choice, not the theoretical peak, but it shipped in about a year and already works on multi-million line codebases.&lt;/p&gt;

&lt;p&gt;The breaking changes are real, but most of them were coming anyway. TypeScript 6.0 gave everyone a year to see them coming. If you've been keeping up with releases, 7.0 should feel like a minor migration with a huge performance payoff.&lt;/p&gt;

&lt;p&gt;If you haven't touched your &lt;code&gt;tsconfig.json&lt;/code&gt; in two years and still have &lt;code&gt;moduleResolution: node&lt;/code&gt; in there... you have some cleanup to do. But that cleanup was overdue regardless of whether TypeScript 7 existed.&lt;/p&gt;

&lt;p&gt;Try it today:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; @typescript/native-preview@beta
npx tsgo &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it on something real and let the speed be someone else's excuse to finally upgrade the old config.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Found issues? The team wants feedback at the &lt;a href="https://github.com/microsoft/typescript-go" rel="noopener noreferrer"&gt;microsoft/typescript-go&lt;/a&gt; issue tracker — not the main TypeScript repo. That distinction matters during the beta.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>go</category>
      <category>programming</category>
    </item>
    <item>
      <title>Single Server Setup</title>
      <dc:creator>Gouranga Das Samrat</dc:creator>
      <pubDate>Wed, 03 Jun 2026 02:00:00 +0000</pubDate>
      <link>https://dev.to/gouranga-das-khulna/single-server-setup-20il</link>
      <guid>https://dev.to/gouranga-das-khulna/single-server-setup-20il</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;One-liner:&lt;/strong&gt; The simplest possible architecture — one machine running everything. Great for starting out, but a single point of failure.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📌 What Is It?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Browser] ─── HTTP ──► [Single Server]
                          ├── Web Server (Nginx/Apache)
                          ├── App Code (Node/Python/Java)
                          └── Database (MySQL/PostgreSQL)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One machine handles everything: web serving, business logic, database.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ When It's Fine
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Prototype / MVP stage&lt;/li&gt;
&lt;li&gt;&amp;lt;1,000 daily users&lt;/li&gt;
&lt;li&gt;Internal tool / side project&lt;/li&gt;
&lt;li&gt;Learning / development&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ❌ Problems
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Problem&lt;/th&gt;
&lt;th&gt;Impact&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SPOF&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Server dies → everything down&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;No scaling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Can't add more machines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Resource contention&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;App and DB fight for CPU/RAM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Hard to update&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Any deploy = full downtime&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🚀 First Step: Separate App &amp;amp; DB
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Browser] → [App Server] → [DB Server]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can scale each independently.&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>networking</category>
      <category>backend</category>
    </item>
    <item>
      <title>DNS — Domain Name System</title>
      <dc:creator>Gouranga Das Samrat</dc:creator>
      <pubDate>Mon, 01 Jun 2026 02:00:00 +0000</pubDate>
      <link>https://dev.to/gouranga-das-khulna/dns-domain-name-system-535c</link>
      <guid>https://dev.to/gouranga-das-khulna/dns-domain-name-system-535c</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;One-liner:&lt;/strong&gt; DNS is the internet's phone book — it translates human-readable domain names (google.com) into machine-readable IP addresses (142.250.195.78).&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📌 Why DNS Exists
&lt;/h2&gt;

&lt;p&gt;Computers communicate using &lt;strong&gt;IP addresses&lt;/strong&gt; (numbers), but humans remember &lt;strong&gt;names&lt;/strong&gt;. DNS bridges this gap.&lt;/p&gt;

&lt;p&gt;Without DNS, you'd have to type &lt;code&gt;142.250.195.78&lt;/code&gt; instead of &lt;code&gt;google.com&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔍 DNS Resolution — Step by Step
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You type: www.google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Browser Cache&lt;/strong&gt; — Did I look this up recently? (TTL-based)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OS Cache / hosts file&lt;/strong&gt; — &lt;code&gt;/etc/hosts&lt;/code&gt; on Linux/Mac&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recursive Resolver&lt;/strong&gt; (your ISP or 8.8.8.8) — The middleman&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Root Name Server&lt;/strong&gt; — Knows who handles &lt;code&gt;.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TLD Name Server&lt;/strong&gt; — Knows who handles &lt;code&gt;google.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authoritative Name Server&lt;/strong&gt; — Returns the final IP address&lt;/li&gt;
&lt;li&gt;Response cached at each level with a &lt;strong&gt;TTL&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🗂️ DNS Record Types
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Record&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;A&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Domain → IPv4 address&lt;/td&gt;
&lt;td&gt;&lt;code&gt;google.com → 142.250.195.78&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AAAA&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Domain → IPv6 address&lt;/td&gt;
&lt;td&gt;&lt;code&gt;google.com → 2607:f8b0::...&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;CNAME&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Alias → another domain&lt;/td&gt;
&lt;td&gt;&lt;code&gt;www.google.com → google.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MX&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mail server for domain&lt;/td&gt;
&lt;td&gt;&lt;code&gt;google.com → smtp.google.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;NS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Name server for domain&lt;/td&gt;
&lt;td&gt;&lt;code&gt;google.com → ns1.google.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;TXT&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Arbitrary text (SPF, verification)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;v=spf1 include:...&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;PTR&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Reverse lookup (IP → domain)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;142.250.195.78 → google.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SOA&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Start of Authority — zone metadata&lt;/td&gt;
&lt;td&gt;Serial, TTL defaults&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  ⏱️ TTL (Time to Live)
&lt;/h2&gt;

&lt;p&gt;TTL controls how long a DNS record is &lt;strong&gt;cached&lt;/strong&gt; before being re-fetched.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;TTL&lt;/th&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;60s&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Frequent changes (A/B deployments)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;300s&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Default for most records&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;86400s&lt;/code&gt; (1 day)&lt;/td&gt;
&lt;td&gt;Stable records (MX, NS)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;⚠️ Before migrating servers: lower TTL to 60s first, wait for propagation, then change IP.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🌍 DNS Hierarchy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;               Root (.)
              /    |    \
          .com   .org   .io
          /
      google.com
      /         \
  www           mail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔄 DNS Caching Layers
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser Cache (seconds-minutes)
    ↓ miss
OS / hosts file
    ↓ miss
Recursive Resolver (ISP / 8.8.8.8)  ← caches for TTL
    ↓ miss
Root → TLD → Authoritative
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🛡️ DNS Security
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Threat&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Defense&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;DNS Spoofing&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Attacker poisons cache with fake records&lt;/td&gt;
&lt;td&gt;DNSSEC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;DNS Hijacking&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;ISP/government redirects queries&lt;/td&gt;
&lt;td&gt;Use encrypted DNS (DoH, DoT)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;DDoS on DNS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Flood resolver to take down domains&lt;/td&gt;
&lt;td&gt;Anycast DNS (Cloudflare, AWS Route 53)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DNSSEC&lt;/strong&gt; — Cryptographically signs DNS records&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DoH (DNS over HTTPS)&lt;/strong&gt; — Encrypts DNS queries&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DoT (DNS over TLS)&lt;/strong&gt; — Alternative encryption standard&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚡ DNS in System Design
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Load Balancing via DNS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;api.myapp.com  →  [DNS Round Robin]
                  → 10.0.0.1
                  → 10.0.0.2
                  → 10.0.0.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simple but no health checks — if a server dies, DNS still routes to it until TTL expires.&lt;/p&gt;

&lt;h3&gt;
  
  
  GeoDNS
&lt;/h3&gt;

&lt;p&gt;Different IPs returned based on user's location:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;api.myapp.com from India → 13.235.x.x (Mumbai)
api.myapp.com from US   → 54.144.x.x (Virginia)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Failover via DNS
&lt;/h3&gt;

&lt;p&gt;Change A record to backup server when primary fails. But limited by TTL propagation delay.&lt;/p&gt;




&lt;h2&gt;
  
  
  🏢 Popular DNS Providers
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Cloudflare&lt;/strong&gt; (1.1.1.1)&lt;/td&gt;
&lt;td&gt;Fast, privacy-focused, free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Google&lt;/strong&gt; (8.8.8.8)&lt;/td&gt;
&lt;td&gt;Reliable, global&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AWS Route 53&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Deep AWS integration, health checks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Azure DNS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Azure ecosystem&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔑 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;DNS resolution is &lt;strong&gt;hierarchical and cached&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Lower TTL before changing server IPs to avoid downtime&lt;/li&gt;
&lt;li&gt;DNS alone is a bad load balancer (no health checks)&lt;/li&gt;
&lt;li&gt;Modern DNS services (Cloudflare, Route 53) offer much more than just name resolution&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>systemdesign</category>
      <category>networking</category>
      <category>network</category>
    </item>
    <item>
      <title>PgBouncer: Effectively Managing Your PostgreSQL Connection Pool</title>
      <dc:creator>Gouranga Das Samrat</dc:creator>
      <pubDate>Sun, 31 May 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/gouranga-das-khulna/pgbouncer-effectively-managing-your-postgresql-connection-pool-587m</link>
      <guid>https://dev.to/gouranga-das-khulna/pgbouncer-effectively-managing-your-postgresql-connection-pool-587m</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Why HikariCP might not be enough and where PgBouncer steps in.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  1. Why are Connections Expensive in PostgreSQL?
&lt;/h2&gt;

&lt;p&gt;PostgreSQL forks a separate process at the operating system level for each new connection. This differs from the thread-based model of other databases like MySQL. Each idle connection consumes approximately 5–10 MB of RAM (with default work_mem; this value can be much higher for active queries).&lt;/p&gt;

&lt;p&gt;Consequently, the math is simple:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7sy9ebf2py3psoj9eyxy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7sy9ebf2py3psoj9eyxy.png" alt="captionless image" width="620" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PostgreSQL’s default max_connections value is 100. While increasing this might work in the short term, it directly increases RAM consumption and complicates PostgreSQL’s shared memory management. The correct way to scale the number of connections is to use fewer connections but use them efficiently — that’s exactly where a connection pooler comes in.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. What is PgBouncer and How Does it Work?
&lt;/h2&gt;

&lt;p&gt;PgBouncer is a lightweight connection pooling proxy that sits between your application and PostgreSQL. Because it’s written in C, its memory footprint is minimal. It fully supports the PostgreSQL wire protocol, making it indistinguishable from PostgreSQL to applications.&lt;/p&gt;

&lt;p&gt;Architecturally, it works like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[App instance 1] \
[App instance 2] ---&amp;gt; [PgBouncer :6432] ---&amp;gt; [PostgreSQL :5432]
[App instance 3] /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;  The application connects to PgBouncer as if it were connecting to PostgreSQL (port 6432). PgBouncer allocates an existing PostgreSQL connection from its pool. When the operation (transaction or session) finishes, the connection is returned to the pool.&lt;/li&gt;
&lt;li&gt;  Effect: 500 application connections → PgBouncer → only 20 actual PostgreSQL connections. From PostgreSQL’s perspective, there are only 20 clients.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. PgBouncer Pooling Modes
&lt;/h2&gt;

&lt;p&gt;PgBouncer has three main modes that determine when connections are returned to the pool. Choosing the right mode for your needs is critical:&lt;/p&gt;

&lt;h2&gt;
  
  
  Session Pooling
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Connection Assignment:&lt;/strong&gt; A database connection is allocated when the client (application) connects.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Return Process:&lt;/strong&gt; That database connection remains busy until the client completely closes the connection.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Ideal Use Case:&lt;/strong&gt; Stateful sessions requiring things like LISTEN/NOTIFY or the use of temporary tables.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Transaction Pooling (Recommended)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Connection Assignment:&lt;/strong&gt; A connection is allocated when a database transaction begins.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Return Process:&lt;/strong&gt; The connection returns to the pool immediately after the COMMIT or ROLLBACK command runs.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Ideal Use Case:&lt;/strong&gt; This is the most efficient mode for most web applications and microservices architectures.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Statement Pooling
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Connection Assignment:&lt;/strong&gt; A separate connection is allocated for each individual SQL query (statement).&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Return Process:&lt;/strong&gt; The connection becomes free as soon as the query runs and returns results.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Ideal Use Case:&lt;/strong&gt; Systems running only with “Autocommit.”&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Warning:&lt;/strong&gt; In this mode, BEGIN…COMMIT blocks (transactions containing multiple queries) are not supported.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ⚠️ Transaction Mode Gotcha: Prepared Statements
&lt;/h2&gt;

&lt;p&gt;There’s an important limitation in Transaction mode: server-side prepared statements don’t work. The reason is simple — each transaction can go to a different backend connection, so a statement created with PREPARE on one connection cannot be accessed with EXECUTE on another connection.&lt;/p&gt;

&lt;p&gt;Furthermore, SET commands and session variables are not preserved outside the active transaction.&lt;/p&gt;

&lt;p&gt;The solution — disable prepared statements at the driver level:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;pgx (Go):&lt;/strong&gt; Add default_query_exec_mode=simple_protocol to the connection string.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;JDBC (Java):&lt;/strong&gt; Set prepareThreshold=0.&lt;/li&gt;
&lt;li&gt;  Alternatively, you can use Session mode, but multiplexing efficiency will decrease.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Note:&lt;/strong&gt; The server_reset_query = DISCARD ALL parameter is ineffective in transaction mode — PgBouncer runs this command only in session mode.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. What’s the Difference with HikariCP?
&lt;/h2&gt;

&lt;p&gt;HikariCP is a widely used in-application connection pool in the Java/Spring Boot ecosystem. It aims for the same goal as PgBouncer — managing connections — but their fundamental approaches differ.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flsuq5os0b14sp60rg3b0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flsuq5os0b14sp60rg3b0.png" alt="captionless image" width="800" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Critical difference: HikariCP keeps a separate pool for each application instance. If you’re running 10 pods and each pod opens 20 connections, 200 connections in total go to PostgreSQL. Because PgBouncer is centralized, these 200 connections are reduced to 20 actual connections in the pool.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. When is PgBouncer Needed?
&lt;/h2&gt;

&lt;p&gt;If you’re running a single application instance, in-application pooling is mostly sufficient. PgBouncer becomes critical in the following scenarios:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;High Number of Application Instances (Kubernetes):&lt;/strong&gt; When each pod opens its own pool, the max_connections limit is quickly exceeded.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Polyglot Architecture:&lt;/strong&gt; If Go, Python, and Node.js services use the same DB, a centralized pool is a must.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Serverless (Lambda, Cloud Run):&lt;/strong&gt; Each invocation tends to open a new connection; PgBouncer absorbs this load.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Error Management:&lt;/strong&gt; If you see FATAL: too many connections errors, this is an alarm state.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. Pros and Cons
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Pros:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  Dramatically reduces the number of connections, lowering RAM load.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Pause mode:&lt;/strong&gt; Holds connections during maintenance so the application doesn’t get errors.&lt;/li&gt;
&lt;li&gt;  Language and framework independent.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cons:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  Additional infrastructure component (Maintenance overhead).&lt;/li&gt;
&lt;li&gt;  Limitations on prepared statements and session variables in Transaction mode.&lt;/li&gt;
&lt;li&gt;  Requires a redundant setup for HA (High Availability).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  7. Conclusion: Should I Use It?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Single application instance?
└── Yes → HikariCP / pgx pool is sufficient.
└── No → How many instances?
├── 3–5 pods → Monitor max_connections.
└── 10+ pods or serverless → PgBouncer is a must.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;PgBouncer is a small binary that solves a big problem. When every new service you add to your infrastructure loads directly onto PostgreSQL, your database finds it hard to breathe. Anticipating this problem in advance is always better than managing a crisis in production.&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>sql</category>
      <category>database</category>
    </item>
    <item>
      <title>IP &amp; Networking Basics</title>
      <dc:creator>Gouranga Das Samrat</dc:creator>
      <pubDate>Sat, 30 May 2026 02:00:00 +0000</pubDate>
      <link>https://dev.to/gouranga-das-khulna/ip-networking-basics-5h8e</link>
      <guid>https://dev.to/gouranga-das-khulna/ip-networking-basics-5h8e</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;One-liner:&lt;/strong&gt; IP (Internet Protocol) is the addressing system of the internet — every device gets a unique address, and packets are routed between them.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📌 IP Addresses
&lt;/h2&gt;

&lt;h3&gt;
  
  
  IPv4
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;32-bit address → 2³² = ~4.3 billion addresses (running out!)&lt;/li&gt;
&lt;li&gt;Format: &lt;code&gt;192.168.1.1&lt;/code&gt; (four 8-bit octets, 0–255)&lt;/li&gt;
&lt;li&gt;Private ranges (not routable on internet):

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;10.0.0.0/8&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;172.16.0.0/12&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;192.168.0.0/16&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  IPv6
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;128-bit address → 2¹²⁸ = ~340 undecillion addresses&lt;/li&gt;
&lt;li&gt;Format: &lt;code&gt;2001:0db8:85a3:0000:0000:8a2e:0370:7334&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Solves IPv4 exhaustion problem&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔢 Ports
&lt;/h2&gt;

&lt;p&gt;A port is a &lt;strong&gt;logical channel&lt;/strong&gt; on an IP address. One server can run many services on different ports.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Port&lt;/th&gt;
&lt;th&gt;Service&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;SSH&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;td&gt;SMTP (email)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;53&lt;/td&gt;
&lt;td&gt;DNS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;80&lt;/td&gt;
&lt;td&gt;HTTP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;443&lt;/td&gt;
&lt;td&gt;HTTPS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3306&lt;/td&gt;
&lt;td&gt;MySQL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5432&lt;/td&gt;
&lt;td&gt;PostgreSQL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6379&lt;/td&gt;
&lt;td&gt;Redis&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;27017&lt;/td&gt;
&lt;td&gt;MongoDB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Ports 0–1023 = well-known (require root). Ports 1024–65535 = available.&lt;/p&gt;




&lt;h2&gt;
  
  
  📦 TCP vs UDP
&lt;/h2&gt;

&lt;h3&gt;
  
  
  TCP (Transmission Control Protocol)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Connection-oriented — 3-way handshake (SYN, SYN-ACK, ACK)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reliable&lt;/strong&gt; — guarantees delivery, ordering, error checking&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Slower&lt;/strong&gt; — overhead of acknowledgments&lt;/li&gt;
&lt;li&gt;Use: HTTP, HTTPS, SSH, databases&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  UDP (User Datagram Protocol)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Connectionless — just fire and forget&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unreliable&lt;/strong&gt; — no delivery guarantee, no ordering&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast&lt;/strong&gt; — no handshake overhead&lt;/li&gt;
&lt;li&gt;Use: DNS, video streaming, gaming, VoIP
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TCP: SYN ──► SYN-ACK ◄── ACK (connection established, then data)
UDP: DATA ──► (no response needed, no connection)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🏠 NAT (Network Address Translation)
&lt;/h2&gt;

&lt;p&gt;Your router at home has ONE public IP. All your devices share it via NAT.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Device (192.168.1.5:1234) ──► Router ──► Internet (Public IP:5000)
                               NAT table: 192.168.1.5:1234 ↔ PublicIP:5000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is why IPv4 hasn't completely run out — NAT multiplies addresses.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 OSI Model (7 Layers)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;Application&lt;/td&gt;
&lt;td&gt;HTTP, DNS, SSH&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Presentation&lt;/td&gt;
&lt;td&gt;TLS, encryption&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Session&lt;/td&gt;
&lt;td&gt;Session management&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Transport&lt;/td&gt;
&lt;td&gt;TCP, UDP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Network&lt;/td&gt;
&lt;td&gt;IP routing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Data Link&lt;/td&gt;
&lt;td&gt;Ethernet, MAC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Physical&lt;/td&gt;
&lt;td&gt;Cables, WiFi signals&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For system design: mostly care about L3 (IP), L4 (TCP/UDP), L7 (HTTP).&lt;/p&gt;




&lt;h2&gt;
  
  
  🔑 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Every server has an IP + port — that's how clients find it&lt;/li&gt;
&lt;li&gt;TCP = reliable but slower; UDP = fast but unreliable&lt;/li&gt;
&lt;li&gt;Load balancers can operate at L4 (TCP) or L7 (HTTP)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>systemdesign</category>
      <category>networking</category>
      <category>network</category>
    </item>
    <item>
      <title>HTTP &amp; HTTPS</title>
      <dc:creator>Gouranga Das Samrat</dc:creator>
      <pubDate>Thu, 28 May 2026 02:00:00 +0000</pubDate>
      <link>https://dev.to/gouranga-das-khulna/http-https-45m6</link>
      <guid>https://dev.to/gouranga-das-khulna/http-https-45m6</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;One-liner:&lt;/strong&gt; HTTP is the protocol for transferring data on the web; HTTPS adds TLS encryption so that data can't be snooped or tampered with in transit.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📌 HTTP — HyperText Transfer Protocol
&lt;/h2&gt;

&lt;p&gt;HTTP is a &lt;strong&gt;stateless, request-response&lt;/strong&gt; application-layer protocol. Every interaction is independent — the server has no memory of previous requests by default.&lt;/p&gt;

&lt;h3&gt;
  
  
  Request Structure
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="nf"&gt;GET&lt;/span&gt; &lt;span class="nn"&gt;/api/users/42&lt;/span&gt; &lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt;
&lt;span class="na"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api.example.com&lt;/span&gt;
&lt;span class="na"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Bearer eyJhbGci...&lt;/span&gt;
&lt;span class="na"&gt;Accept&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;application/json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Response Structure
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt; &lt;span class="m"&gt;200&lt;/span&gt; &lt;span class="ne"&gt;OK&lt;/span&gt;
&lt;span class="na"&gt;Content-Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;application/json&lt;/span&gt;
&lt;span class="na"&gt;Cache-Control&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;max-age=3600&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Rahul"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔢 HTTP Methods
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Body?&lt;/th&gt;
&lt;th&gt;Idempotent?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GET&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Retrieve resource&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;POST&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create resource&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PUT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Replace resource entirely&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PATCH&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Partially update resource&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DELETE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Remove resource&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;HEAD&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Like GET but no body&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;OPTIONS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ask what methods are allowed&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Idempotent&lt;/strong&gt; = calling it N times has same effect as calling it once.&lt;/p&gt;




&lt;h2&gt;
  
  
  📊 HTTP Status Codes
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Range&lt;/th&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Examples&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1xx&lt;/td&gt;
&lt;td&gt;Informational&lt;/td&gt;
&lt;td&gt;&lt;code&gt;100 Continue&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2xx&lt;/td&gt;
&lt;td&gt;Success&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;200 OK&lt;/code&gt;, &lt;code&gt;201 Created&lt;/code&gt;, &lt;code&gt;204 No Content&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3xx&lt;/td&gt;
&lt;td&gt;Redirection&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;301 Moved Permanently&lt;/code&gt;, &lt;code&gt;304 Not Modified&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4xx&lt;/td&gt;
&lt;td&gt;Client Error&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;400 Bad Request&lt;/code&gt;, &lt;code&gt;401 Unauthorized&lt;/code&gt;, &lt;code&gt;403 Forbidden&lt;/code&gt;, &lt;code&gt;404 Not Found&lt;/code&gt;, &lt;code&gt;429 Too Many Requests&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5xx&lt;/td&gt;
&lt;td&gt;Server Error&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;500 Internal Server Error&lt;/code&gt;, &lt;code&gt;502 Bad Gateway&lt;/code&gt;, &lt;code&gt;503 Service Unavailable&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔄 HTTP Versions
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;th&gt;Key Feature&lt;/th&gt;
&lt;th&gt;Year&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;HTTP/1.0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;New TCP connection per request&lt;/td&gt;
&lt;td&gt;1996&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;HTTP/1.1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Keep-alive, persistent connections, pipelining&lt;/td&gt;
&lt;td&gt;1997&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;HTTP/2&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Multiplexing, header compression (HPACK), binary protocol&lt;/td&gt;
&lt;td&gt;2015&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;HTTP/3&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;QUIC protocol (UDP-based), 0-RTT, faster handshake&lt;/td&gt;
&lt;td&gt;2022&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  HTTP/1.1 vs HTTP/2 — Multiplexing
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP/1.1:  REQ1 ──► | wait | ◄── RES1
           REQ2 ──► | wait | ◄── RES2   (sequential)

HTTP/2:    REQ1 ─┐         ┌─ RES1
           REQ2 ─┤─ wire ──┤─ RES2      (parallel, same connection)
           REQ3 ─┘         └─ RES3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔐 HTTPS — HTTP over TLS
&lt;/h2&gt;

&lt;p&gt;HTTPS = HTTP + &lt;strong&gt;TLS (Transport Layer Security)&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What TLS Provides
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Encryption&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data is unreadable to third parties&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Authentication&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Server proves it's who it says it is (via certificate)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Integrity&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data can't be tampered with without detection&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  TLS Handshake (Simplified)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client                          Server
  │──── ClientHello (TLS ver) ──►│
  │◄─── ServerHello + Cert ──────│
  │── Verify cert with CA ───────│ (checks certificate authority)
  │──── Key Exchange ────────────│
  │◄─── Key Exchange ────────────│
  │   [Symmetric key derived]    │
  │◄════ Encrypted data ═════════│
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  SSL vs TLS
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SSL&lt;/strong&gt; is deprecated (SSL 2.0, 3.0 — broken)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TLS 1.2&lt;/strong&gt; is widely used&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TLS 1.3&lt;/strong&gt; is modern (faster handshake, better ciphers)&lt;/li&gt;
&lt;li&gt;When people say "SSL certificate" they mean &lt;strong&gt;TLS certificate&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🍪 Cookies &amp;amp; Sessions (Handling Statelessness)
&lt;/h2&gt;

&lt;p&gt;Since HTTP is stateless, we use:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mechanism&lt;/th&gt;
&lt;th&gt;How it works&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cookies&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Server sends &lt;code&gt;Set-Cookie&lt;/code&gt; header; browser sends it back on every request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Sessions&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Server stores session data, client stores session ID in cookie&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;JWT&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Stateless token — server signs a token, client stores it (localStorage or cookie)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  📡 Long-Polling, SSE, WebSockets
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Direction&lt;/th&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;HTTP Polling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Client → Server (repeated)&lt;/td&gt;
&lt;td&gt;Simple updates, high latency&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Long Polling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Client holds connection open&lt;/td&gt;
&lt;td&gt;Chat, notifications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SSE (Server-Sent Events)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Server → Client (one way)&lt;/td&gt;
&lt;td&gt;Live scores, feeds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;WebSocket&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Bidirectional&lt;/td&gt;
&lt;td&gt;Chat apps, multiplayer games, trading&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔑 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;HTTP is &lt;strong&gt;stateless&lt;/strong&gt; — use cookies/JWT to add state&lt;/li&gt;
&lt;li&gt;Always use &lt;strong&gt;HTTPS&lt;/strong&gt; in production (free certs via Let's Encrypt)&lt;/li&gt;
&lt;li&gt;HTTP/2 gives huge performance gains via multiplexing&lt;/li&gt;
&lt;li&gt;Understand status codes cold — interviewers ask about 401 vs 403, 502 vs 503, etc.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>systemdesign</category>
      <category>networking</category>
      <category>network</category>
    </item>
    <item>
      <title>Client-Server Model</title>
      <dc:creator>Gouranga Das Samrat</dc:creator>
      <pubDate>Tue, 26 May 2026 02:00:00 +0000</pubDate>
      <link>https://dev.to/gouranga-das-khulna/client-server-model-12pj</link>
      <guid>https://dev.to/gouranga-das-khulna/client-server-model-12pj</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;One-liner:&lt;/strong&gt; A client requests resources/services, and a server responds with them. Every web interaction follows this model.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📌 What Is It?
&lt;/h2&gt;

&lt;p&gt;The client-server model is the &lt;strong&gt;foundational architecture&lt;/strong&gt; of the internet. It defines a relationship between two parties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Client&lt;/strong&gt; — the requester (browser, mobile app, CLI tool)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server&lt;/strong&gt; — the provider (web server, API server, database server)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a &lt;strong&gt;request-response&lt;/strong&gt; cycle. The client always initiates; the server always reacts.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔁 How a Request Works (Step by Step)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;You type &lt;code&gt;google.com&lt;/code&gt; in the browser&lt;/li&gt;
&lt;li&gt;Browser checks its &lt;strong&gt;local DNS cache&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;If not found → asks &lt;strong&gt;OS DNS cache&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;If not found → asks &lt;strong&gt;ISP's DNS resolver&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;DNS resolver returns the &lt;strong&gt;IP address&lt;/strong&gt; (e.g., &lt;code&gt;142.250.195.78&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Browser opens a &lt;strong&gt;TCP connection&lt;/strong&gt; to that IP on port 80/443&lt;/li&gt;
&lt;li&gt;Browser sends an &lt;strong&gt;HTTP request&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Server processes the request and sends back an &lt;strong&gt;HTTP response&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Browser renders the HTML/CSS/JS&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🧩 Key Components
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Client&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Initiates requests (browser, app)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Server&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Handles requests, returns responses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Protocol&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Rules for communication (HTTP, WebSocket, gRPC)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;IP Address&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Unique address of the server on the network&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Port&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Channel on the IP (80=HTTP, 443=HTTPS, 3306=MySQL)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🌐 Types of Clients
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Thin Client&lt;/strong&gt; — Only rendering/display logic (browser)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thick Client&lt;/strong&gt; — Has business logic locally (desktop apps)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile Client&lt;/strong&gt; — App that hits APIs&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔄 Communication Models
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Request-Response (HTTP)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client ──── GET /users ────► Server
Client ◄─── 200 OK + data ── Server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Long Polling
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client ──── GET /updates ──► Server (holds connection)
Server ◄─── responds ONLY when data is ready
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  WebSockets (Bi-directional)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client ◄──────────────────► Server
      (real-time, both ways)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🏗️ Single Server Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[User's Browser]
      |
      | HTTP Request
      ▼
[Web + App Server] ──── reads/writes ────► [Database]
      |
      | HTTP Response
      ▼
[User's Browser]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Problems with a single server:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Single Point of Failure (SPOF)&lt;/li&gt;
&lt;li&gt;Can't scale horizontally&lt;/li&gt;
&lt;li&gt;Web traffic + DB on same machine = resource contention&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📊 Real-World Analogy
&lt;/h2&gt;

&lt;p&gt;Think of it like a &lt;strong&gt;restaurant&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Client&lt;/strong&gt; = Customer placing an order&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server&lt;/strong&gt; = Waiter taking the order&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database&lt;/strong&gt; = Kitchen preparing the food&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Protocol&lt;/strong&gt; = Language/menu used to communicate&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚠️ Limitations of Simple Client-Server
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Problem&lt;/th&gt;
&lt;th&gt;Impact&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Single server → SPOF&lt;/td&gt;
&lt;td&gt;Entire system goes down&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No caching&lt;/td&gt;
&lt;td&gt;Every request hits DB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stateful server&lt;/td&gt;
&lt;td&gt;Hard to scale horizontally&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tight coupling&lt;/td&gt;
&lt;td&gt;Hard to change one part&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔑 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The client always &lt;strong&gt;initiates&lt;/strong&gt; the connection&lt;/li&gt;
&lt;li&gt;HTTP is &lt;strong&gt;stateless&lt;/strong&gt; — server doesn't remember previous requests&lt;/li&gt;
&lt;li&gt;Modern systems have &lt;strong&gt;many layers&lt;/strong&gt; between client and actual data&lt;/li&gt;
&lt;li&gt;Every "server" is just another computer listening on a port&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>systemdesign</category>
      <category>networking</category>
      <category>network</category>
    </item>
    <item>
      <title>Turning PostgreSQL Into an Integration Engine</title>
      <dc:creator>Gouranga Das Samrat</dc:creator>
      <pubDate>Sun, 24 May 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/gouranga-das-khulna/turning-postgresql-into-an-integration-engine-36ig</link>
      <guid>https://dev.to/gouranga-das-khulna/turning-postgresql-into-an-integration-engine-36ig</guid>
      <description>&lt;p&gt;&lt;em&gt;I wanted to see how far PostgreSQL extensibility could go.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most People Think PostgreSQL Is Just a Database, but PostgreSQL is actually a programmable system. With extensions and procedural languages, it can do far more than simply store and retrieve data.&lt;/p&gt;

&lt;p&gt;Recently I started thinking about a simple idea:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What if PostgreSQL could call REST APIs directly from SQL queries?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of always relying on a backend service to act as an integration layer, some interactions with external systems might happen directly from the database.&lt;/p&gt;

&lt;p&gt;This idea led me to run a small technical experiment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Idea
&lt;/h2&gt;

&lt;p&gt;In most architectures today, integrations usually look like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database → Backend Service → External API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The backend service is responsible for calling APIs, processing responses, and storing results in the database.&lt;/p&gt;

&lt;p&gt;But PostgreSQL has something many people forget: &lt;strong&gt;extensibility&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  procedural languages (PL/Python, PL/pgSQL, etc.)&lt;/li&gt;
&lt;li&gt;  native extensions written in C&lt;/li&gt;
&lt;li&gt;  custom SQL-callable functions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This raises an interesting possibility:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Could PostgreSQL itself perform HTTP requests?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If that is possible, SQL queries could potentially interact with external services during execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technical Possibility
&lt;/h2&gt;

&lt;p&gt;PostgreSQL allows developers to extend the database with custom functions.&lt;/p&gt;

&lt;p&gt;These functions can be implemented using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  procedural languages (Python, Perl, etc.)&lt;/li&gt;
&lt;li&gt;  native extensions written in C&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That means we can implement a function capable of performing HTTP requests and expose it directly to SQL.&lt;/p&gt;

&lt;p&gt;Conceptually, the goal is to enable something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;http_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s1"&gt;'httpbin.org'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'/headers'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'GET'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'{"Authorization":"Bearer demo-token"}'&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;jsonb&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;30&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query sends an HTTPS request to an external endpoint and returns the response to the SQL session.&lt;/p&gt;

&lt;p&gt;Because headers are passed as JSON, they can also be dynamically constructed inside SQL queries.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Experiment &amp;amp; Result
&lt;/h2&gt;

&lt;p&gt;To explore the idea, I implemented two different versions of the HTTP function.&lt;/p&gt;

&lt;h3&gt;
  
  
  Experiment 1 — PL/Python Implementation
&lt;/h3&gt;

&lt;p&gt;The first version uses &lt;strong&gt;PL/Python&lt;/strong&gt;, one of PostgreSQL’s supported procedural languages.&lt;/p&gt;

&lt;p&gt;Using Python inside PostgreSQL makes it relatively easy to perform HTTP requests using common Python libraries.&lt;/p&gt;

&lt;p&gt;Example usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://httpbin.org/post'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'{"data":{"a": 1,"b": 2}}'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The query triggers an HTTPS request and the response is returned to the SQL client.&lt;/p&gt;

&lt;p&gt;To simplify experimentation, this version was packaged as a &lt;strong&gt;Docker image with PostgreSQL and PL/Python preconfigured&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Experiment 2 — Native PostgreSQL extension
&lt;/h3&gt;

&lt;p&gt;The second experiment goes deeper by implementing the HTTP functionality as a &lt;strong&gt;native PostgreSQL extension written in C&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Extensions written in C integrate directly with the PostgreSQL engine and offer more control over performance and behavior.&lt;/p&gt;

&lt;p&gt;This version explores how HTTP capabilities could potentially be embedded closer to the database layer.&lt;/p&gt;

&lt;p&gt;Example usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;http_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s1"&gt;'httpbin.org'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'/headers'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'GET'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'{"Authorization":"Bearer demo-token"}'&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;jsonb&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;30&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Development Process
&lt;/h2&gt;

&lt;p&gt;Another interesting aspect of this experiment was the development workflow.&lt;/p&gt;

&lt;p&gt;I intentionally used &lt;strong&gt;AI-assisted development&lt;/strong&gt; (or what I like to call &lt;em&gt;vibe coding&lt;/em&gt;) while building the project, especially when working with PostgreSQL extension code in C.&lt;/p&gt;

&lt;p&gt;AI helped accelerate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  extension scaffolding&lt;/li&gt;
&lt;li&gt;  exploration of low-level C patterns&lt;/li&gt;
&lt;li&gt;  rapid prototyping&lt;/li&gt;
&lt;li&gt;  documentation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It was interesting to see how AI could help speed up &lt;strong&gt;systems-level experimentation&lt;/strong&gt;, not just application development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Design Considerations
&lt;/h2&gt;

&lt;p&gt;Allowing a database to call external APIs raises several architectural considerations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Latency
&lt;/h3&gt;

&lt;p&gt;Database queries are expected to be fast and predictable.&lt;br&gt;
External API calls introduce network latency, which can slow down query execution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transaction Behavior
&lt;/h3&gt;

&lt;p&gt;If an HTTP request is executed inside a transaction, the transaction might be blocked while waiting for the external service.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reliability
&lt;/h3&gt;

&lt;p&gt;External APIs can fail, timeout, or become unavailable.&lt;br&gt;
Proper timeout handling and error management are essential.&lt;/p&gt;

&lt;h3&gt;
  
  
  Security
&lt;/h3&gt;

&lt;p&gt;Allowing outbound HTTP requests from the database may introduce security concerns, especially if unrestricted endpoints are allowed.&lt;/p&gt;

&lt;p&gt;Because of these considerations, this approach should not replace backend services in most production architectures.&lt;/p&gt;

&lt;p&gt;However, it can still be useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  experimentation&lt;/li&gt;
&lt;li&gt;  rapid integration prototypes&lt;/li&gt;
&lt;li&gt;  certain data enrichment scenarios&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This experiment started with a simple question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can the database participate directly in integration workflows?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PostgreSQL’s extensibility makes it a surprisingly powerful playground for exploring ideas like this.&lt;/p&gt;

&lt;p&gt;And with modern AI-assisted workflows, experimenting with systems-level concepts has become significantly faster.&lt;/p&gt;

&lt;p&gt;I’m still exploring how far the idea of &lt;strong&gt;database-driven integrations&lt;/strong&gt; can go.&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>sql</category>
      <category>database</category>
    </item>
    <item>
      <title>System Design — Beginner to Advance: Complete Curriculum</title>
      <dc:creator>Gouranga Das Samrat</dc:creator>
      <pubDate>Tue, 19 May 2026 02:00:00 +0000</pubDate>
      <link>https://dev.to/gouranga-das-khulna/system-design-beginner-to-advance-complete-curriculum-84k</link>
      <guid>https://dev.to/gouranga-das-khulna/system-design-beginner-to-advance-complete-curriculum-84k</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Every topic, every date. Bookmark this and follow along.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you've ever wondered how Netflix streams to millions, how Twitter handles trends, or how Google serves search results in milliseconds — this series is for you.&lt;/p&gt;

&lt;p&gt;This is a structured, week-by-week journey through System Design — from the absolute basics to production-grade distributed systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  🟢 Beginner — Foundations
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Topic&lt;/th&gt;
&lt;th&gt;Publish Date&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Client-Server Model&lt;/td&gt;
&lt;td&gt;May 26&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;IP &amp;amp; Networking Basics&lt;/td&gt;
&lt;td&gt;May 30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;HTTP &amp;amp; HTTPS&lt;/td&gt;
&lt;td&gt;May 28&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;DNS — Domain Name System&lt;/td&gt;
&lt;td&gt;Jun 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Single Server Setup&lt;/td&gt;
&lt;td&gt;Jun 3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Back of Envelope Calculations&lt;/td&gt;
&lt;td&gt;Jun 5&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔵 Intermediate — Core Building Blocks
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Topic&lt;/th&gt;
&lt;th&gt;Publish Date&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;Database Scaling&lt;/td&gt;
&lt;td&gt;Jun 7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;Consistent Hashing&lt;/td&gt;
&lt;td&gt;Jun 6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;Database Sharding&lt;/td&gt;
&lt;td&gt;Jun 13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;Read Replicas&lt;/td&gt;
&lt;td&gt;Jun 14&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;SQL vs NoSQL&lt;/td&gt;
&lt;td&gt;Jun 20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;API Gateway&lt;/td&gt;
&lt;td&gt;Jun 21&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;CDN — Content Delivery Network&lt;/td&gt;
&lt;td&gt;Jun 27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;Load Balancers&lt;/td&gt;
&lt;td&gt;Jun 28&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;Reverse Proxy&lt;/td&gt;
&lt;td&gt;Jul 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;Caching Strategies&lt;/td&gt;
&lt;td&gt;Jul 5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;17&lt;/td&gt;
&lt;td&gt;Redis&lt;/td&gt;
&lt;td&gt;Jul 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;td&gt;Message Queues (SQS)&lt;/td&gt;
&lt;td&gt;Jul 12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;19&lt;/td&gt;
&lt;td&gt;Pub-Sub (SNS) &amp;amp; Fan-out Architecture&lt;/td&gt;
&lt;td&gt;Jul 18&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;Fan-out Architecture&lt;/td&gt;
&lt;td&gt;Jul 19&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;td&gt;Microservices&lt;/td&gt;
&lt;td&gt;Jul 25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;Containers &amp;amp; Docker&lt;/td&gt;
&lt;td&gt;Jul 26&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔴 Advanced — Distributed Systems
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Topic&lt;/th&gt;
&lt;th&gt;Publish Date&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;td&gt;Data Consistency in Microservices — Saga Pattern&lt;/td&gt;
&lt;td&gt;Aug 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;24&lt;/td&gt;
&lt;td&gt;API Versioning&lt;/td&gt;
&lt;td&gt;Aug 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;td&gt;Service-to-Service Communication — gRPC vs REST&lt;/td&gt;
&lt;td&gt;Aug 8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;26&lt;/td&gt;
&lt;td&gt;Rate Limiting&lt;/td&gt;
&lt;td&gt;Aug 9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;27&lt;/td&gt;
&lt;td&gt;CAP Theorem&lt;/td&gt;
&lt;td&gt;Aug 15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;28&lt;/td&gt;
&lt;td&gt;Bloom Filters&lt;/td&gt;
&lt;td&gt;Aug 16&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;29&lt;/td&gt;
&lt;td&gt;HLD: URL Shortener (like bit.ly)&lt;/td&gt;
&lt;td&gt;Aug 22&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;HLD: Notification System&lt;/td&gt;
&lt;td&gt;Aug 23&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;31&lt;/td&gt;
&lt;td&gt;HLD: Instagram Feed&lt;/td&gt;
&lt;td&gt;Aug 29&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;32&lt;/td&gt;
&lt;td&gt;HLD: Twitter / X&lt;/td&gt;
&lt;td&gt;Aug 30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;33&lt;/td&gt;
&lt;td&gt;Authentication &amp;amp; Authorization — JWT &amp;amp; OAuth 2.0&lt;/td&gt;
&lt;td&gt;Sep 5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;34&lt;/td&gt;
&lt;td&gt;DDoS Protection &amp;amp; Rate Limiting Abuse Cases&lt;/td&gt;
&lt;td&gt;Sep 6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;35&lt;/td&gt;
&lt;td&gt;Circuit Breaker Pattern&lt;/td&gt;
&lt;td&gt;Sep 12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;td&gt;Distributed Locks&lt;/td&gt;
&lt;td&gt;Sep 13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;37&lt;/td&gt;
&lt;td&gt;Idempotency&lt;/td&gt;
&lt;td&gt;Sep 19&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;38&lt;/td&gt;
&lt;td&gt;Observability — Logs, Metrics, Tracing&lt;/td&gt;
&lt;td&gt;Sep 20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;39&lt;/td&gt;
&lt;td&gt;Service Discovery&lt;/td&gt;
&lt;td&gt;Sep 26&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;Multi-Region &amp;amp; Geo-Distribution&lt;/td&gt;
&lt;td&gt;Sep 27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;41&lt;/td&gt;
&lt;td&gt;Cost Optimization&lt;/td&gt;
&lt;td&gt;Oct 3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;42&lt;/td&gt;
&lt;td&gt;Edge Computing&lt;/td&gt;
&lt;td&gt;Oct 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;43&lt;/td&gt;
&lt;td&gt;Failure Handling &amp;amp; Resilience&lt;/td&gt;
&lt;td&gt;Oct 10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;44&lt;/td&gt;
&lt;td&gt;API Design — Advanced&lt;/td&gt;
&lt;td&gt;Oct 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;45&lt;/td&gt;
&lt;td&gt;Cache Invalidation Patterns&lt;/td&gt;
&lt;td&gt;Oct 17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;46&lt;/td&gt;
&lt;td&gt;Distributed Cron Jobs&lt;/td&gt;
&lt;td&gt;Oct 18&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;47&lt;/td&gt;
&lt;td&gt;Leader Election&lt;/td&gt;
&lt;td&gt;Oct 24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;48&lt;/td&gt;
&lt;td&gt;Rate Limiter Designs&lt;/td&gt;
&lt;td&gt;Oct 25&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  📅 How to Follow This Series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;New posts drop &lt;strong&gt;every Saturday &amp;amp; Sunday&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Start from the beginning if you're new to System Design&lt;/li&gt;
&lt;li&gt;Each post is self-contained but builds on previous ones&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Follow to get notified when each post drops.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
