<?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 Karthik Namboori on Medium]]></title>
        <description><![CDATA[Stories by Karthik Namboori on Medium]]></description>
        <link>https://medium.com/@namkarthik2003?source=rss-262375bd48ec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DCx8YgOtU-vVRT5WEhUDaA.jpeg</url>
            <title>Stories by Karthik Namboori on Medium</title>
            <link>https://medium.com/@namkarthik2003?source=rss-262375bd48ec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 11:13:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@namkarthik2003/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[Cache In on Speed: Boost your backend performance with caching!]]></title>
            <link>https://medium.com/@namkarthik2003/cache-in-on-speed-boost-your-backend-performance-with-caching-3fb9b18f5217?source=rss-262375bd48ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fb9b18f5217</guid>
            <category><![CDATA[caching]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Karthik Namboori]]></dc:creator>
            <pubDate>Tue, 15 Oct 2024 12:39:38 GMT</pubDate>
            <atom:updated>2024-10-15T15:01:01.532Z</atom:updated>
            <content:encoded><![CDATA[<p>As developers, we strive to make our systems resilient, scalable, and highly performant. There are several steps one can take to optimise an application while moving from a simple client-server architecture to a complex and robust system. This article is a detailed explanation of one such step<br> — <strong><em>Caching</em></strong>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4523VGjV2FXcWvHcYJgwNA.jpeg" /><figcaption>Generated by MetaAI</figcaption></figure><h3>Table of Contents 🚀</h3><ol><li><strong><em>Introduction: Why Caching is the Key to Lightning-Fast Performance</em></strong></li><li><strong><em>The Secret Behind Caching: Understanding Locality of Reference</em></strong></li><li><strong><em>A Deep Dive into Cache Types: Client-Side vs. Server-Side.</em></strong></li><li><strong><em>Mastering the Art of Caching: Proven Strategies for Speed and Efficiency</em></strong></li><li><strong><em>Where Does the Magic Happen? Discover Where Caches Live</em></strong></li><li><strong><em>Supercharging Next.js with Caching</em></strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TsBXoYuOwgX0gvkHwfIBzg.jpeg" /><figcaption>Generated by MetaAI</figcaption></figure><blockquote><strong><em>1. Introduction: Why Caching is the Key to Lightning-Fast Performance</em></strong></blockquote><p>An optimised backend is critical for achieving rapid response times, optimal resource utilisation, and a consistent user experience. Conversely, poor backend optimisation can lead to slow loading times, decreased scalability, and increased latency. Additionally, it can result in higher costs, as more resources are needed to support the same number of users.</p><p>Some strategies to build robust and fast backend systems include server performance tuning (e.g., horizontal scaling with load balancing and vertical scaling), database optimisations (e.g., indexing, query optimisations, normalisation, and denormalisation) , code optimisations — to reduce latency and response time, CPU cycles and memory consumed, Algorithmic efficiency (using the right algorithm, data structure, Asynchronous programming) and today’s focus: <strong><em>caching strategies.</em></strong></p><p>Caching involves storing copies of data in a temporary storage area (cache) to speed up data retrieval. Few strategies involve what data to cache, how long to cache it (TTL) and cache invalidation policies.</p><blockquote><strong><em>2. The Secret Behind Caching: Understanding Locality of Reference</em></strong></blockquote><p><strong><em>Temporal locality of reference:</em></strong> Data that is requested multiple times is likely to be requested again hence it makes sense to store it in cache.</p><p><strong><em>Spatial Locality of reference:</em></strong> Data that is located close to the memory of item being requested is likely to be requested for, in the coming future.</p><p>Let us take the example of a simple for loop that finds the sum of all the numbers in an array of size 1000. It is stored in a integer variable called sum.</p><pre>int sum = 0;<br>int arr[1000]; // assume there are 1000 random numbers in the array.<br>for(int i = 1; i &lt; 1000; i++){<br>    sum += arr[i];<br>}</pre><ul><li><strong><em>Temporal locality</em></strong><em>:</em> We are accessing the memory of the variables i and sum repeatedly in every iteration hence it makes sense to cache theses.</li><li><strong><em>Spatial locality:</em></strong> When we access the memory location at one index of the array, we are likely to access the memory adjacent to it as well, hence caching it too. Considering that the array is of contiguous memory, it makes all the more sense.</li></ul><blockquote><strong><em>3. A Deep Dive into Cache Types: Client-Side vs. Server-Side.</em></strong></blockquote><p>Caches are of 2 types, <strong><em>client-side caches</em></strong> and <strong><em>server-side caches</em></strong>. Client side caches are done using the browser for static assets like images, CSS sheets and caching API responses using service workers in modern web applications while server side caches are done on the backend server. Server side caches can again be of two types, In-memory caches and disk caches. In-memory caches, for example, Redis and memcached. Disk caches are often used when the dataset is too large to cache entirely in memory. It is important to note that disk based caches are relatively slow. (Disk access is expensive and slow)</p><blockquote><strong><em>4. Mastering the Art of Caching: Proven Strategies for Speed and Efficiency</em></strong></blockquote><p>For the sake of understanding, I will explain each technique taking the example of Node.js (the backend server, AKA “application”), Redis for caching and finally, PostgreSQL as the database. Another point to remember is that reading from memory (cache) is much faster and significantly less expensive than reading from disk (database)</p><h4><strong><em>Cache Aside Pattern</em></strong></h4><ul><li>It is also known as Lazy Loading. When the server/ application needs some data, it first checks if its present in the cache, If yes, returned to the client, else, the data is fetched on querying postgres and then returned to the user, storing on to the cache for future queries.</li><li>This way, frequently accessed data is cached, improving API performance and avoiding repeated database queries.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fwdaly5qaOPZxf9g2NM6uw.png" /></figure><h4><strong><em>Read Through Pattern</em></strong></h4><ul><li>When the server requests for some data which is not available in the cache, the cache itself fetches data from its underlying source (postgres), stores and returns the queried data.</li><li>Unlike cache-aside where the server fetches data, in read-through pattern, the cache is responsible to query the database.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pDvCAg_VEhu9Yrmlte_tAQ.png" /></figure><h4><strong><em>Write Through Pattern</em></strong></h4><ul><li>When the server writes/ updates data, it does so in the cache first which then updates the postgres DB only on success of which, the server (synchronously waits) receives an acknowledgement of completion.</li><li>This does not optimise write performance as the server has to wait synchronously for successful database write. Write-behind strategy is used for optimising writes.</li><li>Simplifies the cache architecture in the system.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WGWq38meqPbj4cPAjd-DHA.png" /></figure><h4><strong><em>Write Behind Pattern.</em></strong></h4><ul><li>In write-behind pattern, the modified cache entries are asynchronously written to the database after a configurable delay, say 10s, 1 day, 1 week or longer. This delay is also called write-behind interval.</li><li>This pattern maintains a write-behind queue, where the cache changes are stored on behind the other. After the write-behind delay passes, the database performs the write operations.</li><li>The data source never lags behind the changes in the cache longer than the write behind delay.</li></ul><h4><strong><em>Few benefits of write behind strategy:</em></strong></h4><ul><li>The server does not have to wait for data to be written to the underlying source, hence also improving user experience.</li><li>The load on the database is drastically reduced. The number of database read-write operations at an instant come down drastically. The Read operations are optimised by caching frequently accessed data. Writes are optimised in the following ways</li></ul><ol><li>The writes which are often more expensive than reads are reduced as multiple writes on the same data are coalesced and written only once to the underlying data source (“write-coalescing”).</li><li>Writes on different data are combined into a single database transaction and written to the underlying data source(“write-combining”). It is written in a batch.</li><li>The server is oblivious and independent of database failures. Since the cache updates reside in the cache, they can be re-queued in case of any write failure. In a way, the client can continue fetching data even if the database is down.</li><li>Scalability: For a distributed cache, increase the number of nodes to handle more requests, speed up read time and increase availability. Tune the write-behind interval empirically to optimize writes.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z7jOrCRxw5dWEWfB1i2znQ.png" /></figure><h4><strong><em>Write Back Pattern</em></strong></h4><ul><li>It is similar to write behind pattern. Data in the cache is written to the data source only after some event or trigger, till then the fresh data is present only in the cache.</li></ul><h4><strong><em>Refresh Ahead Pattern</em></strong></h4><ul><li>In this strategy, the cache automatically and asynchronously reloads (refresh) any recently accessed cache entry from the cache loader just before its expiration.</li><li>The refresh-ahead time is expressed as a percentage of the entry’s expiration time. For example, assume that the expiration time for entries in the cache is set to 60 seconds and the refresh-ahead factor is set to 0.5. If the cached object is accessed after 60 seconds, cache will perform a <em>synchronous</em> read from the database to refresh its value. However, if a request is performed for an entry that is more than 30 but less than 60 seconds old, the current value in the cache is returned and cache schedules an <em>asynchronous</em> reload from the cache store.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BlEwZkqB3spa3MvFdFtJaQ.png" /></figure><blockquote><strong><em>5. Where Does the Magic Happen? Discover Where Caches Live</em></strong></blockquote><ol><li>Client side</li><li>Forward Proxy</li><li>Reverse Proxy (Load balancer)</li><li>Application server</li></ol><blockquote><strong><em>6. Supercharging Next.js with Caching: A comparison with Node.js</em></strong></blockquote><p>Next.js, a modern monolithic framework to build full stack applications, support APIs but in the form of serverless functions. Unlike traditional web servers like Node.js where there is a server running and listening for API requests and can remember execution history, Next.js APIs are event-driven and don’t remember history between API calls. This makes caching all the more necessary!</p><ul><li>You can use <a href="https://upstash.com/">Upstash</a> — a managed Redis service for full-stack applications — or self-host Redis using <a href="https://docker.com/">Docker</a> and the ioredis library for Redis-client connectivity. The same can be extended for AWS Lambda serverless APIs as well!</li></ul><p>How has caching helped improve the performance of your applications? Have you tried any of the techniques mentioned in this article? Share your experiences, insights, or questions in the comments below! Let’s learn from each other and build faster, more efficient systems together.</p><blockquote><strong>👋 You can reach out or follow me on my socials: </strong><a href="https://github.com/karthik2603-theBrogrammer"><strong>Github</strong></a><strong> | </strong><a href="https://www.linkedin.com/in/karthik-namboori-145238216/"><strong>LinkedIn</strong></a></blockquote><p>Huge credit to the following sources that polished my understanding and inspired this article✨:</p><ul><li><a href="https://talent500.co/blog/backend-optimization-strategies/#Server_Performance_Tuning">https://talent500.co/blog/backend-optimization-strategies/#Server_Performance_Tuning</a></li><li><a href="https://dev.to/uzaxirr/caching-101-3agp">https://dev.to/uzaxirr/caching-101-3agp</a></li><li><a href="https://docs.oracle.com/cd/E13924_01/coh.340/e13819/readthrough.htm">https://docs.oracle.com/cd/E13924_01/coh.340/e13819/readthrough.htm</a></li><li><a href="https://makerkit.dev/blog/tutorials/nextjs-redis">https://makerkit.dev/blog/tutorials/nextjs-redis</a></li><li>The data flow diagrams made using <a href="https://excalidraw.com/">Excalidraw</a>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fb9b18f5217" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I won at the Code For Good Hackathon by JPMorgan Chase & Co.]]></title>
            <link>https://medium.com/@namkarthik2003/how-i-won-at-the-code-for-good-hackathon-by-jpmorgan-chase-co-7c3349ed95fa?source=rss-262375bd48ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c3349ed95fa</guid>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[jpmorgan-chase]]></category>
            <category><![CDATA[placement]]></category>
            <dc:creator><![CDATA[Karthik Namboori]]></dc:creator>
            <pubDate>Fri, 13 Sep 2024 10:26:26 GMT</pubDate>
            <atom:updated>2024-10-14T14:30:29.215Z</atom:updated>
            <content:encoded><![CDATA[<p>Having won the biggest hackathon by one of the biggest firms in the world is no ordinary achievement for me. I will cherish it for a long time to come. This was at the Bangalore office at the Code For Good hackathon by JPMorgan Chase &amp; Co.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uia5SUk4wyHF--IIkQHhcg.jpeg" /><figcaption>Picture taken after the prize ceremony, saying our final goodbyes.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4hUyAJsU4y7EDnQiJsOofg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gPeR1h6yTcTq60RXOA-7kg.jpeg" /><figcaption>Left: Me giving the presentation on stage in the final round || Right: Celled on stage after announced as winners. Received IPads and Certificates!</figcaption></figure><p>Here’s my experience and a guide on how you can win this prestigious hackathon:</p><p>There were 3 rounds in total. The entire process started around April of 2024 in my 6th Semester (3–2). It ended in the summer of my 3rd year — July 2024, right before placement season.</p><p><strong>Round 1</strong></p><ul><li>I received the HackerRank link in the first week of April 2024, and it was active for 3 days.</li><li>The questions were Medium level.</li></ul><p><strong>Round 2</strong></p><ul><li>HireVue Round: Selected students received links to take the next round conducted on HireVue. This round was a virtual HR-type round which is computer-evaluated.</li><li>The link for this came 10 days after the online test.</li><li>You receive 2 HR-based questions with 2 attempts each to record and submit answers. You would get a minute or two to answer (each attempt).</li><li>One question was about an experience where I showed leadership that yielded a positive outcome.</li></ul><p><strong>Round 3: Code for Good Hackathon!</strong></p><ul><li>Towards the end of May 2024, I received an invitation to RSVP for the hackathon scheduled on 27th and 28th of July 2024.</li><li>These were the dates for the Bangalore edition. Mumbai and Hyderabad had their editions well before.</li><li>There were 3 virtual workshop sessions with all participants conducted by the organizers. These covered points on Git and GitHub, hackathon survival tips, and many more.</li><li>We were put into teams of 6–7 with (random) people from across the country a few days before the hackathon.</li><li>All communication was done via Slack channels.</li></ul><p><strong>How my hackathon unfolded and my experience from the start all the way to the prize ceremony!</strong></p><ul><li>Funny thing is, on the morning of the 27th, I went to the wrong JPMorgan office. Yes, there are 3 in the same neighborhood!</li><li>After reaching the right one, I was greeted by volunteers who performed the entry procedures and showed me the way in.</li><li>After a delicious breakfast, I met my teammates and mentors for the first time! We had 3 mentors over the course of the hackathon.</li><li>All participants assembled in the main conference area where the event was kicked off! After a brief organizing team introduction, we proceeded to selecting our problem statements.</li><li>There were 4 problem statements, one by each NGO. There were 40 teams, 10 for each problem statement. We selected via a form on a first-come, first-served basis. Our topic was for the Shola Trust. Believe me, this moment is a make-or-break kind for your entire hackathon. This can decide 85% of your ENTIRE hackathon. Make sure your team is on the same page during the selection and choose wisely!</li><li>We then got isolated with 10 teams where we could ask questions to the NGO representatives to get more clarity on the problem statements.</li><li>Crunch time began! We stocked up on supplies (free chocolates, shakes, protein bars and what not) and began brainstorming.</li><li>A huge takeaway from the hackathon was the experience of planning a workflow as a team guided by the mentors. Each of us pitched in suggestions, we weighed the pros and cons, designed a schema for the database, made a high-level design diagram and discussed the tech stack. As we gave a lot of time to this, we faced very few problems later on. This learning helps me even now when I plan on building something!</li><li>The 24 hours went into building our solution, standup meetings, food, caffeine and repeat. We had a standup at 4:30 AM in the morning!</li><li>There was a strict deadline by which we had to push all the code to our repositories and close commits. We then swiftly created our presentations and gave trial runs for our demo. This helped me a lot as the time for the demo is very strict. Close to 7 minutes + Q&amp;A.</li><li>After our demo to the judges, we had breakfast and went to the conference room awaiting results for the final round of presentation. Here the top 2 teams would present again, but this time in front of esteemed judges/NGO representatives and the rest of the participants.</li><li>We <strong>nailed</strong> this presentation!</li><li>After half an hour of nervousness and anxiety, the winners were announced! Each of the winners in each problem statement received an iPad and certificate of victory.</li></ul><p><strong>Few tips to secure victory!</strong></p><ul><li>Good Tech, while necessary, is not exclusive to winning the hackathon. The sooner you realize this, the better your chance at building an MVP that takes you to victory. Don’t spend time using a complicated tech stack; minimum is good as long as it does the job.</li><li>Focus on the frontend. Spend time and make it look good.</li><li>Remember that you are pitching your solutions to NGOs. They may not necessarily understand your technical solutions, hence you must appeal to them in their way, i.e., a solution for the problem statement given by them.</li><li>Even though it’s not just about winning the hackathon but how well your mentors at JPMC find you, I strongly encourage you to strive for victory. This zeal, determination, and enthusiasm are definitely positive traits.</li><li>Be relentless and hungry to win. Don’t sleep if you have to, don’t hesitate to ask for help and speak with others. But make sure you are friendly and cooperative with your fellow peers.</li><li>Network and communicate as much as you can with the mentors, SMEs, organizers, and other employees at JPMorgan Chase.</li><li>Always try to present first! Remember, psychology says people remember you only if you present first or last. You get a chance to set an impression and a bar if you go first.</li></ul><p>Code for good is popularly known as Code For Food (haha) and boy did it live up to the name! Overall It was an once in a lifetime opportunity and had a great time meeting various people across the country! Looking forward to more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c3349ed95fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>