<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Drakshichopra on Medium]]></title>
        <description><![CDATA[Stories by Drakshichopra on Medium]]></description>
        <link>https://medium.com/@drakshichopra?source=rss-148a4e032f9b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*iUtN8FHQttFq0FLg</url>
            <title>Stories by Drakshichopra on Medium</title>
            <link>https://medium.com/@drakshichopra?source=rss-148a4e032f9b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 14:43:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@drakshichopra/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Do we really need JSON ?]]></title>
            <link>https://medium.com/@drakshichopra/do-we-really-need-json-cd60a4a74bc5?source=rss-148a4e032f9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd60a4a74bc5</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Drakshichopra]]></dc:creator>
            <pubDate>Sat, 25 Apr 2026 08:31:35 GMT</pubDate>
            <atom:updated>2026-04-25T08:34:29.063Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NzUWHUSXv9XL4MOCYrhtpA.png" /></figure><p>At this point, using JSON in APIs feels like muscle memory.</p><p>Need to send data? → JSON.stringify<br>Getting response? → response.json()</p><p>No questions asked.</p><p>But one random day, my brain went: <strong>wait… why are we even doing this?</strong><br>And more importantly — <strong>is JSON the only way?</strong></p><p>As a frontend developer, I’ve almost always used JSON whenever I want to receive data from an API or send data in the request body. That got me thinking — do we actually <em>need</em> JSON? Or is there any other way to send data to the server?</p><p><strong>Let’s start with why we even convert data using JSON before sending it.</strong></p><p>When we send data over the network (like via HTTP), <strong>we can’t directly send complex JavaScript objects or arrays</strong>. So we convert them into a format that can be transferred easily. This process is called <strong>serialization</strong>.</p><p>Most of the time, we convert our data into a string using JSON:</p><pre>const dataToSend = {<br>  name: &quot;Drakshi&quot;,<br>  role: &quot;Frontend Engineer&quot;,<br>  skills: [&quot;React&quot;, &quot;TypeScript&quot;, &quot;Next.js&quot;]<br>};</pre><pre>try {<br>    const response = await fetch(&quot;https://example.com/api/user&quot;, {<br>      method: &quot;POST&quot;,<br>      headers: {<br>        &quot;Content-Type&quot;: &quot;application/json&quot;<br>      },<br>      body: JSON.stringify(dataToSend)<br>    });</pre><p>When the server receives this, it converts the JSON string back into an object. This reverse process is called <strong>deserialization</strong> (like using JSON.parse).</p><p><strong>JSON is the most commonly used format for this because it’s simple, readable, and works really well with JavaScript. But JSON is not the only way</strong>.</p><p>There are other serialization formats too. For example, <strong>gRPC</strong> uses Protocol Buffers (Protobuf), which is a binary format and more efficient than JSON in many cases.</p><p>Another example is <strong>MessagePack</strong>, which is also a binary serialization format.</p><h4>Let’s Try something different (MessagePack)</h4><p>So I decided to actually test this out.</p><p>Instead of blindly using JSON, I tried another serialization format called <strong>MessagePack</strong> — which is a binary format and claims to be more compact.</p><p>You can install it using</p><pre>npm install @msgpack/msgpack</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lw2AYGflQsx3PhX2KqNHKw.png" /></figure><p>Here’s a simple comparison:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKaBEiEWhtPI3bWytuy3Yg.png" /></figure><h4>This means</h4><ul><li>MessagePack is <strong>more compact</strong> than JSON</li><li>Less data → faster transfer (in theory)</li><li>But it’s <strong>binary</strong>, so not human-readable like JSON</li></ul><h4>🧠 So… do we really need JSON?</h4><p>Short answer — <strong>no, we don’t <em>need</em> JSON.</strong></p><p>We’ve just gotten very used to it.</p><p>JSON is simple, readable, and works perfectly with JavaScript, which is why it became the default choice for most APIs. It’s easy to debug, easy to log, and honestly… just convenient.</p><p>But under the hood, what we’re really doing is <strong>serialization</strong> — converting data into a format that can be sent over the network. JSON is just one way to do it.</p><p>As we saw, formats like MessagePack (or even Protocol Buffers in systems like gRPC) can be <strong>more compact and efficient</strong>. But they come with tradeoffs — mainly readability and developer experience.</p><p>So it’s not about replacing JSON everywhere.</p><p>It’s about understanding this:</p><p>👉 <strong>JSON is a choice, not a rule.</strong></p><p>Use JSON when:</p><ul><li>You want simplicity and readability</li><li>You’re building standard web APIs</li><li>Debugging matters</li></ul><p>Consider alternatives when:</p><ul><li>Payload size really matters</li><li>Performance is critical</li><li>You’re working in high-scale systems</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd60a4a74bc5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>