<?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: Divyanshu Deepam</title>
    <description>The latest articles on DEV Community by Divyanshu Deepam (@divyanshu_deepam_f78b286a).</description>
    <link>https://dev.to/divyanshu_deepam_f78b286a</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%2F3894779%2F999f9b57-e34f-4e48-9a19-88bfd5489f79.jpeg</url>
      <title>DEV Community: Divyanshu Deepam</title>
      <link>https://dev.to/divyanshu_deepam_f78b286a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/divyanshu_deepam_f78b286a"/>
    <language>en</language>
    <item>
      <title>Beyond the Cheat Sheets: How to Actually Reason About Partitioning VS Sharding in System Design Interview</title>
      <dc:creator>Divyanshu Deepam</dc:creator>
      <pubDate>Thu, 28 May 2026 14:43:29 +0000</pubDate>
      <link>https://dev.to/divyanshu_deepam_f78b286a/beyond-the-cheat-sheets-how-to-actually-reason-about-partitioning-vs-sharding-in-system-design-4j7g</link>
      <guid>https://dev.to/divyanshu_deepam_f78b286a/beyond-the-cheat-sheets-how-to-actually-reason-about-partitioning-vs-sharding-in-system-design-4j7g</guid>
      <description>&lt;p&gt;&lt;em&gt;You are mid-way through a system design interview, confidently whiteboarding your database architecture. You casually drop the word: “…and then we’ll just shard the database.”&lt;br&gt;
The interviewer leans forward, smiles, and asks a devastatingly simple follow-up: “Why? Why can’t we just use database partitioning here?”. Suddenly, you freeze.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Without a crisp, production-grade mental model of the difference between the two, even experienced engineers get caught off guard. Whiteboard cheat sheets give you clean, sanitized definitions: Partitioning is local; sharding is distributed.&lt;br&gt;
But when your system is melting down, textbook definitions won’t save you. Let’s look at the actual operational differences, the hidden bottlenecks, and how to choose between them.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Golden Rule of Database Splits
&lt;/h3&gt;

&lt;p&gt;Before writing a single line of DDL, anchor your brain to this fundamental truth:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;All sharding is partitioning, but not all partitioning is sharding.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Partitioning&lt;/strong&gt; is the splitting of data into smaller parts for manageability or performance. Partitioning is mainly for manageability and improving the performance, like if you want to have faster queries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Partitioning does not necessarily mean distributed systems.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sharding&lt;/strong&gt; is a special type of partitioning where partitions are on different machines. It is horizontal scaling in its true sense.&lt;/p&gt;

&lt;p&gt;The main goal of sharding is to have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;more throughput&lt;/li&gt;
&lt;li&gt;more storage capacity&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Scenario 1: The Query Trap
&lt;/h3&gt;

&lt;p&gt;Imagine you built an ecommerce platform. Your Orders table has ballooned to 500 million rows, and your latency graphs look terrible. Queries fetching recent orders are crawling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What do you do ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The best approach is to partition by date or month. Queries become faster , old partitions can be archived. This is easy on maintenance and no extra machine cost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Engineering Benefit:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Partition Pruning: When a user checks their recent orders, the database query planner instantly ignores 95% of the table and searches only the specific month’s partition file.&lt;br&gt;
Zero-Cost Data Retention: When data gets old, you don’t run a massive, CPU-locking Delete query. You simply drop or archive the entire historical partition file instantly&lt;br&gt;
At this point, partitioning solves query efficiency - but not machine capacity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scenario 2: The Infrastructure Ceiling
&lt;/h3&gt;

&lt;p&gt;Now imagine your platform explodes in popularity. You hit 50 million active users, and your primary database machine is choking on write throughput. The CPU is pinned, disk I/O is saturated, and your connection pool is exhausted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What do you do now ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now , partitioning alone is not enough because the bottleneck is no longer Query Optimisation. So now you must do Sharding.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Once &lt;strong&gt;CPU, RAM, storage&lt;/strong&gt; or &lt;strong&gt;write throughput&lt;/strong&gt; starts becoming bottlenecks for DB machine , you think of Sharding.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can map User Id 1-10M to Shard A&lt;br&gt;
10M-20M to Shard B , and so on.&lt;/p&gt;

&lt;p&gt;What did you gain by this and how does it improve write throughput in your scenario ?&lt;/p&gt;

&lt;p&gt;The write requests will get distributed among different shards. The throughput increases because suppose earlier you had 1 machine with ability to support 10,000 QPS now you have 10 such machines (shards) so you can simultaneously process 100,000 Queries each second.&lt;/p&gt;

&lt;p&gt;But like everything in life , Sharding is not free optimisation , its a tradeoff. You did gain on throughput , memory , storage but there are downsides as well. This leads us to…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Senior Engineer Reality Check: Sharding is a Tax&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;(1) The Rebalancing Nightmare:&lt;/strong&gt; If one shard becomes a hotspot due to a poorly chosen shard key, re-sharding and moving live production data across network boundaries is a cumbersome, high-risk operations project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(2) Costly Joins:&lt;/strong&gt; If you have to run queries which have lot of joins , that becomes really costly or flat-out unsupported. You are forced to handle complex join logic in your application layer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(3) Shard Hotspot:&lt;/strong&gt; If you dont choose your shard key carefully based on your query pattern then one shard can become hotspot and you come back to square one, dealing with same problem which you were trying to solve via Sharding.&lt;/p&gt;

&lt;p&gt;Hence when beginners think "&lt;em&gt;Sharding increases scalability&lt;/em&gt;" , Senior Engineers have a different mindset :&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sharding is expensive and should be avoided until necessary&lt;/p&gt;
&lt;/blockquote&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%2Fxynm73weu3o93rw2me50.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%2Fxynm73weu3o93rw2me50.png" alt="Mental Model to decide when to use Partitioning vs Sharding" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;Partitioning helps you manage data better. Sharding helps you survive scale.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Good engineers don’t shard because it sounds advanced.&lt;br&gt;
They shard only when a single machine becomes the bottleneck.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>database</category>
      <category>distributedsystems</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>10 Avro Schema Mistakes Even Experienced Developer Do</title>
      <dc:creator>Divyanshu Deepam</dc:creator>
      <pubDate>Tue, 26 May 2026 18:55:19 +0000</pubDate>
      <link>https://dev.to/divyanshu_deepam_f78b286a/10-avro-schema-mistakes-even-experienced-developer-do-484</link>
      <guid>https://dev.to/divyanshu_deepam_f78b286a/10-avro-schema-mistakes-even-experienced-developer-do-484</guid>
      <description>&lt;p&gt;&lt;strong&gt;Avro schemas&lt;/strong&gt; widely used with messaging systems like &lt;strong&gt;Apache Kafka&lt;/strong&gt; to serialize messages into a compact binary format. This dramatically reduces bandwidth and storage overhead compared to sending verbose formats like JSON or XML.&lt;br&gt;
They look deceptively simple until a tiny mistake breaks your serializer, schema registry validation, or downstream consumers.&lt;/p&gt;

&lt;p&gt;Some mistakes are obvious rookie errors. Others are subtle enough that even experienced developers make them when moving fast.&lt;/p&gt;

&lt;p&gt;I built Dev Suite Avro Schema Validator ( &lt;a href="https://devsuite.tools/avro-schema-validator" rel="noopener noreferrer"&gt;https://devsuite.tools/avro-schema-validator&lt;/a&gt; ) to automate the painful part. Paste your schema, and it validates, analyzes, and flags production-breaking issues in seconds.&lt;/p&gt;

&lt;p&gt;Here are 10 real Avro schema mistakes that can quietly break production pipelines:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(1) Referencing a Named Type with an Incorrect Fullname&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Subsequent references to a declared named type MUST be made by its full name.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Test Case&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "type": "record",
  "name": "Order",
  "namespace": "com.devsuite",
  "fields": [
    {
      "name": "shippingAddress",
      "type": {
        "type": "record",
        "name": "Address",
        "fields": [
          { "name": "city", "type": "string" }
        ]
      }
    },
    {
      "name": "billingAddress",
      "type": "com.Address"
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this fails&lt;/strong&gt;&lt;br&gt;
Named type references containing a dot are treated by Avro as explicit full names, not partially qualified names. Since &lt;strong&gt;&lt;em&gt;com.Address&lt;/em&gt;&lt;/strong&gt; does not match the declared full name &lt;strong&gt;&lt;em&gt;com.devsuite.Address&lt;/em&gt;&lt;/strong&gt;, schema resolution fails.&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%2Fiq200c67vxn2y2fduvy0.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%2Fiq200c67vxn2y2fduvy0.png" alt="Figure 1: Dev Suite flagging an invalid named type reference with incorrect namespace qualification" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(2) Referencing a Named Type Before It Is Declared&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; All named types used within a schema MUST be declared where they are first used.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Test Case&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "type": "record",
  "name": "Customer",
  "namespace": "com.devsuite.core",
  "fields": [
    {
      "name": "primaryAccount",
      "type": "com.devsuite.core.Account"
    },
    {
      "name": "secondaryAccount",
      "type": {
        "type": "record",
        "name": "Account",
        "fields": [
          { "name": "routingNumber", "type": "string" }
        ]
      }
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this fails&lt;/strong&gt;&lt;br&gt;
The &lt;em&gt;primaryAccount&lt;/em&gt; field references &lt;em&gt;com.devsuite.core.Account&lt;/em&gt; before it is inline-declared in the &lt;em&gt;secondaryAccount&lt;/em&gt; field. Avro parses top-down, left-to-right; a type cannot be referenced by full name until the parser has actually encountered its full structural declaration.&lt;/p&gt;

&lt;p&gt;Declare the named type before the first reference that uses it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(3) Alias Contains the Type’s Own Name&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; The aliases attribute MUST NOT contain the name attribute of the named type.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Test Case&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "type": "record",
  "name": "Account",
  "namespace": "com.devsuite",
  "aliases": ["Account", "OldAccount"],
  "fields": [
    { "name": "accountId", "type": "string" }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this fails&lt;/strong&gt;&lt;br&gt;
Aliases in Avro exist to support schema evolution, particularly when a type has been renamed but older producers or consumers may still refer to the previous name. Including the current schema name inside its own aliases list defeats the purpose entirely because the alias mechanism is meant to represent alternate historical identities, not duplicate the current one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Account&lt;/strong&gt; should be removed from the aliases array&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(4) Duplicate Equivalent Types Inside a Union&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Any primitive type MUST be included at most once, which also applies to logical type annotations. A UUID logical type, which annotates string, and a string primitive type therefore MUST NOT appear in the same type union.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Test Case&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "type": "record",
  "name": "Event",
  "namespace": "com.devsuite",
  "fields": [
    {
      "name": "identifier",
      "type": [
        "string",
        {
          "type": "string",
          "logicalType": "uuid"
        }
      ]
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this fails&lt;/strong&gt;&lt;br&gt;
Avro unions distinguish branches by schema type category, not semantic meaning. Since a UUID logical type is still fundamentally a string, combining both creates ambiguity during resolution.&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%2Fy8m1pecfeckjt3gb0h4h.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%2Fy8m1pecfeckjt3gb0h4h.png" alt="Figure 2: Dev Suite catching a type redundancy error within a union array where a primitive string overlaps with a uuid logical type annotation." width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(5) Multiple Arrays or Maps Inside the Same Union&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; A union MUST NOT contain more than one array type and NOT more than one map type.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Test Case&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "type": "record",
  "name": "DataPayload",
  "namespace": "com.devsuite",
  "fields": [
    {
      "name": "collections",
      "type": [
        { "type": "array", "items": "string" },
        { "type": "array", "items": "int" }
      ]
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this fails&lt;/strong&gt;&lt;br&gt;
The issue is that Avro distinguishes union members by top-level schema category, not by their internal configuration details. Two arrays are still both arrays, regardless of whether their item definitions differ. The same applies to maps. During deserialization, Avro cannot reliably determine which union branch should be selected purely based on the fact that both branches are structurally the same top-level type. This makes the schema ambiguous and therefore invalid.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt; - Wrap structurally different meanings inside named records instead of directly placing multiple arrays or maps in the same union.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(6) Union Default Value Does Not Match the First Type&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; The default value of a union field MUST match the structure of the first type declared in the union array.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Test Case&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "type": "record",
  "name": "UserStatus",
  "namespace": "com.devsuite",
  "fields": [
    {
      "name": "state",
      "type": ["null", "string"],
      "default": "ACTIVE"
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this fails&lt;/strong&gt;&lt;br&gt;
The union allows null or a string. However, because “null” is the first element in the array, the default value must be null.&lt;br&gt;
If a developer wants the default value to be “ACTIVE”, they must reorder the union to [“string”, “null”]&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%2Fxgyz3egckkyst5kl3fqg.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%2Fxgyz3egckkyst5kl3fqg.png" alt="Figure 3: Dev Suite flagging a schema violation on line 9 where the default value fails to match the first declared type in the union (“null”)" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(7) Enum Default Not Present in Symbols&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; The default value for an enum must be a string that exactly matches one of the values defined in the symbols array.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Test Case&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "type": "record",
  "name": "UserStatus",
  "namespace": "com.devsuite.test",
  "fields": [
    {
      "name": "status",
      "type": {
        "type": "enum",
        "name": "StatusEnum",
        "symbols": ["ACTIVE", "INACTIVE", "BANNED"]
      },
      "default": "PENDING"
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this fails&lt;/strong&gt;&lt;br&gt;
Enum defaults are not arbitrary fallback strings chosen by business meaning; they must correspond exactly to one of the enum’s declared symbols. Developers frequently make this mistake when renaming enum values during schema evolution or when choosing a semantically meaningful default that feels right but no longer exists in the actual symbols array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(8) Default Object Missing Required Fields&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; The default attribute value MUST be a structurally valid instance representation of that specific type.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Test Case&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "type": "record",
  "name": "MapData",
  "namespace": "com.devsuite",
  "fields": [
    {
      "name": "coordinates",
      "type": {
        "type": "record",
        "name": "Point",
        "fields": [
          { "name": "x", "type": "int" },
          { "name": "y", "type": "int" }
        ]
      },
      "default": {
        "x": 100
      }
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this fails&lt;/strong&gt;&lt;br&gt;
Default values in Avro are not placeholders or partially descriptive hints; they must be fully valid structural representations of the declared schema. A common mistake happens when developers define a nested record default and provide only some of the fields, assuming omitted values will somehow be inferred or auto-filled. Avro does not do that unless those omitted fields themselves define valid defaults. If a nested record requires fields x and y , providing only x makes the entire default structurally incomplete. This becomes especially easy to miss in large schemas where nested records span many fields and developers manually craft defaults under time pressure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(9) Invalid Duration Logical Type Definition&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; The duration logical type extends the fixed type and must annotate a fixed size of exactly 12 bytes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Test Case&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "type": "record",
  "name": "Timeline",
  "namespace": "com.devsuite",
  "fields": [
    {
      "name": "windowSize",
      "type": {
        "type": "fixed",
        "name": "Interval",
        "size": 8,
        "logicalType": "duration"
      }
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this fails&lt;/strong&gt;&lt;br&gt;
In Avro, duration is extremely specific. It represents three unsigned 32-bit integers corresponding to months, days, and milliseconds, which together require exactly 12 bytes of fixed storage. If duration is attached to anything other than a fixed type of size 12, the binary representation no longer matches Avro’s expected encoding contract.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(10) Fixed Type Without Valid Size&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; A fixed type must have a size attribute that is an integer strictly greater than zero.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Test Case&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "type": "record",
  "name": "HashRecord",
  "namespace": "com.devsuite.test",
  "fields": [
    {
      "name": "md5",
      "type": {
        "type": "fixed",
        "name": "MD5"
      }
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this fails&lt;/strong&gt;&lt;br&gt;
A fixed type exists specifically to represent a binary blob of exact known size. Without a valid positive size, Avro has no idea how much memory should be allocated or how many bytes should be read and written during serialization. Developers often scaffold fixed types quickly for hashes, binary identifiers, or protocol payloads and forget to define the actual size, treating it as metadata to fill later. But for Avro, size is fundamental to the schema’s structural definition.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>automation</category>
      <category>productivity</category>
      <category>kafka</category>
    </item>
    <item>
      <title>Documentation is Debt: Why Your Class Diagrams Should Be Executable</title>
      <dc:creator>Divyanshu Deepam</dc:creator>
      <pubDate>Mon, 27 Apr 2026 16:40:35 +0000</pubDate>
      <link>https://dev.to/divyanshu_deepam_f78b286a/documentation-is-debt-why-your-class-diagrams-should-be-executable-l41</link>
      <guid>https://dev.to/divyanshu_deepam_f78b286a/documentation-is-debt-why-your-class-diagrams-should-be-executable-l41</guid>
      <description>&lt;p&gt;In high-stakes system design sessions or SDE-2 interview prep, the "Class Diagram" is the hero of the hour. We map out domain logic, define inheritance hierarchies, and establish access modifiers.&lt;br&gt;
Then the meeting ends.&lt;/p&gt;

&lt;p&gt;The diagram is pasted into a Confluence page or a README, and there it sits—a static relic of a moment in time. As implementation begins, the developer is forced to pay the &lt;strong&gt;"Manual Translation Tax"&lt;/strong&gt;: manually creating files, defining boilerplate fields, implementing getters/setters, and ensuring the inheritance links match the drawing.&lt;/p&gt;

&lt;p&gt;This is where architectural entropy starts. The moment code diverges from the diagram, the documentation becomes debt.&lt;/p&gt;

&lt;p&gt;I wanted to change that. I wanted the diagram to be the &lt;strong&gt;Single Source of Truth&lt;/strong&gt; for the initial implementation.&lt;/p&gt;
&lt;h2&gt;
  
  
  Introducing: Executable Architecture in Dev Suite
&lt;/h2&gt;

&lt;p&gt;I’ve integrated a &lt;strong&gt;Mermaid Class Diagram to Code Generator&lt;/strong&gt; into &lt;a href="https://devsuite.tools/" rel="noopener noreferrer"&gt;Dev Suite&lt;/a&gt;.&lt;br&gt;
The philosophy is simple: &lt;strong&gt;If the structure is already defined, the code should be a byproduct, not a chore.&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Why Mermaid?
&lt;/h3&gt;

&lt;p&gt;Mermaid has become the industry standard for "Diagrams as Code" because it is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Versionable:&lt;/strong&gt; It lives in Git alongside your source code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Text-Based:&lt;/strong&gt; No proprietary binary files or drag-and-drop UI lag.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ubiquitous:&lt;/strong&gt; Native support in GitHub, GitLab, and most modern wikis.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  The Real Friction: Moving Beyond Visualization
&lt;/h2&gt;

&lt;p&gt;Imagine this Mermaid snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;classDiagram
    class User {
        +String name
        +int age
        +login() bool
    }
    class Admin {
        +String role
        +deleteUser(User u)
    }
    User &amp;lt;|-- Admin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most tools simply render a pretty SVG. But for a developer, the "real work" is just starting. You still have to write:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;User.java&lt;/code&gt; with private fields and public accessors.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Admin.java&lt;/code&gt; with the extends keyword.&lt;/p&gt;

&lt;p&gt;Method stubs that match the diagram signatures.&lt;/p&gt;

&lt;p&gt;Dev Suite automates this transition. You paste the Mermaid syntax and instantly get a production-ready project skeleton.&lt;/p&gt;

&lt;h2&gt;
  
  
  Under the Hood: Building a Compiler Pipeline
&lt;/h2&gt;

&lt;p&gt;As an engineer, I knew that simple string replacement wouldn't scale. To support the nuances of different languages, I built the generator as a mini-compiler pipeline:&lt;br&gt;
&lt;strong&gt;1. The Parser Layer&lt;/strong&gt;&lt;br&gt;
We use a robust parser to transform the Mermaid string into an Abstract Syntax Tree (AST). This allows the tool to understand relationships like Composition, Inheritance, and Visibility without getting tripped up by formatting or whitespace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The Intermediate Representation (IR)&lt;/strong&gt;&lt;br&gt;
The AST is converted into a language-agnostic class model. This "source of truth" represents the classes, their members, and their connections.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The Language-Specific Emitter&lt;/strong&gt;&lt;br&gt;
The Intermediate Representation (IR) is piped into specialized emitters. This decoupled architecture ensures that adding support for Python, TypeScript, or C# is a simple matter of writing a new emitter, not rebuilding the core engine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Matters for Your Workflow
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Faster Prototyping:&lt;/strong&gt; Go from a whiteboard sketch to a compilable project structure in seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduced Cognitive Load:&lt;/strong&gt; Spend your energy on solving business logic, not typing &lt;code&gt;public String getUsername()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architectural Parity:&lt;/strong&gt; Ensure the code actually reflects the design approved during the review phase.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Learning Tool:&lt;/strong&gt; For students and junior devs, seeing the immediate translation of visual OOP concepts into code is a powerful educational feedback loop.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;I want to hear from you:&lt;/strong&gt;&lt;br&gt;
What is the most tedious part of your design-to-dev workflow? What "mechanical" task do you wish was automated?&lt;/p&gt;

&lt;p&gt;Try the generator now: &lt;br&gt;
&lt;a href="https://devsuite.tools/mermaid-class-diagram-to-java" rel="noopener noreferrer"&gt;Mermaid Class Diagram to Java&lt;/a&gt;&lt;br&gt;
&lt;a href="https://devsuite.tools/mermaid-class-diagram-to-cpp" rel="noopener noreferrer"&gt;Mermaid Class Diagram to C++&lt;/a&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>webdev</category>
      <category>performance</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How I Built a React JSON Tool That Handles 150k+ Lines Without Freezing the Browser</title>
      <dc:creator>Divyanshu Deepam</dc:creator>
      <pubDate>Thu, 23 Apr 2026 19:13:27 +0000</pubDate>
      <link>https://dev.to/divyanshu_deepam_f78b286a/how-i-built-a-react-json-tool-that-handles-150k-lines-without-freezing-the-browser-4l97</link>
      <guid>https://dev.to/divyanshu_deepam_f78b286a/how-i-built-a-react-json-tool-that-handles-150k-lines-without-freezing-the-browser-4l97</guid>
      <description>&lt;p&gt;Most JSON tools work fine… until they meet real-world production data.&lt;/p&gt;

&lt;p&gt;We’ve all been there: You paste a massive payload into a web-based formatter, and suddenly:&lt;/p&gt;

&lt;p&gt;The page stops responding.&lt;br&gt;
Scrolling becomes a stuttering mess.&lt;br&gt;
The "Page Unresponsive" popup appears.&lt;br&gt;
I encountered this while debugging complex automation flows and deeply nested configurations. I needed a tool that could handle 150k+ lines of JSON without falling apart, but I didn't want to compromise on privacy by sending that data to a backend.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://devsuite.tools/json-diff" rel="noopener noreferrer"&gt;Dev Suite&lt;/a&gt; - a client-side toolkit designed for performance-first JSON manipulation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Large JSON is a "Systems Engineering" Challenge
&lt;/h2&gt;

&lt;p&gt;Performance in the browser isn't just about a fast for loop. It’s a multi-layered bottleneck involving:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Parsing Cost: Converting a 10MB+ string into a JavaScript object.&lt;/li&gt;
&lt;li&gt;Memory Pressure: Storing that object and its associated metadata.&lt;/li&gt;
&lt;li&gt;DOM Complexity: The browser struggling to calculate layout for 5,000+ nodes.&lt;/li&gt;
&lt;li&gt;React Overhead: Re-renders triggered by state changes during heavy interactions.
Here is how I tackled the specific challenges of scaling the tool from 50k to 150k+ lines.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  1. JSON Path Finder: Reducing the Noise
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://dev.tourl"&gt;Path Finder&lt;/a&gt; returns dot-notation paths (e.g., &lt;code&gt;payment.gateway.retry.maxAttempts&lt;/code&gt;). While the logic seems simple, iterating through a massive tree structure can generate significant "noise."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Challenge: Array Explosion&lt;/strong&gt;&lt;br&gt;
If you search for a key like &lt;code&gt;feeTypes&lt;/code&gt;and it’s an array of 1,000 objects, a naive search might return: &lt;code&gt;feeTypes[0], feeTypes[1], feeTypes[2]...&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Fix: AST-Based Traversing&lt;/strong&gt;&lt;br&gt;
I implemented a search algorithm that walks the &lt;strong&gt;Abstract Syntax Tree (AST)&lt;/strong&gt; of the JSON. Instead of a flat search, I added &lt;strong&gt;conditional result filtering&lt;/strong&gt;. This ensures users see the meaningful parent matches first. By intelligently pruning the traversal, we keep the UI clean and the search execution time sub-millisecond.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Solving the "5,000 Element" Freeze
&lt;/h3&gt;

&lt;p&gt;If a search returns 5,000 matches, and React tries to render 5,000 buttons (each with icons, hover states, and tooltips), the main thread will lock up for several seconds while the browser paints.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution: Virtualization&lt;/strong&gt;&lt;br&gt;
I implemented DOM Virtualization. Instead of rendering all 5,000 results, the tool only renders the ~20 items currently in the user's viewport. As the user scrolls, DOM nodes are recycled and updated with new data.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Bypassing the React Render Cycle
&lt;/h3&gt;

&lt;p&gt;React is amazing for state management, but it can be a bottleneck for text editors. If every keystroke in a 100k-line file triggers a React state update and a virtual DOM diff, the latency (typing lag) becomes unbearable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Fix: Decoupling the Editor Engine&lt;/strong&gt;&lt;br&gt;
I moved the "hot path" away from React's state. By using an uncontrolled component approach with the underlying editor engine (CodeMirror/Monaco), I severed the connection between the typing engine and React’s render cycle.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. JSON Diffing
&lt;/h3&gt;

&lt;p&gt;A standard text diff is useless for JSON because key order often doesn't matter. &lt;a href="https://devsuite.tools/json-diff" rel="noopener noreferrer"&gt;JSON Diff Checker&lt;/a&gt; helps to check differences between two JSONs semantically. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution: Order-Invariant Comparison&lt;/strong&gt;&lt;br&gt;
I built a recursive diffing algorithm using Map and Set data structures.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It identifies Added, Removed, keys with modified value and keys with value type changed.&lt;/li&gt;
&lt;li&gt;It ignores object key order (semantic equality).&lt;/li&gt;
&lt;li&gt;It handles nested structures recursively.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Navigating the Diffs&lt;/strong&gt;&lt;br&gt;
In a 150k line file, you can't just "jump" the user around. I implemented Binary Search over the sorted array of diff locations. This allows the "Next" and "Previous" buttons to find the closest difference relative to the user's current scroll position instantly.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Result
&lt;/h3&gt;

&lt;p&gt;Dev Suite now handles 150k+ lines of JSON with ease. It’s been an insightful journey into the limits of browser performance and the importance of choosing the right tool for the right job (even if that tool is "&lt;strong&gt;Not React&lt;/strong&gt;" for certain specific tasks).&lt;/p&gt;

&lt;p&gt;There are more tools at Dev Suite , you can explore&lt;br&gt;
👉 &lt;a href="https://devsuite.tools/mermaid-class-diagram-to-java" rel="noopener noreferrer"&gt;https://devsuite.tools/mermaid-class-diagram-to-java&lt;/a&gt;&lt;br&gt;
👉 &lt;a href="https://devsuite.tools/mermaid-class-diagram-to-cpp" rel="noopener noreferrer"&gt;https://devsuite.tools/mermaid-class-diagram-to-cpp&lt;/a&gt;&lt;br&gt;
👉 &lt;a href="https://devsuite.tools/yaml-diff" rel="noopener noreferrer"&gt;https://devsuite.tools/yaml-diff&lt;/a&gt;&lt;br&gt;
👉 &lt;a href="https://devsuite.tools/yaml-pathfinder" rel="noopener noreferrer"&gt;https://devsuite.tools/yaml-pathfinder&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd love to hear from you:&lt;br&gt;
What’s the largest JSON payload you’ve had to debug in a browser? Did your existing tools survive, or did you have to reach for the terminal?&lt;/p&gt;

&lt;p&gt;Let's discuss in the comments!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>automation</category>
      <category>showdev</category>
      <category>performance</category>
    </item>
  </channel>
</rss>
