<?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: Tanay Karmarkar</title>
    <description>The latest articles on DEV Community by Tanay Karmarkar (@tanay_karmarkar_fe8eb6dcd).</description>
    <link>https://dev.to/tanay_karmarkar_fe8eb6dcd</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4079742%2Fbaa87e67-2f5b-4d8a-8e5a-5d3829bd3186.jpg</url>
      <title>DEV Community: Tanay Karmarkar</title>
      <link>https://dev.to/tanay_karmarkar_fe8eb6dcd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tanay_karmarkar_fe8eb6dcd"/>
    <language>en</language>
    <item>
      <title>WTH is CAP Theorem Really?</title>
      <dc:creator>Tanay Karmarkar</dc:creator>
      <pubDate>Fri, 21 Aug 2026 21:19:11 +0000</pubDate>
      <link>https://dev.to/tanay_karmarkar_fe8eb6dcd/wth-is-cap-theorem-really-3h82</link>
      <guid>https://dev.to/tanay_karmarkar_fe8eb6dcd/wth-is-cap-theorem-really-3h82</guid>
      <description>&lt;p&gt;CAP tells you what happens during a partition. PACELC tells you what happens the other 99.9% of the time: you trade latency for consistency on every single write, partition or not. If you only design for CAP, you have ignored the trade-off that shapes your p99.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CAP, Precisely Stated
In the presence of a network partition (P), a system can provide at most one of: Consistency (C — linearizability) or Availability (A — every non-failed node responds). The theorem is narrower than folklore: it says nothing about normal operation, it compares linearizability against total availability, and it assumes the partition is real. Many "CA systems" in slideware are CA only because the slides omit P.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;CP: Refuse to answer on the minority side. etcd, Consul, Spanner, CockroachDB (majority required).&lt;br&gt;
AP: Answer from any replica, reconcile later. Cassandra, DynamoDB, CouchDB (tunable, but AP by default).&lt;br&gt;
In production the partition is not hypothetical — it is a rolling kernel upgrade that holds a rack's switch for 11 seconds, an AZ failure, or a noisy neighbor saturating the NIC. Your "rare partition" happens monthly.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;#PACELC: The Trade-Off You Pay Every Day
Daniel Abadi's PACELC completes the picture....read more here&lt;/li&gt;
&lt;/ol&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://portfolio.tanaykarmarkar.com/blogs/distributed-systems-cap-pacelc" rel="noopener noreferrer" class="c-link"&gt;
            WTH is CAP and PACELC? — Tanay Karmarkar
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            WTH is CAP and PACELC? CAP tells you what happens during a partition. PACELC tells you what you pay the other 99.9% of the time.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
          portfolio.tanaykarmarkar.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>distributedsystems</category>
      <category>database</category>
    </item>
    <item>
      <title>WTH is PostgreSQL Transaction ID Wraparound?</title>
      <dc:creator>Tanay Karmarkar</dc:creator>
      <pubDate>Mon, 17 Aug 2026 05:40:06 +0000</pubDate>
      <link>https://dev.to/tanay_karmarkar_fe8eb6dcd/wth-is-postgresql-transaction-id-wraparound-2hg4</link>
      <guid>https://dev.to/tanay_karmarkar_fe8eb6dcd/wth-is-postgresql-transaction-id-wraparound-2hg4</guid>
      <description>&lt;p&gt;One of the most abrupt production outages you can experience in PostgreSQL doesn’t come from a hardware failure—it comes from a mathematical boundary.&lt;/p&gt;

&lt;p&gt;PostgreSQL handles Multi-Version Concurrency Control (MVCC) using a 32-bit Transaction ID (XID) space. Because there are only ~4.2 billion available IDs, the database treats this space as a circular ring: roughly 2.14 billion transactions represent the "past" (visible data), while the rest represent the "future" (invisible data).&lt;/p&gt;

&lt;p&gt;The danger of XID wraparound occurs when your global transaction counter advances too rapidly without "freezing" older rows. If an unfrozen row falls out of that 2.14 billion transaction safe window, its ID mathematically flips into the future. When this happens, completely valid production data suddenly becomes invisible to your queries.&lt;/p&gt;

&lt;p&gt;To prevent this silent data corruption, PostgreSQL will forcefully reject new write operations and halt database operations once it gets within 11 million transactions of wraparound.&lt;/p&gt;

&lt;p&gt;Usually, Autovacuum hums along in the background to freeze old rows and safely advance the window. However, silent blockers like abandoned logical replication slots, orphaned prepared transactions, or even just a single uncommitted long-running query can quietly stall Autovacuum until it's too late.&lt;/p&gt;

&lt;p&gt;For a deeper look at the implementation details, including the exact SQL queries to monitor datfrozenxid age, emergency recovery steps, and an interactive simulation of the XID ring, the full breakdown is here:&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://portfolio.tanaykarmarkar.com/blogs/postgres-transaction-id-wraparound" rel="noopener noreferrer" class="c-link"&gt;
            WTH is PostgreSQL Transaction ID Wraparound? — Tanay Karmarkar
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            WTH is PostgreSQL Transaction ID Wraparound? 32-bit XIDs will wrap; autovacuum freeze and monitoring prevent forced shutdown.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
          portfolio.tanaykarmarkar.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>postgres</category>
      <category>database</category>
      <category>infrastructure</category>
    </item>
    <item>
      <title>So…#WTH is State Machine Replication?</title>
      <dc:creator>Tanay Karmarkar</dc:creator>
      <pubDate>Sun, 16 Aug 2026 06:05:02 +0000</pubDate>
      <link>https://dev.to/tanay_karmarkar_fe8eb6dcd/sowth-is-state-machine-replication-1oek</link>
      <guid>https://dev.to/tanay_karmarkar_fe8eb6dcd/sowth-is-state-machine-replication-1oek</guid>
      <description>&lt;p&gt;Every replicated database, Kafka partition, and Raft cluster relies on one rule: if deterministic replicas start identical and apply identical commands in an identical order, they stay identical.&lt;br&gt;
Violate the order by one message, and you’ve built two different databases.&lt;/p&gt;

&lt;p&gt;In my blog, I learnt and then broke down the mechanics of State Machine Replication (SMR). I cover:&lt;/p&gt;

&lt;p&gt;-&amp;gt; The Deterministic Primitive&lt;br&gt;
 -&amp;gt; The Replicated Log&lt;br&gt;
 -&amp;gt; Exactly-Once Apply&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://portfolio.tanaykarmarkar.com/blogs/distributed-systems-state-machine-replication" rel="noopener noreferrer" class="c-link"&gt;
            WTH is State Machine Replication? — Tanay Karmarkar
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            WTH is State Machine Replication? Deterministic replicas must apply identical commands in identical order.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
          portfolio.tanaykarmarkar.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>distributedsystems</category>
      <category>computerscience</category>
      <category>infrastructure</category>
      <category>sre</category>
    </item>
  </channel>
</rss>
