<?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 Praveen Upadhyay on Medium]]></title>
        <description><![CDATA[Stories by Praveen Upadhyay on Medium]]></description>
        <link>https://medium.com/@praveen-upadhyay?source=rss-d725a8e57425------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Praveen Upadhyay on Medium</title>
            <link>https://medium.com/@praveen-upadhyay?source=rss-d725a8e57425------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 20:54:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@praveen-upadhyay/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[The “Why”: Developer Insights]]></title>
            <link>https://medium.com/@praveen-upadhyay/the-why-developer-insights-0c8766592754?source=rss-d725a8e57425------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c8766592754</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[getting-started]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[organizational-culture]]></category>
            <category><![CDATA[developer-mindset]]></category>
            <dc:creator><![CDATA[Praveen Upadhyay]]></dc:creator>
            <pubDate>Sat, 17 Feb 2024 10:53:30 GMT</pubDate>
            <atom:updated>2025-01-22T13:54:52.858Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*9RfMnyUuWXK0Nf_E6-9HfQ.png" /></figure><p>I first formally got introduced to the word “why” when I read Simon Sinek’s renowned book, “<a href="https://simonsinek.com/books/start-with-why/"> Start With Why</a>”. I find this concept quite fascinating. We can apply it in various areas of our lives, whether it’s managing personal &amp; professional matters, running a business, or navigating day-to-day routines.</p><p>Now, you might be wondering, what does all this have to do with us, the developers? Well, let me tell you — it’s everything. Developers are the architects behind the digital landscape. We write the code that brings softwares to life, shaping the experiences the consumers encounter daily.</p><p>Despite robust processes in place to scrutinise software increments, even industry giants face challenges such as outages — some attributable to infrastructure constraints, while others stem from bugs in the code or flawed designs. Therefore, it becomes crucial to meticulously examine every piece of code that goes to production line. This responsibility rests on the developer, who must ask critical questions about the requirements they’re tasked with coding for.</p><p><em>Every single line of code you add has a potential to blow up the system or to introduce bugs. Asking “Why” is a way to critically question every line of code you modify.</em></p><h4>One-Liner Disaster</h4><p>Would you question something as simple as an INFO log, that too when it is too well written 🙂? Neither did I, when I added a log to a workflow. The pull request sails through approvals, unit tests, and lower environment automation tests. Yet, upon deployment to production, the service starts crashing. It took considerable effort and downtime to trace the issue, and the culprit? The <strong>INFO log, </strong>which inadvertently caused CPU over-burn. Now, let’s revisit the INFO log scenario with some crucial questions in mind:</p><p><em>⦿ Should this log be categorised as INFO or DEBUG/TRACE?</em></p><p><em>⦿ Why is this log being added to this particular function or workflow?</em></p><p><em>⦿ How will this log impact system performance or resource utilisation?</em></p><p><em>Additionally, one could ask: Can the log’s detail level be adjusted to balance information needs with performance, security, or privacy concerns? Are there more efficient logging methods or approaches available to achieve the same objective?</em></p><p>These seemingly basic questions are anything but insignificant and could have avoided the outage altogether.</p><p>As developers, we receive requirements from various stakeholders — team members, architects, managers, product owners, or from our own inspired ideas. <strong>But before you jump onto solutions and write code, spend enough time answering just WHYs</strong>.</p><h4><em>Navigating Requirements with “Why”</em></h4><p>A common requirement might be presented as: <em>“The user has encountered an issue and we want xyz as a solution.”</em> As a developer, your job is to really get to the problem statement and <strong>not necessarily follow the solution described in the requirement.</strong></p><p>For instance, a user requesting <em>a text-box to be converted into a text-area on a UI screen</em> prompts deeper questions: <em>“Is that text-box really the user’s problem? What is the user’s purpose for such a long text?</em> <em>Is that text-box intended for it? Would text-area really help solve the problem?</em>” Questions like these lead to the actual problem statement and the proposed solution might not be the best one.</p><p>This outlines the importance of delving deeper into user needs rather than blindly adhering to stated solutions, particularly in critical backend systems where oversight can have significant repercussions.</p><h4>Rowing the boat with communication</h4><p>Deep down, many developers understand when a proposed solution isn’t the ideal approach. Yet, they may struggle to articulate the right questions.</p><p>Rather than agreeing to implement a suboptimal solution due to communication challenges, developers should seek assistance from colleagues. Whether within their team or across teams, reaching out for guidance can help navigate communication challenges and cater to requirements more effectively.</p><p>However, even adept communicators may falter in asking the right questions. This reluctance can stem from various factors, including a misconception that the impact of decisions will be negligible or a belief that accountability is diffused across the team.</p><h4>The Aftermath</h4><p>The consequences of not analysing the use case end to end and avoiding critical questions are manifold: accumulation of technical debt, production outages, and latent bugs that may only surface after considerable time has elapsed.</p><p>Several factors, including organisational culture, empowerment, accountability, and responsibility significantly influence developers and teams in asking the right questions.</p><p><em>The power of “why” extends far beyond mere curiosity. It is a mindset — a commitment to understanding the underlying motivations and implications of our actions. By fostering this mindset, developers can create more robust, resilient systems that stand the test of time. So, the next time you find yourself knee-deep in code, remember to pause, reflect, and ask yourself: “Why?”</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c8766592754" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Not every complex problem needs a complex solution]]></title>
            <link>https://medium.com/@praveen-upadhyay/not-every-complex-problem-needs-a-complex-solution-44edffc6b951?source=rss-d725a8e57425------2</link>
            <guid isPermaLink="false">https://medium.com/p/44edffc6b951</guid>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Praveen Upadhyay]]></dc:creator>
            <pubDate>Sat, 24 Jun 2023 13:55:24 GMT</pubDate>
            <atom:updated>2023-06-24T13:55:24.408Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*d0jRzxWbljGDv4s5H3kp7w.jpeg" /><figcaption>source — Google</figcaption></figure><p>This was in around year 2012, we were working with MySQL when we faced a tricky database related problem. We had to store ~350 millions of rows containing just two columns, phone number and a boolean flag(True, False). The source used to release updated phone numbers twice a week which were expected to be added to the table within 2–3 days.</p><p>The application running 24 X 7 and handling ~1000 req/s during peak time had to query from this table for given phone numbers.</p><h4><strong>Deciding table engine type: InnoDB vs MyISAM</strong></h4><p>In MySQL, table engine type needs to be specified while creating the table. InnoDB is the default and most commonly used engine type, another option is MyISAM. MySQL does provide <a href="https://www.w3resource.com/mysql/mysql-storage-engines.php">more options</a> for table engine type but for our interest we will stick to these two.</p><p>InnoDB supports CRUD(create, read, update and delete) flawlessly but the select query performance would deteriorate once you reach millions of rows, while MyISAM keeps the performance consistent irrespective of number of rows.<strong> </strong>One thing about MyISAM though, it acquires table-level lock for DML queries, meaning you cannot run select and update parallelly.</p><p>Given the scenario and due to integrations with legacy system, MySQL was the only choice for us so we decided to use MyISAM table engine type as the select performance was the key factor for our requirement.</p><p>This solved our problem, except one and if you have guessed it by now, how to avoid table locking while we update the database with the incremental data. We did many experiments and did not succeed, the application could not run select query when the updates were going on.</p><h4>Solution</h4><p>The table having phone number and boolean flag, still waiting for its comeback in this story :), let’s name it “table_A”. This is the table which the application is to query for phone number.</p><p>The team thought of a very interesting solution, a small script to perform the incremental updates. Since the updates on table were not real-time and could be planned, additional table space on disk was not an issue for us either<em>, </em>so we created a copy(with data) of table_A, let’s name it “table_B”. <strong>In this solution, the goal is to keep both the tables identical.</strong></p><p>To update the table with incremental data, we performed the updates on table_B. <em>Remember, table_B is not in use by the application</em>, so we are okay with table locking. Once the updates were done on table_B, <strong>we swapped the tables by renaming table_B to table_A and vice versa</strong>.</p><pre>ALTER TABLE table_A RENAME old_table_A;<br>ALTER TABLE table_B RENAME table_A;<br>ALTER TABLE old_table_A RENAME table_B;</pre><p>Since the rename is just a pointer change for the object, takes no time, means no impact on Application at all. Performed same update operation on table_B which was earlier table_A. With this, both the tables are up to date and identical.</p><p><em>The solution might sound like a “</em><a href="https://en.wikipedia.org/wiki/Jugaad"><em>Jugaad</em></a><em>”. Renaming table in Production is not a good idea for multiple reasons, but given the constraint(of technology choices) and flexibility(including that there were no references attached to the table), this is the best we could come up with. The idea is to demonstrate that “Not every complex problem needs a complex solution”.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44edffc6b951" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>