<?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 koundinya gms on Medium]]></title>
        <description><![CDATA[Stories by koundinya gms on Medium]]></description>
        <link>https://medium.com/@koundinya1991?source=rss-d55c9ee5efed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*dBJI5I7rpjizihZC.jpg</url>
            <title>Stories by koundinya gms on Medium</title>
            <link>https://medium.com/@koundinya1991?source=rss-d55c9ee5efed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:24:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@koundinya1991/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[Streaming vs. Polling JSON: A Practical Take]]></title>
            <link>https://medium.com/@koundinya1991/streaming-vs-polling-json-a-practical-take-fc190943971b?source=rss-d55c9ee5efed------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc190943971b</guid>
            <dc:creator><![CDATA[koundinya gms]]></dc:creator>
            <pubDate>Thu, 06 Feb 2025 13:11:39 GMT</pubDate>
            <atom:updated>2025-02-06T13:11:39.014Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VvqDEQnLOLI3vRdiYOjptQ.png" /></figure><p>When designing the <strong>rubric generation system</strong>, I faced a key architectural decision:</p><blockquote><strong><em>Should I stream JSON responses as they are generated, or should I poll the backend for updates?</em></strong></blockquote><p>Streaming sounds like the obvious choice for real-time applications, but after careful consideration, I chose <strong>polling</strong>. Here’s why.</p><h3>Understanding the Problem: Rubric Generation is an Asynchronous Process</h3><p>Generating rubrics is not an instant operation. It involves multiple steps, each happening asynchronously:</p><ol><li><strong>Analyze the uploaded question paper.</strong></li><li><strong>Extract questions and transform them into JSON.</strong></li><li><strong>Send each JSON block to OpenAI for evaluation (create tasks for OpenAI to generate rubrics for each question).</strong></li><li><strong>Store responses in the database for retrieval.</strong></li></ol><p>Since each JSON response is generated independently, <strong>streaming might seem like a good fit</strong>. But does it actually make sense?</p><h3>Challenges with Streaming JSON</h3><p>If I were to stream rubric data to the frontend, several key questions arose:</p><h3>1) What if the user navigates away or kills the app?</h3><ul><li><strong>Streaming requires an active connection.</strong> If the user leaves mid-process, they could <strong>lose all streamed data.</strong></li><li>Polling allows users to <strong>resume tracking progress anytime</strong>, even after navigating away.</li></ul><h3>2) When should we insert data into the database?</h3><ul><li>Should we <strong>stream first</strong> and insert later? If so, what happens if the database rejects some updates?</li><li>Should we <strong>insert first</strong> and then stream? If so, how do we ensure updates are pushed properly?</li></ul><h3>3) What if one process breaks?</h3><ul><li>If <strong>data insertion and streaming run separately</strong>, one could fail while the other succeeds.</li><li>This could lead to users seeing rubric updates <strong>that don’t actually exist in the database</strong>.</li><li>To avoid this, I would need to <strong>set up queues, event listeners, and retry mechanisms</strong>, making the infrastructure much more complex.</li></ul><p>At this point, <strong>streaming JSON became a rabbit hole of complexity.</strong> I realized that I would need to:<br>1. Maintain a <strong>queue</strong> to persist data while streaming.<br>2. Set up <strong>event listeners</strong> to detect failures and retry processing.<br>3. Ensure that streaming doesn’t <strong>outpace database updates</strong>.</p><p>This added <strong>unnecessary complexity</strong> at both the infrastructure and implementation levels.</p><h3>Polling JSON: A More Predictable &amp; Reliable Approach</h3><p>While polling is often seen as an “archaic” approach, it actually <strong>provides predictability and consistency</strong> in this case.</p><p>Here’s how the <strong>rubric generation flow</strong> works with polling:</p><ol><li><strong>User uploads a question paper.</strong></li><li><strong>The system extracts questions and converts them into JSON.</strong></li><li><strong>A background job is started</strong> to generate rubrics for the entire question set.</li><li><strong>As the LLM generates rubrics for each question, we insert them into the database</strong> under a common <strong>parent ID</strong>.</li><li><strong>Once all questions have been processed, the job is marked as finished.</strong></li><li><strong>The frontend polls an API</strong> that aggregates all rubrics linked to the <strong>parent ID</strong> and displays them in real time.</li></ol><h3>Why Polling Wins in This Scenario</h3><ol><li><strong>More Reliable:</strong> Polling always retrieves data from the database, ensuring consistency.</li><li><strong>Handles User Navigation:</strong> Users can leave and return at any time without losing progress.</li><li><strong>Simpler Infrastructure:</strong> No need for persistent connections, queues, or event-driven architecture.</li><li><strong>Predictable Execution:</strong> Each poll fetches exactly what’s in the database — nothing more, nothing less.</li></ol><h3>Final Thoughts: Occam’s Razor in Action</h3><p>Occam’s Razor states:<br><em>“The simplest solution that meets all requirements is usually the best.”</em></p><p><strong>Polling ensures real-time updates while avoiding the complexities of streaming, queue management, and event handling.</strong></p><p>For use cases like <strong>chat apps or stock tickers</strong>, <strong>streaming makes sense</strong>. But for a job-based system like rubric generation, <strong>polling is the better choice.</strong></p><p>A short video of rubrics polling in action</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FyPOsxMKzxVk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyPOsxMKzxVk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FyPOsxMKzxVk%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/854162d953c1d0b82bdd2cefb30bacc7/href">https://medium.com/media/854162d953c1d0b82bdd2cefb30bacc7/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc190943971b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why am I building Traceblade: Motivation and MVP Progress]]></title>
            <link>https://medium.com/@koundinya1991/why-am-i-building-traceblade-motivation-and-mvp-progress-05133fda3be8?source=rss-d55c9ee5efed------2</link>
            <guid isPermaLink="false">https://medium.com/p/05133fda3be8</guid>
            <category><![CDATA[saas-tools]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[event-tracking]]></category>
            <category><![CDATA[logging]]></category>
            <dc:creator><![CDATA[koundinya gms]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 11:32:24 GMT</pubDate>
            <atom:updated>2025-01-06T11:32:24.954Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8MawMlnvRDFt1Fu5YKasXA.jpeg" /></figure><p>User event tracking and logging is one of the most crucial instrument for understanding user behaviour and ensuring system stability. In my day-to-day job I found myself juggling multiple tools to connect the dots between a user event and related error. This process was not only time consuming but also frustrating, as the data was scattered across various platforms.<br>While building <strong>AI Assisted Grading Tool , </strong>I searched for solutions that could provide both user events and error logs(this is the main focus) in one place- <strong>a unified view</strong>. Unfortunately, I couldn’t find a tool that met this need without breaking the bank. <br>Thats when I realised it would be much more efficient(and cost-effective) to build a system tailored to this exact problem- one that bridges the gap between user event tracking and logging. as someone balancing the roles of a product manager and a developer for AI Assisted Grading Tool, I knew this tool could save me time and effort while solving a widespread challenge.</p><h3>Building the MVP</h3><p>With Traceblade, I set out to bridge the gap between user events and logs. The first version focuses mainly on the fundamentals: capturing user events and logs independently. While the unified view is still in progress, the foundation is a critical step.</p><p><strong>Things I needed for a solid foundation.</strong></p><ol><li><strong>An ingestion pipeline: </strong>The main focus is not just to ingest data into the system but to do it seamlessly. As my project uses React Native and Go, it was only natural that I created a <strong>React Native SDK</strong> and <strong>Go-Gin middleware</strong>, which need to be initialized with an API key configured in the Traceblade project settings.</li></ol><p><strong>2. The Interface: </strong>For the MVP, I opted for <strong>separate views (events and logs)</strong>, as this allows me to build a solid foundation before tackling the complexities of a <strong>unified experience</strong>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.loom.com%2Fembed%2Ff7fd3d2fc78649289e086869f5ef47bc&amp;display_name=Loom&amp;url=https%3A%2F%2Fwww.loom.com%2Fshare%2Ff7fd3d2fc78649289e086869f5ef47bc&amp;image=https%3A%2F%2Fcdn.loom.com%2Fsessions%2Fthumbnails%2Ff7fd3d2fc78649289e086869f5ef47bc-5afd84d85e6e9e91.gif&amp;type=text%2Fhtml&amp;schema=loom" width="1920" height="1440" frameborder="0" scrolling="no"><a href="https://medium.com/media/cfe30ba3278d252e47dac42f8916b996/href">https://medium.com/media/cfe30ba3278d252e47dac42f8916b996/href</a></iframe><ul><li><strong>Natural Language Querying: </strong>One of my favorite features is <strong>natural language querying</strong>, which will make it easy to search and filter data using simple, human-readable queries. This feature, demonstrated briefly at the <a href="#">14-second mark of the video,</a> this can go beyond raw data visualization and provide actionable insights</li></ul><h3>The Next Steps</h3><p>So far, I have captured the basics, but there is still so much more to do. My focus for the next milestones includes:</p><ul><li><strong>Unified Timeline View</strong>: Combining user events and logs into a single interface to understand the ripple effects of user interactions across services.</li><li><strong>Advanced Filtering</strong>: Allowing users to fine-tune searches across events and logs.</li><li><strong>User Paths/Journeys</strong>: Analyzing and presenting user journeys within an app.</li><li><strong>Scalability</strong>: Ensuring Traceblade can handle larger datasets efficiently.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05133fda3be8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>