<?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 Hamsavardhinibaskar on Medium]]></title>
        <description><![CDATA[Stories by Hamsavardhinibaskar on Medium]]></description>
        <link>https://medium.com/@hamsavardhinibaskar?source=rss-5698f59cd9c1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hJ6w1zAzBYwg2rbo</url>
            <title>Stories by Hamsavardhinibaskar on Medium</title>
            <link>https://medium.com/@hamsavardhinibaskar?source=rss-5698f59cd9c1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 00:43:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hamsavardhinibaskar/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[Exploring LangGraph Through Building Stateful AI Workflows]]></title>
            <link>https://medium.com/@hamsavardhinibaskar/exploring-langgraph-through-building-stateful-ai-workflows-aea16267e9f9?source=rss-5698f59cd9c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/aea16267e9f9</guid>
            <dc:creator><![CDATA[Hamsavardhinibaskar]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 05:36:47 GMT</pubDate>
            <atom:updated>2026-04-14T05:36:47.347Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*oTQOSI3KrvrpxgsBUc4efQ.png" /></figure><p>Artificial intelligence applications are gradually moving beyond simple prompt-response interactions toward structured reasoning systems that can manage multi-step execution. While early experiments with language models often begin with direct API calls or linear pipelines, real-world applications quickly require workflows that support memory, decision -making, validation logic, and controlled execution paths. Working with LangGraph introduces a different perspective on how intelligent systems can be designed using graph-based execution instead of sequential chains.</p><h4>What is LangGraph?</h4><p>LangGraph is a workflow orchestration framework designed for building stateful and multi-step AI applications using graph-based execution instead of traditional linear pipelines. It allows language model workflows to be structured as interconnected nodes that communicate through a shared execution state, making it easier to manage reasoning steps, routing decisions, and intermediate outputs.</p><p>Unlike simple prompt-response pipelines, LangGraph treats execution as a sequence of coordinated transitions between processing stages. This makes it especially useful for applications that involve conditional branching, iterative refinement, tool interaction, or validation checkpoints during response generation.</p><p>Because of this structured execution model, LangGraph workflows resemble backend processing pipelines more than conversational scripts, allowing intelligent systems to behave in a predictable and extensible manner.</p><h3>Understanding the Core Architecture of LangGraph</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*usQNud1hZs5AwqJRfzJBSQ.png" /></figure><p>Before building workflows with LangGraph, it is useful to understand how execution is structured internally. LangGraph organizes agent workflows using a graph-based architecture where each processing stage communicates through a shared execution state instead of operating independently.</p><p>At the center of this architecture is the <strong>state object</strong>, which acts as the shared memory layer across the workflow. Each node reads information from the state, performs its task, and updates the state before passing execution forward. This makes intermediate reasoning steps visible and reusable across transitions.</p><p>Processing logic is implemented through <strong>nodes</strong>, where each node represents a specific responsibility such as interpreting input, generating responses, validating intermediate outputs, or preparing structured results. Rather than combining all logic inside a single prompt call, nodes divide execution into manageable stages.</p><p>Execution flow between nodes is controlled using <strong>edges</strong>, which define how the workflow transitions from one stage to another. These transitions can follow a fixed sequence or depend on conditional routing decisions based on updated state values.</p><p>These nodes and edges are connected together using a <strong>graph builder,</strong> which defines how execution should begin, how transitions occur between stages, and when the workflow should terminate. Once compiled, the graph behaves like a structured reasoning pipeline that moves through multiple stages before producing a final response.</p><p>This architecture makes LangGraph workflows resemble backend execution pipelines more than conversational scripts, allowing intelligent systems to support multi-step reasoning, validation checkpoints, and iterative execution patterns in a transparent and extensible way.</p><h4>Understanding the Shift from Chains to Graph-Based Execution</h4><p>Traditional language model workflows usually follow a predictable structure where execution moves through a simple linear interaction such as <strong>request → prompt → model → response</strong>. Execution typically ends after a single response is generated. This approach works well for simple assistants but becomes limiting when workflows require reasoning across multiple steps.</p><p>LangGraph changes this execution model by introducing nodes connected through transitions, allowing execution to follow a structured workflow such as <strong>request → node → state update → routing decision → next node → response</strong>. Instead of forcing logic into a single prompt template, execution is divided into clearly defined stages that communicate through a shared state. Each transition determines what happens next, allowing workflows to adapt dynamically depending on intermediate results.</p><p>This shift makes application behavior easier to observe and control. Instead of debugging prompts, workflows can be inspected as structured execution paths.</p><h4>Working with Stateful Execution Instead of Stateless Responses</h4><p>One of the most noticeable differences when working with LangGraph is the importance of state. Many early language model applications rely heavily on prompt context to maintain continuity between steps. LangGraph treats state as a central element of workflow design rather than an optional extension.</p><p>Each node reads from the shared state and updates it after completing its task. This allows execution to progress logically across multiple stages without losing context. Applications that involve reasoning, validation, or refinement benefit greatly from this approach because intermediate outputs remain accessible throughout the workflow lifecycle.</p><h4>Structuring Workflows Using Nodes and Transitions</h4><p>LangGraph encourages breaking complex workflows into smaller responsibilities handled by individual nodes. Instead of solving everything inside a single model call, tasks are distributed across structured execution stages.</p><p>During experimentation with LangGraph workflows, several types of nodes naturally emerge:</p><p>nodes responsible for interpreting requests<br>nodes responsible for generating responses<br>nodes responsible for validating intermediate output<br>nodes responsible for preparing final structured results</p><p>This modular structure improves flexibility because each stage can evolve independently as requirements change.</p><p>Transitions between nodes define how execution moves forward. Conditional routing allows workflows to revisit earlier steps, continue forward, or terminate depending on intermediate results. This makes the execution process transparent and easier to maintain.</p><h4>Integrating LangGraph with the LangChain Ecosystem</h4><p>LangGraph works closely alongside LangChain, extending its capabilities rather than replacing them. LangChain simplifies interactions with models, tools, and external data sources, while LangGraph focuses on organizing how those components interact across time.</p><p>This layered architecture makes it possible to build applications that are not only intelligent but also structured and predictable. Instead of relying entirely on prompt engineering, workflows begin to resemble orchestrated backend systems with defined execution paths.</p><h4>Why LangGraph Was More Suitable Than a Traditional Chain-Based Pipeline</h4><p>While frameworks such as LangChain simplify model interaction and tool integration, managing workflows that involve multiple reasoning stages often requires stronger execution control than sequential chaining can provide.</p><p>Graph-based execution introduces a workflow structure where transitions depend on shared state rather than fixed ordering. This makes it possible to separate interpretation logic, response generation, validation stages, and routing decisions into independent components that cooperate through structured execution flow.</p><p>During workflow experimentation, this approach made reasoning behavior easier to inspect because execution paths were explicitly defined instead of embedded inside prompt templates. Routing decisions became part of application logic rather than hidden prompt instructions, which improved both readability and extensibility of the system design.</p><p>This difference becomes especially important when workflows require conditional branching, refinement loops, or intermediate verification before producing final output.</p><h4>What Did I Develop?</h4><p>Working with <strong>LangGraph</strong> encouraged thinking about AI applications as structured execution pipelines rather than simple prompt–response systems. Instead of generating output in a single model call, the workflow was designed as a sequence of coordinated reasoning steps connected through a shared state.</p><p>During experimentation, a small code-generation component was implemented as part of the broader workflow to better understand how LangGraph manages execution across multiple nodes. Rather than sending one prompt to generate complete output, the system was structured into separate responsibilities that interacted through a shared state object.</p><p>The workflow began with defining a structured state representation inside state.py, which allowed intermediate outputs such as the interpreted request, generated code, and refinement steps to persist across execution stages. This made it possible for each node to operate with awareness of previous decisions instead of recomputing context repeatedly.</p><p>Execution logic was then separated into modular processing stages inside nodes.py. Each node handled a specific task within the workflow, such as interpreting the user’s intent, generating code responses, and preparing structured output. Splitting responsibilities across nodes improved clarity and made the reasoning flow easier to inspect during development.</p><p>Routing behavior inside the workflow was controlled through router.py, where transitions between nodes were determined based on intermediate results stored in the shared state. This allowed execution paths to adapt dynamically instead of following a fixed sequence. Depending on the state updates, the workflow could continue forward, revisit earlier reasoning steps, or finalize the response.</p><p>The overall structure of the agent workflow was assembled inside graph_builder.py, where nodes were connected using LangGraph’s graph construction model. This step made the execution pipeline explicit and readable, transforming what would normally be hidden prompt logic into a transparent reasoning graph.</p><p>Finally, main.py handled workflow execution by initializing the graph and triggering the processing pipeline based on user input. This separation between graph definition and execution entry point made the architecture easier to extend and maintain.</p><p>Although the code-generation module itself remained intentionally lightweight, it demonstrated how LangGraph enables interpretation, generation, and refinement to operate as independent yet coordinated reasoning stages. More importantly, it showed how graph-based orchestration allows execution paths to evolve dynamically depending on intermediate state updates rather than relying on a single static prompt.</p><blockquote>GitHub: <a href="https://github.com/hamsa-09/code-generator-langgraph">https://github.com/hamsa-09/code-generator-langgraph</a></blockquote><h4>Observing the Role of Memory in Multi-Step Reasoning</h4><p>Memory plays an important role in LangGraph workflows. Instead of relying solely on prompt history, the execution state acts as structured memory that persists across transitions.</p><p>Short-term workflow memory ensures that intermediate outputs remain accessible throughout execution. This allows agents to refine earlier steps, validate generated responses, or incorporate additional reasoning stages before producing final results.</p><p>Checkpoint mechanisms extend this capability even further by enabling workflows to resume execution without restarting from the beginning. This feature becomes especially valuable when building assistants that perform long-running or multi-stage reasoning tasks.</p><h4>Extending LangGraph Workflows with Retrieval-Augmented Generation (RAG)</h4><p>Another important realization while working with structured agent workflows is how naturally external knowledge retrieval can be integrated into graph-based execution pipelines.</p><p>Traditional language model responses depend heavily on pretrained knowledge and prompt context. However, many real-world applications require access to organization-specific documents, structured datasets, or frequently updated information sources. Retrieval-Augmented Generation (RAG) addresses this requirement by introducing a retrieval stage before response generation begins.</p><p>LangGraph supports this pattern naturally because retrieval can be implemented as an independent workflow node that contributes additional context to the shared execution state before later reasoning stages continue.</p><p>Instead of treating retrieval as a separate pipeline, it becomes part of the reasoning graph itself. A retrieval node can collect relevant information, update workflow state, and allow downstream nodes to generate responses that are grounded in external knowledge rather than relying only on model context.</p><p>Even though the experimental workflow primarily focused on structured reasoning and execution control, the architecture demonstrated how easily retrieval nodes can be introduced into the graph when applications require document-aware or context-sensitive responses. This flexibility highlights how LangGraph workflows can evolve from simple reasoning pipelines into knowledge-aware agent systems.</p><h4>Supporting Human-in-the-Loop Execution Inside Agent Workflows</h4><p>Many real-world AI workflows cannot operate as fully autonomous pipelines. Tasks such as document generation, structured response validation, or code synthesis often benefit from intermediate verification before execution continues.</p><p>LangGraph supports this requirement through its state-driven execution model, where workflows can pause between nodes and resume once additional input becomes available. This makes it possible to design workflows that incorporate validation checkpoints without restructuring the entire pipeline.</p><p>Even in smaller workflow experiments, introducing structured reasoning stages demonstrated how execution could remain flexible instead of strictly linear. Human-in-the-loop interaction ensures that agent behavior remains controllable while still benefiting from automated reasoning stages.</p><p>This capability becomes especially useful in applications where correctness, safety, or approval workflows play an important role.</p><h4>Why Graph-Based Thinking Changes Agent Design</h4><p>One of the most important insights gained while working with LangGraph workflows is how naturally applications begin to resemble decision pipelines instead of chat interfaces.</p><p>Execution is no longer hidden inside prompt templates. Instead:</p><p>each node represents responsibility<br>each transition represents logic<br>each state update represents progress</p><p>This structured approach makes workflows easier to understand, easier to extend, and easier to debug.</p><p>Graph-based reasoning also supports iterative execution patterns that are difficult to implement using linear chains alone. As workflows grow more complex, this structure becomes increasingly valuable.</p><h4>Supporting Iterative Reasoning Instead of Single-Step Responses</h4><p>Another important observation during experimentation with graph-based workflows was the ability to support iterative reasoning cycles.</p><p>Instead of generating responses once and terminating execution, workflows can revisit earlier reasoning stages when refinement becomes necessary. Conditional transitions allow execution paths to adapt dynamically depending on intermediate state values, making it possible to introduce validation loops or fallback strategies when required.</p><p>Even lightweight workflow components demonstrated how separating interpretation, generation, and refinement into independent nodes improves transparency of reasoning steps while maintaining flexibility in execution flow.</p><p>This loop-oriented execution model reflects how modern agent systems operate in structured reasoning environments rather than simple conversational pipelines.</p><h4>LangGraph as a Step Toward Production-Ready Agent Systems</h4><p>Modern AI systems increasingly require reliability, transparency, and structured execution. Stateless prompt pipelines struggle to support applications that depend on validation steps, tool usage, or multi-stage reasoning.</p><p>LangGraph introduces a workflow-oriented development approach that aligns closely with how production systems are designed. Instead of focusing only on prompt construction, development begins to focus on execution structure, state transitions, and modular reasoning stages.</p><p>Even small workflow experiments demonstrate how graph-based orchestration improves clarity and flexibility while preparing applications for more advanced agent capabilities in the future.</p><p>As AI development continues moving toward agent-based architectures, LangGraph provides a practical foundation for building systems that behave less like isolated model calls and more like coordinated reasoning workflows.</p><h4>When LangGraph May Not Be Necessary</h4><p>Although LangGraph provides strong workflow orchestration capabilities, not every language model application requires graph-based execution. Simpler applications such as direct chatbot interfaces or single-step generation pipelines can often be implemented efficiently using traditional chaining approaches.</p><p>LangGraph becomes most valuable when applications involve conditional routing, iterative reasoning loops, shared execution state, or structured multi-stage workflows. For smaller prompt-response systems, introducing graph-based orchestration may increase architectural complexity without providing significant benefits.</p><p>Understanding when to introduce workflow orchestration helps ensure that LangGraph is applied where it provides the most value.</p><h4><strong>Conclusion</strong></h4><p>Working with LangGraph demonstrates how modern agent systems benefit from structured execution instead of relying entirely on prompt engineering. Separating reasoning stages into nodes, managing shared workflow state, and introducing conditional routing logic transforms language model applications into transparent and extensible execution pipelines.</p><p>Even small workflow implementations highlight how graph-based orchestration improves reasoning clarity while preparing applications for advanced capabilities such as retrieval integration, validation checkpoints, and human-in-the-loop execution. As agent-based architectures continue evolving, workflow-driven frameworks like LangGraph provide a practical foundation for building intelligent systems that behave more like coordinated backend services than isolated model responses.</p><p><strong>Reference</strong></p><p><a href="https://medium.com/@susmit.vssut/the-basics-of-langgraph-a-step-by-step-guide-to-ai-workflows-478852840f5d">https://medium.com/@susmit.vssut/the-basics-of-langgraph-a-step-by-step-guide-to-ai-workflows-478852840f5d</a></p><p><a href="https://medium.com/@ashutoshsharmaengg/getting-started-with-langgraph-a-beginners-guide-to-building-intelligent-workflows-67eeee0899d0">https://medium.com/@ashutoshsharmaengg/getting-started-with-langgraph-a-beginners-guide-to-building-intelligent-workflows-67eeee0899d0</a></p><p><a href="https://medium.com/data-science/from-basics-to-advanced-exploring-langgraph-e8c1cf4db787">https://medium.com/data-science/from-basics-to-advanced-exploring-langgraph-e8c1cf4db787</a></p><p><a href="https://medium.com/kbtg-life/building-a-smarter-agent-with-langgraph-a-guide-to-short-term-memory-and-context-engineering-25b1f7ae155d">https://medium.com/kbtg-life/building-a-smarter-agent-with-langgraph-a-guide-to-short-term-memory-and-context-engineering-25b1f7ae155d</a></p><p><a href="https://medium.com/cyberark-engineering/building-production-ready-ai-agents-with-langgraph-a-real-life-use-case-7bda34c7f4e4">https://medium.com/cyberark-engineering/building-production-ready-ai-agents-with-langgraph-a-real-life-use-case-7bda34c7f4e4</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aea16267e9f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Caching Strategies in Backend Systems Using Redis and Spring Boot]]></title>
            <link>https://medium.com/@hamsavardhinibaskar/exploring-caching-strategies-in-backend-systems-using-redis-and-spring-boot-0df8ca463151?source=rss-5698f59cd9c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/0df8ca463151</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[type]]></category>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[caching]]></category>
            <category><![CDATA[local-setup]]></category>
            <dc:creator><![CDATA[Hamsavardhinibaskar]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 08:30:09 GMT</pubDate>
            <atom:updated>2026-03-31T08:30:09.954Z</atom:updated>
            <content:encoded><![CDATA[<p>When I first started building full-stack applications, my focus was mainly on getting the API working, connecting it to the database, and displaying data on the frontend.</p><p>Initially, with a small number of requests, the response time seemed fast. However, as I began testing more frequently and simulating multiple users, I noticed that the same data was being fetched from the database repeatedly, even when it hadn’t changed.This led to unnecessary database load and inefficient performance.</p><p>That’s when I understood the importance of caching storing frequently accessed data temporarily so that repeated requests can be served faster without hitting the database every time.</p><h4>Let’s Understand What is Caching?</h4><p>Caching is a technique where frequently used data is stored temporarily so that it can be accessed faster when needed again. It improves application speed and reduces unnecessary computation or database queries. For example, if many users request the same product details from a database, instead of querying the database every time, we can store the result in cache and reuse it.</p><h4>Why Caching Becomes Necessary in Backend Systems?</h4><p>In early development stages, applications usually perform well because request volume is small. However, performance bottlenecks begin to appear when endpoints start serving frequently requested data such as product listings, dashboard statistics, or user profile information.</p><p>A typical request flow without caching looks like this:</p><blockquote>Client → Server → Database → Server → Client</blockquote><p>Even if the same response is requested hundreds of times, the database is queried repeatedly.</p><p>Introducing a caching layer changes the workflow:</p><blockquote>Client → Server → Cache → Database (only if cache miss)</blockquote><p>When cached data exists, the database is no longer involved. This reduces latency and preserves database resources for operations that truly require computation.</p><p>Caching therefore becomes essential when identical responses are requested frequently like database queries involve joins or aggregations, dashboards generate repeated analytics result, third-party APIs impose request limits, applications scale across multiple servers</p><p>Instead of treating caching as an optional optimization, it becomes part of the system architecture.</p><h4>When to Use Caching</h4><p>Caching becomes useful when the same data is requested frequently but does not change very often. Common examples include product listings, dashboard statistics, configuration values, and user profile information. In such cases, retrieving data from cache is much faster than querying the database repeatedly, which improves both performance and user experience.</p><p>It is especially helpful in scenarios involving expensive database queries, third-party API integrations, or high-traffic endpoints where repeated computation can slow down the system. However, caching should be applied carefully and is generally avoided for data that changes frequently, such as payment status, authentication tokens, or real-time tracking information, where accuracy is more important than speed.</p><h4>Where Caching Fits Inside Application Architecture</h4><p>Caching operates as an intermediate performance layer positioned between the application and its data sources. Rather than replacing the database, it reduces unnecessary interactions with it.</p><p>The request lifecycle with caching generally follows this structure:</p><ol><li><strong>Request arrives</strong></li><li><strong>Check cache</strong></li><li><strong>If cache hit → return response immediately</strong></li><li><strong>If cache miss → query database</strong></li><li><strong>Store result in cache</strong></li><li><strong>Return response</strong></li></ol><p>This strategy is commonly known as the <strong>cache-aside pattern</strong>, one of the most widely used caching techniques in backend development.</p><h4><strong>Let’s Know Types of Caching</strong></h4><h4>In-Memory Caching</h4><p>In-memory caching is usually the first caching strategy introduced during backend optimization because it requires minimal setup. Data is stored directly inside the application process using objects or lightweight libraries.</p><p>For example, frequently requested configuration values or user profile responses can be temporarily stored in application memory and reused without repeated database queries.</p><p>Since memory access is extremely fast, this approach significantly improves response speed for smaller systems. However, in-memory caching introduces important limitations:</p><ul><li><em>cached data disappears when the server restarts</em></li><li><em>cache cannot be shared across multiple application instances</em></li><li><em>scaling horizontally creates inconsistent cache states</em></li></ul><p>Because of these limitations, in-memory caching is best suited for small applications or temporary optimization scenarios rather than distributed production environments.</p><h4>Redis Caching</h4><p>Redis provides a more reliable and scalable caching solution by operating as a separate in-memory data store shared across application instances. Instead of storing cached data inside the application itself, Redis stores it in RAM while remaining accessible to all backend servers.</p><p>This changes the architecture from:</p><blockquote><strong>Application → Database</strong> to <strong>Application → Redis → Database</strong></blockquote><p>When requests arrive, Redis is checked first. If the requested data exists, it is returned immediately. Otherwise, the application retrieves the data from the database and stores it in Redis for future requests.</p><p>Redis improves backend performance because memory-based storage enables millisecond, response times, cache entries support expiration policies (TTL), multiple servers can share the same cached data, cache invalidation can be automated, distributed systems maintain consistency. These characteristics make Redis one of the most commonly used caching systems in production-grade applications.</p><h4>Browser Caching</h4><p>While working on frontend performance optimization, browser caching plays an important role in improving application speed. Browsers automatically store static assets such as images, CSS files, and JavaScript files, so they do not need to be downloaded again on every request. By configuring proper cache headers on the backend server, previously downloaded resources can be reused efficiently. This significantly reduces loading time and enhances the overall user experience. As a result, images load faster, CSS files do not reload repeatedly, and JavaScript bundles are reused, making React applications feel much faster and more responsive.</p><h4>API Response Caching</h4><p>Another useful caching technique is API response caching, which helps improve backend performance and scalability. Some APIs return the same data frequently, such as dashboard statistics or product lists. Instead of querying the database on every request, these responses can be cached using tools like Redis. This approach reduces server processing time, improves API response speed, and enables the system to handle multiple users more efficiently. It is especially effective in dashboard-type applications, where frequent data access is required, making a noticeable difference in overall performance and responsiveness.</p><h4>Database Query Caching</h4><p>While optimizing backend performance further, database query caching becomes an effective technique for reducing system load. Instead of caching entire API responses, the results of expensive database queries can be cached. This is particularly useful in scenarios where queries involve joins, use aggregation, or generate reports frequently. By caching these query results, the number of repeated database operations is minimized, which reduces database workload and improves overall system performance.</p><h4>Common Caching Techniques Used in Backend Systems</h4><p>While exploring caching during backend development, it became clear that caching is not just about storing data in memory. Different caching techniques are used depending on how applications interact with the database and cache layer.</p><p>One of the most commonly used approaches is the <strong>cache-aside pattern (lazy loading)</strong>. In this technique, the application first checks whether the requested data exists in the cache. If the data is not available, it is fetched from the database and then stored in the cache for future requests. This pattern is simple to implement and works well for read-heavy applications. The Redis integration in this setup follows this approach.</p><p>Another technique is the <strong>read-through pattern</strong>, where the cache itself is responsible for retrieving data from the database when a cache miss occurs. This reduces the amount of cache-handling logic inside the application, but requires tighter integration between the cache layer and data source.</p><p>The <strong>write-through pattern</strong> ensures that whenever data is updated, it is written to both the cache and the database at the same time. This keeps cached data consistent with the database, although it slightly increases write latency.</p><p>In contrast, the <strong>write-behind pattern</strong> improves write performance by first updating the cache and then updating the database asynchronously at a later time. This approach is useful in systems where immediate database consistency is not required.</p><p>Another useful strategy is <strong>write-around caching</strong>, where data is written directly to the database without updating the cache. This helps prevent unnecessary cache usage when the updated data is unlikely to be requested again soon.</p><h4>Cache Eviction Policies</h4><p>Since cache memory is limited, eviction policies are used to decide which data should be removed when the cache becomes full.</p><p>The <strong>Least Recently Used (LRU)</strong> policy removes items that have not been accessed for the longest time. This is commonly used in systems where recently accessed data is more likely to be requested again.</p><p>The <strong>Least Frequently Used (LFU)</strong> policy removes items that are accessed less often compared to others, making it useful when access frequency patterns are predictable.</p><p>The <strong>First-In First-Out (FIFO)</strong> policy removes the oldest cached entries regardless of how frequently they are used.</p><p>Another commonly used mechanism is <strong>Time-to-Live (TTL)</strong>, where cached data automatically expires after a predefined duration. TTL was especially useful during the Redis setup because it helped ensure that outdated cache entries were removed automatically.</p><h4>When Not to Use Caching?</h4><p>Caching should not be used when applications require <strong>real-time accurate data</strong>. For example, operations like payment status updates, OTP verification, authentication checks, or live tracking systems must always return the latest information. Using cached responses in such cases may lead to incorrect behaviour.</p><p>Caching is also less effective when data changes very frequently. If cached values need constant updates, the benefit of caching becomes minimal. In general, caching works best for data that is requested repeatedly but updated occasionally, and should be avoided for data that is dynamic, sensitive, or time-critical.</p><h4><strong>My Implementation of Redis with Spring Boot and PostgreSQL (Local Setup)</strong></h4><p>To use Redis as a caching layer during development, Redis was installed locally using the Ubuntu terminal available through Windows Subsystem for Linux (WSL<strong>)</strong>. This allowed Redis to run in a Linux environment while working on a Windows system.</p><pre>sudo apt-get install redis-server</pre><p>After installation, the Redis server can be started using:</p><pre>redis-server</pre><p>To verify that Redis is running correctly, the Redis CLI tool can be used:</p><pre>redis-cli ping</pre><p>If Redis is working properly, it returns:</p><pre>PONG</pre><p>This confirms that the Redis service is active and ready to be connected with the Spring Boot application for caching operations.</p><p><strong>Redis Cache Workflow in Backend Architecture</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*iyFRoDb_qgP6GD2Vno7doQ.png" /></figure><p>While working with Spring Boot and PostgreSQL locally, Redis was introduced as a caching layer to avoid repeated database access for frequently requested data such as user details and listing APIs. Instead of allowing every request to directly query PostgreSQL, the application first checks Redis to see whether the response already exists.</p><p>The workflow followed during implementation was simple and practical. When a request arrives, the service first looks for the data inside Redis. If the data is available, it is returned immediately without calling the database. If the data is not present, the application fetches it from PostgreSQL, stores the result in Redis with an expiration time, and then returns the response. This reduces repeated database queries and improves response speed during subsequent requests.</p><p>Spring Boot’s caching annotations such as <strong>@Cacheable, @CachePut, and @CacheEvict</strong> made the integration straightforward. They helped automatically manage cache storage, updates, and removal whenever database records changed. Running Redis locally alongside PostgreSQL also made it easier to observe cache hits and misses during testing, which clearly demonstrated how caching reduces unnecessary database interactions and improves backend performance.</p><blockquote><strong>Spring Boot-Caching with Redis: </strong><a href="https://github.com/hamsa-09/Spring-Boot-Caching-with-Redis"><strong>https://github.com/hamsa-09/Spring-Boot-Caching-with-Redis</strong></a></blockquote><h4>Why Redis Was Used for Caching</h4><p>While setting up caching in the Spring Boot application, Redis was chosen because it stores data in memory and returns responses much faster than querying PostgreSQL repeatedly. This helped reduce database calls when the same API was requested multiple times.</p><p>Redis also works well when applications scale, since cached data can be shared across multiple service instances. Features like TTL made cache handling easier because old data could expire automatically without manual cleanup. Support for different data structures and optional persistence also made Redis flexible for backend caching needs.</p><h4>Using Spring Cache Abstraction with Redis</h4><p>Spring Boot made Redis integration simpler by providing a caching abstraction layer. Instead of writing manual caching logic, annotations could be used directly at the service level to control cache behaviour. This helped keep business logic clean while Redis handled caching internally.</p><h4>Annotations Used During Implementation</h4><p><strong>@EnableCaching</strong> was used to activate caching support in the application.</p><p><strong>@Cacheable</strong> helped check Redis before calling the database and returned cached data if available.</p><p><strong>@CachePut</strong> ensured updated records were also updated inside Redis.</p><p><strong>@CacheEvict</strong> removed cached entries when records were deleted to avoid stale data.</p><h4>How Caching Worked in the Application</h4><p>During API requests, the service first checked Redis for existing data before querying PostgreSQL. If the requested data was already available in Redis, the response was returned immediately without accessing the database. If the data was not present in Redis, the application fetched it from PostgreSQL, stored it in Redis, and then returned the response.</p><p>This behaviour became clearly visible while testing repeated API requests locally. The first request resulted in a database fetch because the cache was empty, which took more time. When the same request was executed again, the response was served directly from Redis and the response time was significantly reduced.</p><p>The impact of Redis caching on response time can be observed by comparing repeated API requests shown in the screenshots below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eOUcICmMXXkH3qD8pTH9FA.png" /><figcaption>First request represents a <strong>cache miss</strong> (data fetched from PostgreSQL) where the response time is 1125 ms</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FLV4BoEwuTJCBpP_gGV5qA.png" /><figcaption>Second request represents a <strong>cache hit</strong> (data fetched from Redis)where the response time reduced to approximately 13 ms</figcaption></figure><h4>Challenges Faced During the Redis Setup (Spring Boot + PostgreSQL Local Environment)</h4><p>While setting up Redis caching with Spring Boot and PostgreSQL locally, one of the main challenges was ensuring proper configuration between the application and the Redis server. Since Redis runs as a separate service, the connection settings such as host, port, and cache configuration needed to be correctly aligned before caching started working as expected.</p><p>Another challenge was verifying whether data was actually being served from Redis or still coming from the database. This required testing repeated API requests and observing cache behaviour carefully to confirm cache hits and misses.</p><p>Managing cache updates after database changes was also important. Without proper cache eviction or update strategies, outdated data could remain in Redis. Using annotations like @CachePut and @CacheEvict helped keep cached data synchronized with PostgreSQL during update and delete operations.</p><h4>Other Ways Redis Caching Can Be Used Beyond Local Setup</h4><p>While Redis is often first explored in a local development environment, it is commonly deployed in several other ways depending on application scale and deployment architecture.</p><p>One common approach is running Redis using <strong>Docker containers</strong>. Instead of installing Redis directly on the system, Docker allows Redis to run as a lightweight service alongside the backend application. This makes the setup easier to manage across different environments and keeps development and production configurations consistent.</p><p>Another widely used option is <strong>managed Redis cloud services</strong>. Platforms such as AWS ElastiCache, Azure Cache for Redis, or Redis Cloud provide Redis as a hosted service. In this setup, the application connects to a remote Redis instance using a connection URL, and infrastructure tasks like scaling, monitoring, and backups are handled automatically. This approach is preferred for production environments because it improves reliability and reduces maintenance effort.</p><p>Redis can also be configured as a <strong>distributed cache shared across multiple backend servers</strong>. Instead of each server maintaining its own cache, all instances communicate with a centralized Redis service. This ensures consistent cached data across load-balanced systems and supports horizontal scaling as traffic increases.</p><p>In larger architectures, Redis is sometimes deployed in <strong>cluster mode</strong>, where multiple Redis nodes work together to handle higher traffic and larger datasets. This setup improves performance, availability, and fault tolerance for enterprise-level applications</p><h4><strong>Comparison Between In-Memory Cache And Redis Cache</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*-zJymEEiUu90-av6FVbrbQ.png" /></figure><h4><strong>Conclusion</strong></h4><p>Caching plays an important role in improving the performance and efficiency of modern backend systems. As applications begin handling repeated requests for the same data, introducing a caching layer helps reduce unnecessary database access and improves response time without increasing system complexity.</p><p>Exploring different caching approaches such as in-memory caching, Redis caching, browser caching, database query caching, and distributed caching helps in understanding where each strategy fits within application architecture. Among these, Redis stands out as a practical solution for scalable environments because it allows multiple application instances to share cached data while maintaining fast access speeds.</p><p>Implementing Redis locally with Spring Boot and PostgreSQL also helped demonstrate how caching works in a real request flow, especially in identifying cache hits and reducing repeated database queries. Understanding when caching should be applied and when it should be avoided is equally important for maintaining both performance and data reliability.</p><p>Overall, caching is not just an optimization step added later in development, but a design consideration that supports building responsive and scalable applications.</p><h4><strong>References</strong></h4><p><a href="https://www.geeksforgeeks.org/advance-java/spring-boot-caching-with-redis/">https://www.geeksforgeeks.org/advance-java/spring-boot-caching-with-redis/</a></p><p><a href="https://sasuniwijerathne.medium.com/redis-caching-in-spring-boot-190c22a3cd33">https://sasuniwijerathne.medium.com/redis-caching-in-spring-boot-190c22a3cd33</a></p><p><a href="https://medium.com/javarevisited/how-to-integrate-redis-cache-in-spring-boot-cf34e66908ad">https://medium.com/javarevisited/how-to-integrate-redis-cache-in-spring-boot-cf34e66908ad</a></p><p><a href="https://medium.com/@tharindudulshanfdo/optimizing-spring-boot-applications-with-redis-caching-35eabadae012">https://medium.com/@tharindudulshanfdo/optimizing-spring-boot-applications-with-redis-caching-35eabadae012</a></p><p><a href="https://medium.com/the-modern-scientist/caching-a-dive-into-in-memory-and-redis-caches-7b9491a1fa1b">https://medium.com/the-modern-scientist/caching-a-dive-into-in-memory-and-redis-caches-7b9491a1fa1b</a></p><p><a href="https://medium.com/@elijahechekwu/redis-caching-for-backend-developers-eb1cbe835665">https://medium.com/@elijahechekwu/redis-caching-for-backend-developers-eb1cbe835665</a></p><p><a href="https://en.wikipedia.org/wiki/Redis">https://en.wikipedia.org/wiki/Redis</a></p><p><a href="https://www.geeksforgeeks.org/system-design/caching-system-design-concept-for-beginners/">https://www.geeksforgeeks.org/system-design/caching-system-design-concept-for-beginners/</a></p><p><a href="https://medium.com/@mmoshikoo/cache-strategies-996e91c80303">https://medium.com/@mmoshikoo/cache-strategies-996e91c80303</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0df8ca463151" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Journey into Microsoft Azure: Understanding Cloud Concepts and Core Services]]></title>
            <link>https://medium.com/@hamsavardhinibaskar/my-journey-into-microsoft-azure-understanding-cloud-concepts-and-core-services-7e1ccc9ca9b9?source=rss-5698f59cd9c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e1ccc9ca9b9</guid>
            <dc:creator><![CDATA[Hamsavardhinibaskar]]></dc:creator>
            <pubDate>Mon, 23 Mar 2026 15:13:38 GMT</pubDate>
            <atom:updated>2026-03-23T15:13:38.122Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dwt6Aei0Qh7UczeOHuVOAg.png" /></figure><p>When I first started exploring cloud computing, Microsoft Azure felt a bit overwhelming. There were so many services, tools, and terms that I didn’t fully understand. But once I started breaking things down and actually trying them out, things began to make sense.</p><p>In this blog, I want to share what I’ve learned about Azure and how I understand the differences between some of its key service</p><h3>Let’s First Know What is Cloud Computing?</h3><p>In basic terms, cloud computing means using the internet to access computing resources like servers, storage, databases, and software instead of using your own local machine.</p><p>Instead of buying and maintaining physical hardware, you can just “rent” what you need from a cloud provider like Microsoft Azure, AWS, or Google Cloud.</p><p>For example, earlier if you wanted to run an application, you would need:</p><ul><li>A physical server</li><li>Storage devices</li><li>Networking setup</li></ul><p>Now, with cloud computing, all of this is available online. You can create a virtual server in minutes and start using it right away.</p><p>What I found interesting is that cloud computing is:</p><ul><li>Flexible — you can scale resources up or down anytime</li><li>Cost-effective — you pay only for what you use</li><li>Accessible — you can access it from anywhere with internet</li></ul><p>In simple terms , cloud computing is basically a way of using computing resources without actually owning them.</p><h3>Types of Cloud Deployment Models</h3><p>Cloud computing services can be deployed in different ways depending on how infrastructure is managed and accessed. The three main cloud deployment models are <strong>Public Cloud</strong>, <strong>Private Cloud</strong>, and <strong>Hybrid Cloud</strong>. Understanding these models helps in selecting the right environment based on application requirements and security needs.</p><h3>Public Cloud</h3><p>In the public cloud model, computing resources such as servers, storage, and networking are provided over the internet by third-party cloud providers like Microsoft Azure. These resources are shared among multiple users but remain secure and isolated.</p><p>Public cloud is widely used because it reduces the need for maintaining physical infrastructure and allows organizations to scale resources easily. It is suitable for web applications, testing environments, and general-purpose workloads where flexibility and cost efficiency are important. Microsoft Azure itself is an example of a public cloud platform.</p><h3>Private Cloud</h3><p>In the private cloud model, infrastructure is dedicated to a single organization. The resources are not shared with other users and are usually maintained either inside the organization’s data center or through a private hosting provider.</p><p>Private cloud is useful when applications require higher security, compliance control, or customization. It is commonly used in sectors such as banking, healthcare, and government environments where sensitive data must be handled carefully.</p><h3>Hybrid Cloud</h3><p>Hybrid cloud is a combination of both public cloud and private cloud environments. It allows organizations to keep sensitive data in a private cloud while using the public cloud for other workloads that require scalability and flexibility.</p><p>This approach provides the benefits of both environments. It improves security while still allowing access to cloud scalability and cost advantages. Microsoft Azure supports hybrid cloud solutions through integration with on-premise infrastructure.</p><h3>Introduction to Microsoft Azure</h3><p>After I understood what cloud computing is, the next thing I explored was Microsoft Azure.</p><p>Azure is basically Microsoft’s cloud platform. It provides a wide range of services that help us build, deploy, and manage applications through Microsoft’s global data centers.</p><p>When I first opened Azure, it felt like there were too many services. But over time, I realized that each service has a specific purpose. Azure is not just one tool, it’s a complete ecosystem.</p><p>Azure is a platform where we can create virtual machines,store data,build web apps and APIs, run databases, use AI and analytics tools.All of this without setting up physical hardware.</p><h3>Why Do We Need Azure?</h3><p>Before cloud platforms like Azure, companies had to maintain their own servers. That means buying expensive hardware, managing infrastructure, handling maintenance and downtime. This is where Azure becomes useful.</p><p>From what I learned, Azure helps by removing all that complexity. Instead of worrying about infrastructure, we can focus more on building applications.</p><p>For example, if we want to deploy a web app, we don’t need to set up a server manually. Azure provides services that handle it for us.</p><p>So, the main reason we need Azure is to make development faster, easier, and more scalable.</p><h3>Cloud Service Models in Azure</h3><p>While learning Azure, one of the important concepts I came across was the three main service models it provides. These service models explain how much control we have as users and how much Azure manages for us. The three categories are <strong>Infrastructure as a Service (IaaS)</strong>, <strong>Platform as a Service (PaaS)</strong>, and <strong>Software as a Service (SaaS)</strong>. Understanding these helped me clearly see how cloud services are structured and when to use each one.</p><p><strong>Infrastructure as a Service (IaaS)</strong> is the most basic level of cloud service provided by Azure. In this model, Azure gives us access to infrastructure components like virtual machines, storage, and networking resources. However, the responsibility of installing the operating system, configuring software, and deploying applications still remains with us. When I explored virtual machines in Azure, it felt similar to working on a remote computer where I had full control over the environment. Azure supports different operating systems using its virtualization technology, which makes it flexible for different development needs.</p><p><strong>Platform as a Service (PaaS)</strong> makes development easier because Azure manages the infrastructure and runtime environment for us. In this model, we can directly focus on building and deploying applications without worrying about managing servers or system updates. Services like Azure App Service, Azure Functions, and Logic Apps come under this category. These services also provide useful features like autoscaling and load balancing, which help applications run smoothly even when user traffic increases. Personally, I found PaaS very convenient because it reduces the effort required for setup and maintenance.</p><p><strong>Software as a Service (SaaS)</strong> is the most user-friendly service model provided by Azure. In this category, the entire application is managed by Microsoft, including deployment, maintenance, scaling, and security. Users can simply access the application through the internet without worrying about infrastructure or configuration. Examples include Office 365, Dynamics 365, and Azure Active Directory. From my understanding, SaaS is best when we just want to use software without handling any technical setup in the background.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*CsOHechasfyJfUdba5Wv2Q.png" /></figure><h3><strong>Difference Between Azure Service Models</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*eJLzwLT6SRt1mSOwyuEIwA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*DxwaK5Oi4I7e1bEfmebAhw.png" /></figure><h3>Core Azure Services I Explored and What They Do</h3><p>While learning Microsoft Azure, I noticed that some services appear again and again when people start building applications in the cloud. The ones that helped me understand Azure better were <strong>Virtual Machines, App Service, Azure Functions, Storage, and Networking</strong>. Each of these services has a different role.</p><h4><strong>Azure Virtual Machine (VM)</strong></h4><p>One of the services I explored in Azure was the <strong>Virtual Machine</strong>. An Azure Virtual Machine is basically a computer that runs in the cloud instead of on my local system. It allows me to install an operating system like Windows or Linux and configure software just like I would on a physical machine. I understood that Azure handles the hardware part, but I am responsible for managing the operating system and applications. This service comes under the <strong>Infrastructure as a Service (IaaS)</strong> model and is useful when I need full control over the environment for testing, development, or hosting applications.</p><h4>Azure App Service (Web App Service)</h4><p>Azure <strong>App Service</strong> is something I found very helpful because it simplifies application deployment. It allows me to build and host web applications without worrying about managing servers or infrastructure. I just upload my code and Azure takes care of deployment, scaling, and maintenance after configuration in azure. This service supports multiple programming languages like .NET, Java, Python, Node.js, and PHP. Since Azure manages the platform setup automatically, App Service comes under the <strong>Platform as a Service (PaaS)</strong> category and is ideal when the main goal is to focus only on application development.</p><h4><strong>Azure Functions</strong></h4><p>While learning Azure, I also explored <strong>Azure Functions</strong>, which introduced me to the idea of serverless computing. Azure Functions allow me to run small pieces of code only when a specific event happens, such as receiving a request or uploading a file. The interesting part is that I don’t need to manage servers at all because Azure handles everything in the background. This makes applications more efficient and cost-effective since the code runs only when needed. Azure Functions also fall under the <strong>PaaS model</strong> and are useful for automation tasks and event-based workflows.</p><h4>Azure Storage</h4><p>Azure <strong>Storage</strong> is another important service because every application needs a place to store data. Azure provides different types of storage options like Blob Storage for files and images, Disk Storage for virtual machines, and File Storage for shared access between systems. What I found useful is that Azure Storage is secure, scalable, and accessible from anywhere through the internet. It helps manage structured and unstructured data efficiently depending on the application requirement.</p><h4>Azure Database Services</h4><p>Another important part of Microsoft Azure is its support for database services. Modern applications always need a reliable way to store and manage data, and Azure provides multiple database options depending on application requirements. These database services are fully managed by Azure, which reduces the effort required for installation, maintenance, and scaling.</p><p>Azure provides both <strong>relational databases</strong> and <strong>non-relational databases</strong>, which makes it suitable for different types of applications.</p><p>Relational databases in Azure include services like <strong>Azure SQL Database</strong>, which is useful when applications require structured data stored in tables with relationships between them. It works similarly to traditional SQL Server but without the need to manage hardware or updates manually. Because Azure handles backups, scaling, and security, database management becomes much easier compared to on-premise systems.</p><p>For applications that handle large volumes of flexible or unstructured data, Azure also provides <strong>NoSQL database services</strong> such as <strong>Azure Cosmos DB</strong>. This type of database is useful for modern applications like mobile apps, real-time analytics systems, and globally distributed applications where fast performance is required across multiple regions.</p><p>Azure also supports managed database versions of popular open-source systems such as <strong>MySQL </strong>and <strong>PostgreSQL</strong>. These services allow applications to use familiar database technologies while still benefiting from Azure’s cloud infrastructure and automation features.</p><p>Because of these options, Azure database services help support different application needs, whether the requirement is structured enterprise data storage or high-speed distributed application data handling.</p><h4>Azure Networking</h4><p>Azure Networking helps connect resources inside Azure and also connect them with external systems. For example, services like Virtual Network (VNet), Load Balancer, and VPN Gateway make communication between applications secure and reliable. When I first learned about networking in Azure, I understood that it works similar to traditional networking but happens inside the cloud environment. It plays an important role in controlling traffic flow and improving application performance and security.</p><h4>Containerization in Azure</h4><p>While learning Azure, I also came across the concept of <strong>containerization</strong>, which helped me understand how modern applications are deployed more efficiently. Containerization is a method of packaging an application along with all its dependencies, libraries, and configuration files into a single unit called a container. This makes the application run the same way in different environments, whether it is a developer’s system, testing environment, or cloud platform.</p><p>Compared to virtual machines, containers are lightweight and start faster because they don’t require a full operating system. Instead, they share the host system’s resources. Tools like Docker are commonly used to create and manage containers. From what I understood, containerization improves portability, consistency, and deployment speed, especially when working with cloud-native applications.</p><h4>Azure Kubernetes Service (AKS)</h4><p>Next is about <strong>Azure Kubernetes Service (AKS)</strong>. AKS is a service provided by Azure that helps manage and organize containers automatically using Kubernetes. Instead of manually handling multiple containers, AKS allows us to deploy, scale, monitor, and maintain containerized applications easily.</p><p>One thing I found interesting is that AKS supports running applications using a microservices architecture, where different parts of an application run in separate containers but still work together. Azure manages important tasks like scaling, load balancing, and cluster health monitoring, which reduces manual effort. From my understanding, AKS is very useful when applications become large and need better container orchestration and management in a cloud environment.</p><h3>Understanding the Differences Between Azure Deployment Services and When to Use Each One</h3><p>While learning Azure, one area that confused me at first was choosing which deployment service to use. Azure provides multiple options like Virtual Machines, App Service (Web Apps), Azure Functions, and Azure Kubernetes Service (AKS). Initially they all seemed similar because they can run applications, but later I understood that each one is designed for a different purpose.</p><h4>Azure Virtual Machine (VM)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*NgUc4hykFPO316zpDlae1Q.png" /></figure><p>Azure Virtual Machine is the service I think of when I need maximum control over the environment. It works like a real computer running inside Azure. I can choose the operating system, install software manually, configure settings, and manage everything myself.</p><p>This makes Virtual Machines very useful when the application requires custom setup or depends on specific system configurations. For example, if I am running legacy software, testing operating systems, or hosting applications that need full administrative access, using a VM makes sense.</p><p>However, I also realized that Virtual Machines require more maintenance. I have to handle updates, security patches, and scaling manually. Because of this, I would avoid using a Virtual Machine if my goal is simply to deploy a web application quickly. In those cases, managing infrastructure becomes unnecessary extra work.</p><p>So from my understanding, Virtual Machines are best when I need flexibility and full control, but not ideal when I want simplicity and faster deployment.</p><h4>Azure App Service (Web App Service)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*rbCYmbgS4at9LcF_8Z3B8g.png" /></figure><p>Azure App Service is the service I would choose when I want to deploy a web application or API quickly without managing servers. In this service, Azure automatically handles infrastructure, scaling, and maintenance, which allows me to focus only on writing and deploying code.</p><p>For example, if I develop a website using Node.js, .NET, or Python, App Service makes deployment simple because the environment is already prepared. I don’t need to install the operating system or configure networking manually.</p><p>At the same time, App Service does not give full control over the system like Virtual Machines do. If my application requires special OS-level configurations or custom background services, then App Service may not be the right choice.</p><p>So I see App Service as the best option when I want fast deployment with minimal infrastructure management, especially for web apps and APIs.</p><h4>Azure Functions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*xVFSSBXY7BxFJnoIEZ4dbA.png" /></figure><p>Azure Functions introduced me to the concept of serverless computing, which works differently from traditional deployment methods. Instead of running a full application continuously, Azure Functions allow small pieces of code to run only when triggered by an event.</p><p>For example, a function can run automatically when a file is uploaded, when a timer triggers it, or when an HTTP request is received. This makes applications more efficient because resources are used only when needed.</p><p>However, Azure Functions are not suitable for large applications that must run continuously. They are designed mainly for background tasks, automation, and event-based workflows. If I try to use Functions for a full-scale web application, it becomes difficult to manage.</p><p>So I understood that Azure Functions are best when I want lightweight, event-driven execution without managing infrastructure, but not ideal for hosting complete applications.</p><h4>Azure Kubernetes Service (AKS)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*XylvRlJvtZIawrO0gyG6-w.png" /></figure><p>Azure Kubernetes Service (AKS) is the service I explored after learning about containers. AKS helps manage multiple containers efficiently using Kubernetes orchestration. It is especially useful when applications are built using microservices architecture, where different components run in separate containers but still work together.</p><p>AKS automatically handles scaling, monitoring, and managing container clusters, which makes it powerful for large and complex applications. This makes it suitable for enterprise-level systems or applications that need high availability and flexibility.</p><p>At the same time, AKS is more complex compared to Virtual Machines or App Service. If I only want to deploy a simple website or small application, using AKS would add unnecessary complexity.</p><p>So from my learning experience, AKS is the right choice when working with large container-based applications that need orchestration, but not the best option for beginners or small deployments.</p><h4>Summary of Deployment Service</h4><p>After exploring these deployment services, I now think of them like this:</p><blockquote>If I need full control over the system environment, I would choose <strong>Virtual Machines</strong>.<br>If I want to deploy a web app quickly and easily, I would choose <strong>App Service</strong>.<br>If I want event-based execution without running servers continuously, I would use <strong>Azure Functions</strong>.<br>If I am working with containerized microservices at scale, I would use <strong>AKS</strong>.</blockquote><p>Understanding this difference helped me decide not just <em>how</em> to deploy applications in Azure, but <em>why</em> a particular service is better suited for a specific situation.</p><h3>Azure Regions and Availability Zones</h3><p>Microsoft Azure provides services through multiple data centers located across different parts of the world. These locations are called <strong>regions</strong>. Each region contains one or more physical data centers that help run applications closer to users for better performance and reliability.</p><p>Within each region, Azure also provides <strong>Availability Zones</strong>, which are separate physical locations with independent power, cooling, and networking. Availability Zones help protect applications from failures because resources can continue running even if one zone becomes unavailable.</p><p>Using regions and availability zones improves application availability, performance, and disaster recovery support. Because of this, they play an important role when designing reliable cloud-based systems.</p><h3>Azure Resource Groups</h3><p>Azure Resource Groups help organize cloud resources in a structured way. A resource group acts like a container that holds related services such as virtual machines, storage accounts, and databases.</p><p>Resource groups make it easier to manage, monitor, and control multiple services together. For example, resources that belong to the same project can be placed inside one resource group so they can be updated or deleted as a group when needed.</p><p>This helps simplify resource management and improves project organization inside Azure.</p><h3>Advantages of Microsoft Azure</h3><p>Microsoft Azure has become one of the most widely used cloud platforms because it provides flexibility, reliability, and strong integration with modern development tools. It supports organizations as well as individual learners who want to build, deploy, and manage applications in the cloud efficiently.</p><p>One of the biggest advantages of Azure is <strong>scalability</strong>. Resources such as virtual machines, storage, and applications can be increased or reduced depending on workload requirements. This helps applications handle changing traffic without affecting performance.</p><p>Another important benefit is the <strong>pay-as-you-go pricing model</strong>. Instead of investing in expensive hardware infrastructure, users only pay for the resources they actually use. This makes cloud adoption more affordable and practical for both small projects and large enterprise systems.</p><p>Azure also provides <strong>global availability through multiple data centers across regions</strong>. Applications can be deployed closer to users, which improves speed, performance, and reliability. This global presence makes Azure suitable for building highly available and distributed applications.</p><p>Security is another strong advantage of Azure. Microsoft provides built-in security features such as identity management, network protection, encryption support, and compliance with international standards. These features help protect applications and data without requiring complex manual configuration.</p><p>Azure also integrates well with <strong>Microsoft development tools and environments</strong> such as Windows Server, Active Directory, and .NET technologies. This makes it especially useful in environments where Microsoft technologies are already being used.</p><p>Another useful advantage is support for <strong>multiple programming languages and frameworks</strong> including Python, Java, Node.js, and .NET. This flexibility allows developers to choose tools based on project requirements instead of platform limitations.</p><p>Because of these features, Azure is widely used for building web applications, hosting enterprise systems, managing storage solutions, running analytics workloads, and deploying modern cloud-native applications.</p><h3>Other Cloud Platforms Similar to Microsoft Azure</h3><p>Microsoft Azure is one of the major cloud computing platforms available today, but it is not the only option. Several other cloud providers also offer similar services for building, deploying, and managing applications in the cloud.</p><p>One of the most widely used platforms is Amazon Web Services (AWS). It provides a large number of cloud services including computing power, storage solutions, networking features, and database support. AWS is known for its wide service availability and strong industry adoption.</p><p>Another popular platform is Google Cloud Platform (GCP). It is especially strong in areas like data analytics, machine learning, and container-based application deployment. Many modern applications use GCP because of its performance and integration with Google technologies.</p><p>There is also IBM Cloud, which is commonly used in enterprise environments and supports hybrid cloud solutions that combine on-premise infrastructure with cloud services.</p><h3>Conclusion</h3><p>Microsoft Azure provides a wide range of cloud services that support application development, deployment, storage management, networking, and database solutions. Understanding the differences between service models such as IaaS, PaaS, and SaaS makes it easier to choose the right approach for different scenarios.</p><p>Exploring services like Virtual Machines, App Service, Azure Functions, Storage, Networking, and Kubernetes helped build a clearer understanding of how cloud platforms support modern application development. Azure also provides flexibility, scalability, and security, which makes it suitable for both learning and real-world projects.</p><p>Learning Azure step by step makes cloud concepts easier to understand and creates a strong foundation for working with modern cloud technologies.</p><h3><strong>References</strong></h3><p><a href="https://medium.com/@arunabh223/introduction-to-microsoft-azure-8d4f1370392e">https://medium.com/@arunabh223/introduction-to-microsoft-azure-8d4f1370392e</a></p><p><a href="https://medium.com/edureka/azure-tutorial-5a97e30ee9a7">https://medium.com/edureka/azure-tutorial-5a97e30ee9a7</a></p><p><a href="https://medium.com/chenjd-xyz/azure-fundamental-iaas-paas-saas-973e0c406de7">https://medium.com/chenjd-xyz/azure-fundamental-iaas-paas-saas-973e0c406de7</a></p><p><a href="https://medium.com/azure-hub/azure-service-concepts-differences-4cc670ec0020">https://medium.com/azure-hub/azure-service-concepts-differences-4cc670ec0020</a></p><p><a href="https://medium.com/@Kaneshwari.Patil/what-are-the-benefits-and-features-of-azure-cloud-computing-896d1714b87e">https://medium.com/@Kaneshwari.Patil/what-are-the-benefits-and-features-of-azure-cloud-computing-896d1714b87e</a></p><p><a href="https://medium.com/@isaacdcloudprof/introduction-to-azure-app-service-91ea00366c51">https://medium.com/@isaacdcloudprof/introduction-to-azure-app-service-91ea00366c51</a></p><p><a href="https://youtu.be/L5N9S8pKpOw?si=MbrvEuIZCErtjzJ0">https://youtu.be/L5N9S8pKpOw?si=MbrvEuIZCErtjzJ0</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e1ccc9ca9b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker vs Podman: Which Container Tool Should You Use?]]></title>
            <link>https://medium.com/@hamsavardhinibaskar/docker-vs-podman-which-container-tool-should-you-use-38b21aca9faf?source=rss-5698f59cd9c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/38b21aca9faf</guid>
            <dc:creator><![CDATA[Hamsavardhinibaskar]]></dc:creator>
            <pubDate>Fri, 13 Mar 2026 04:18:36 GMT</pubDate>
            <atom:updated>2026-03-13T04:20:03.835Z</atom:updated>
            <content:encoded><![CDATA[<p>When I started learning backend development, I kept hearing about Docker everywhere. Later, I discovered another tool called Podman in my internship project, which claims to be a Docker alternative.</p><p>At first, I wondered:</p><ul><li>Are Docker and Podman the same?</li><li>Why do some companies prefer Podman?</li><li>Which one should I actually learn?</li></ul><p>So I spent some time exploring both tools. In this blog, I’ll share what I learned, the differences between them, and when to use each.</p><h3>We Can Understand Containers First</h3><p>A container is a lightweight, standalone, and executable software package that bundles an application and all its dependencies code, runtime, system tools, libraries, and settings to ensure it runs consistently and reliably across different computing environments.</p><p>Lets take a container as a small portable box that contains everything needed to run an application.</p><p>Inside that box you pack:</p><ul><li>The application code</li><li>The runtime (like Node.js, Python, Java)</li><li>Required libraries</li><li>Required system tools</li><li>Configuration files</li></ul><p>You can see now, everything is packed together, the application will run the same way on any machine.</p><h3>Docker</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/1*Xog9AmgmzZmIChm51L6sGA.png" /></figure><h3>Now What Is Docker?</h3><p>I would say, docker is a platform that helps developers package an application along with everything it needs to run into a container. Instead of installing dependencies manually on every machine, Docker allows us to bundle the application, its runtime, libraries, and configuration together so it behaves the same wherever it runs.</p><p>As we know , we would say :</p><p><em>“My application works on my device but not on the other device.”</em></p><p>Docker solves this problem by ensuring that the same environment used during development can also be used in testing and production. It provides a way to build, ship, and run applications inside containers.</p><h3>Why Do We Need Docker?</h3><p>Actually, docker is mainly used to solve the environment consistency problem in software development. Many times an application works perfectly on a developer’s machine but fails when deployed to another system because the dependencies, configurations, or runtime versions are different.</p><p>Docker helps by packaging the application along with all its dependencies into a container, so the application runs the same way on any machine — whether it is a developer’s laptop, a testing environment, or a production server.</p><p>Docker makes applications portable, consistent, scalable, efficient ,isolated and easier to deploy across different environments.</p><h3>Let’s Talk About Docker Architecture</h3><p>When we come to talk about architecture, docker follows a client-server architecture. The Docker client communicates with the Docker daemon, which performs the main tasks such as building images, running containers, and managing Docker resources. The client and daemon can run on the same machine, or the client can connect to a Docker daemon running on a remote system.</p><p>This allows developers to interact with Docker easily through commands, while the daemon handles the complex operations in the background.</p><h3>Key Components of Docker Architecture</h3><p><strong>Docker daemon: </strong>The Docker daemon (dockerd) is the background service running on the host machine. It listens for Docker API requests and manages Docker objects such as images, containers, networks, and volumes. The daemon is responsible for building images, starting containers, and handling container lifecycle operations.</p><p><strong>Docker client:</strong> The Docker client is the command-line interface used by developers to interact with Docker. When a user runs commands like docker run, docker build, or docker pull, the client sends these requests to the Docker daemon, which then executes them.</p><p><strong>Docker registries:</strong> Docker registries are repositories where Docker images are stored and distributed. Developers can push images to a registry and pull them when needed. A common example is Docker Hub, a public registry that provides many pre-built images for common software and tools.</p><p><strong>Docker objects:</strong> Docker works with several types of objects that help manage applications in containers. These include images, containers, networks, volumes, and plugins. Images act as templates for containers, containers run the actual applications, networks manage communication between containers, and volumes provide persistent storage.</p><h3><strong>Let’s See The Pros And Cons Of Docker</strong></h3><h4>Pros</h4><p><strong>1. Consistent environment: </strong>Docker helps ensure that an application runs the same way on every system. Since the application and its dependencies are packaged together, it avoids the common <em>“it works on my machine but not on the server”</em> problem.</p><p><strong>2. Lightweight and fast:</strong> Containers share the host operating system kernel, so they start much faster and use fewer resources compared to virtual machines.</p><p><strong>3. Easy deployment:</strong> Docker makes it easier to move applications from development to testing and production because the container can run on any machine that has Docker installed.</p><p><strong>4. Better isolation:</strong> Each application runs inside its own container, which prevents dependency conflicts between different applications.</p><h4>Cons</h4><p><strong>1. Security concerns:</strong> Since containers share the host OS kernel, improper configuration can create security risks.</p><p><strong>2. Managing many containers can be complex:</strong> When applications grow and many containers are used, managing them becomes harder and usually requires orchestration tools like Kubernetes.</p><p><strong>3. Data persistence needs extra setup:</strong> Containers are temporary by nature, so storing data permanently requires additional configuration like volumes.</p><h3><strong>Podman</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/249/1*3vtFlnajxhA9Dn0LOYmY1A.png" /></figure><p>Next let me tell about :</p><h3><strong>What Is Podman ?</strong></h3><p>When I learnt about Podman I came to know , it is a container management tool used to build, run, and manage containers, similar to Docker. It allows developers to run applications inside containers so that the application and its dependencies stay packaged together and run consistently across different systems.</p><p>The main idea behind Podman is the same as other container tools: it helps developers create portable and isolated environments for applications.</p><p>One important difference is that Podman is designed with a daemonless architecture, which means it does not require a background service running all the time. Each command directly interacts with the container runtime.</p><h3>Why Do We Actually Need Podman?</h3><p>From my understanding, Podman is mainly used to run containers in a more secure and flexible way compared to traditional container tools. While tools like Docker work well, they rely on a background daemon that usually runs with root privileges. Podman was designed to solve some of these concerns.</p><p><strong>1. Better security:</strong> Podman supports rootless containers, which means containers can run without root privileges. This reduces security risks compared to tools that require root access.</p><p><strong>2. No Background Daemon:</strong> Unlike Docker, Podman does not require a central daemon running in the background. Each command runs directly and manages the container process itself. This makes the system simpler and avoids a single point of failure.</p><p><strong>3. Docker-Compatible:</strong> Podman uses commands that are very similar to Docker. So developers who already know Docker can start using Podman without learning an entirely new workflow.</p><p><strong>4. Better for Production Environments: </strong>Because of its security-focused design and daemonless architecture, Podman is often preferred in environments where security and system control are important.</p><h3>Let’s Talk About Podman Architecture</h3><p>Podman follows a <strong>daemonless architecture</strong>, which means it does not rely on a central background service to manage containers. Instead, every Podman command directly interacts with the container runtime to create and manage containers. This design makes the system simpler and avoids dependency on a single daemon process.</p><p><strong>Podman CLI:</strong> The Podman command-line interface is the tool developers use to interact with containers. Commands such as podman run, podman build, and podman pull are executed through the CLI. When a command is executed, Podman directly communicates with the container runtime.</p><p><strong>Container Runtime:</strong> Podman uses OCI-compliant runtimes (such as runc or crun) to actually start and manage containers. The runtime is responsible for creating the container process and isolating it from the host system.</p><p><strong>Containers:</strong> Containers in Podman run as <strong>regular processes on the host system</strong>. Unlike Docker, they are not managed by a central daemon. This means each container runs independently under the user who started it.</p><p><strong>Images and Registries:</strong> Podman uses container images to create containers, just like Docker. These images can be pulled from registries such as container registries or built locally using a Containerfile (similar to a Dockerfile).</p><p><strong>Pods:</strong> Podman supports a concept called <strong>pods</strong>, where multiple containers can share resources such as network and storage. This concept is similar to Kubernetes pods and allows containers to work together as a group.</p><h3>Key Characteristics of Podman</h3><ul><li><strong>Daemonless:</strong> Podman does not rely on a central daemon like Docker. When you run a command, Podman directly manages the container process.</li><li><strong>Rootless containers:</strong> Podman allows containers to run without root privileges. This improves security because applications do not need elevated permissions.</li><li><strong>Docker compatible commands:</strong> Most Podman commands are similar to Docker commands.</li></ul><p><strong><em>For example:</em></strong></p><p><em>podman run nginx</em></p><p><em>works almost the same as:</em></p><p><em>docker run nginx</em></p><p>This makes it easy for developers familiar with Docker to switch to Podman.</p><p><strong>There is also a concept called Pod :<br></strong>Pods are groups of containers that share resources like network and storage. This idea is similar to how containers are grouped in Kubernetes.</p><h3><strong>Let’s See The Pros And Cons Of Podman</strong></h3><h4>Pros</h4><p><strong>1. Better security:</strong> Podman supports rootless containers, which means containers can run without root privileges. This reduces security risks compared to tools that require root access.</p><p><strong>2. Daemonless architecture:</strong> Podman does not use a background daemon. Each command directly manages containers, which avoids a single point of failure.</p><p><strong>3. Docker-compatible commands:</strong> Most Podman commands are similar to Docker commands, so developers who know Docker can easily start using Podman.</p><p><strong>4. Pod support:</strong> Podman supports <strong>pods</strong>, where multiple containers can share resources like network and storage. This concept is similar to how containers are grouped in Kubernetes.</p><h4>Cons</h4><p><strong>1. Smaller ecosystem:</strong> Compared to Docker, Podman has a smaller community and fewer tutorials or third-party tools.</p><p><strong>2. Slightly less beginner-friendly:</strong> Some setup and configuration steps can feel more complex for beginners.</p><p><strong>3. Limited tooling support:</strong> Some tools and platforms are still more optimized for Docker, so integration may sometimes require extra configuration.</p><h3><strong>Now You May Think: How Did Podman Emerge When Docker Already Exists?</strong></h3><p>When I first learned about Podman, I had the same question. If Docker already exists and works well, why did another tool like Podman appear?</p><ol><li>When you read about Docker from above contents you would learn that Docker uses a central daemon to manage containers. Because everything depends on that daemon, if it crashes or stops working, container management can be affected. This creates a single point of failure in the system.</li><li>Another concern is security. Docker traditionally runs with root privileges, which means containers may get higher permissions on the host system. In environments where security is critical, this can be a risk.</li><li>Podman was introduced to address these issues. It uses a daemonless architecture, meaning there is no central background service controlling everything. It also supports rootless containers, allowing containers to run without root access, which improves security.</li><li>So even though Podman is very similar to Docker and uses almost the same commands, it was created to provide a more secure and flexible approach to running containers.</li></ol><p><strong>Let’s come to the main point now</strong></p><h3><strong>Difference Between Docker And Podman</strong></h3><p>Both Docker and Podman are tools used to build, run, and manage containers. They solve the same problem running applications in isolated environments but they differ in architecture, security, and ecosystem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*30310j6UkUuharvELt5CTg.jpeg" /></figure><h3>Key Differences</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*MoVFXeJz53Ge3Z071-7Aew.png" /></figure><h3>Let’s Now Talk About Which One to Use and When</h3><p>After learning about both tools, the next question is when should we use Docker and when should we use Podman? The answer usually depends on the use case and the environment we are working in.</p><h4>When to Use Docker</h4><p>Docker is usually the best choice for beginners and general development.</p><p>You can choose Docker when:</p><ul><li>You are learning containerization for the first time</li><li>You want strong community support and documentation</li><li>You are working in a team where Docker is already the standard</li><li>You need access to a large ecosystem of tools and integrations</li></ul><p>Since Docker has been around longer, CI/CD tools, and cloud platforms support Docker directly.</p><h4><strong>When to Use Podman</strong></h4><p>Podman is often preferred when security and system control are more important.</p><p>You may choose Podman when:</p><ul><li>You want to run containers without root privileges</li><li>You want to avoid a central daemon process</li><li>Your organization has strict security policies</li><li>You want native pod support similar to Kubernetes</li></ul><p>Because of these features, Podman is sometimes used more in enterprise or security-focused environments.</p><h4><strong>From my understanding</strong></h4><ul><li>Docker is easier to start with and has a very large ecosystem.</li><li>Podman focuses more on security and daemonless container management.</li></ul><h3><strong>Conclusion</strong></h3><p>Both Docker and Podman solve the same problem: running applications inside containers.</p><p>Docker focuses on simplicity and ecosystem, while Podman focuses more on security and modern container architecture.</p><p>Instead of thinking of them as competitors, it’s better to see them as different tools solving the same problem in different ways.</p><h3><strong>References</strong></h3><ul><li><a href="https://medium.com/@techsuneel99/docker-from-beginner-to-expert-a-comprehensive-tutorial-5efec10c82ab"><strong>https://medium.com/@techsuneel99/docker-from-beginner-to-expert-a-comprehensive-tutorial-5efec10c82ab</strong></a></li><li><a href="https://medium.com/@furkan.turkal/how-does-docker-actually-work-the-hard-way-a-technical-deep-diving-c5b8ea2f0422"><strong>https://medium.com/@furkan.turkal/how-does-docker-actually-work-the-hard-way-a-technical-deep-diving-c5b8ea2f0422</strong></a></li><li><a href="https://medium.com/appfoster/pros-and-cons-of-containerization-using-docker-000c36e809f8"><strong>https://medium.com/appfoster/pros-and-cons-of-containerization-using-docker-000c36e809f8</strong></a></li><li><a href="https://medium.com/@williamwarley/unleashing-podman-the-ultimate-guide-to-revolutionizing-your-container-management-3a5bdbbd5ef8"><strong>https://medium.com/@williamwarley/unleashing-podman-the-ultimate-guide-to-revolutionizing-your-container-management-3a5bdbbd5ef8</strong></a></li><li><a href="https://medium.com/@tam.tamanna18/podman-guide-for-container-management-ee1c65461ee7"><strong>https://medium.com/@tam.tamanna18/podman-guide-for-container-management-ee1c65461ee7</strong></a></li><li><a href="https://aditya-sunjava.medium.com/podman-advantages-and-disadvantages-b38e5f4ff8a2"><strong>https://aditya-sunjava.medium.com/podman-advantages-and-disadvantages-b38e5f4ff8a2</strong></a></li><li><a href="https://medium.com/@mehulg_44130/podman-and-docker-deciphering-the-pros-and-cons-of-each-4b498daa916d"><strong>https://medium.com/@mehulg_44130/podman-and-docker-deciphering-the-pros-and-cons-of-each-4b498daa916d</strong></a></li><li><a href="https://medium.com/@adarsh0011/docker-vs-podman-18aa38a36a33"><strong>https://medium.com/@adarsh0011/docker-vs-podman-18aa38a36a33</strong></a></li><li><a href="https://www.youtube.com/watch?v=YRLDaYnAZUQ"><strong>https://www.youtube.com/watch?v=YRLDaYnAZUQ</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38b21aca9faf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scaling PostgreSQL? Here’s How I Discovered PgBouncer]]></title>
            <link>https://medium.com/@hamsavardhinibaskar/scaling-postgresql-heres-how-i-discovered-pgbouncer-a27ac0d31902?source=rss-5698f59cd9c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/a27ac0d31902</guid>
            <category><![CDATA[pgbouncer]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[hikaricp]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[simple-setup]]></category>
            <dc:creator><![CDATA[Hamsavardhinibaskar]]></dc:creator>
            <pubDate>Wed, 04 Mar 2026 15:18:48 GMT</pubDate>
            <atom:updated>2026-03-04T15:18:48.102Z</atom:updated>
            <content:encoded><![CDATA[<p>While working on a backend project using PostgreSQL, everything was smooth in development. A few users, a few API calls, no issues.</p><p>But when I started testing with higher concurrent requests, things began to slow down. Some requests were hanging. A few even failed with connection errors.</p><p>That’s when I started digging deeper into how PostgreSQL actually handles connections and that’s how I discovered PgBouncer.</p><h3>How PostgreSQL Actually Handles Connections</h3><p>PostgreSQL follows a <strong>process-per-connection model</strong>.</p><p>What does that mean?</p><ul><li>If 10 clients connect → PostgreSQL creates 10 backend processes.</li><li>If 100 clients connect → 100 processes are created.</li><li>If 1000 clients connect → 1000 processes are created.</li></ul><p>Each connection consumes:</p><ul><li>Memory</li><li>CPU</li><li>System resources</li></ul><p>This architecture works well for moderate traffic, but under heavy load it becomes expensive and inefficient.</p><p>Creating and destroying database connections repeatedly is slow. It adds overhead and limits scalability.</p><p>That’s exactly the issue I was facing.</p><h3>So What Is PgBouncer?</h3><p>PgBouncer is a lightweight, open-source <strong>connection pooler</strong> for PostgreSQL.</p><p>Instead of letting applications connect directly to PostgreSQL, PgBouncer sits in between:</p><blockquote><strong>Application → Pg Bouncer → PostgreSQL</strong></blockquote><p>It maintains a <strong>small pool of persistent database connections</strong> and reuses them for incoming client requests.</p><p>So even if:</p><ul><li>1000 users connect to the application</li><li>PgBouncer may only maintain 20–50 actual database connections</li></ul><p>This dramatically reduces connection overhead.</p><h3>HikariCP vs PgBouncer</h3><p>While learning about connection pooling, I realized that HikariCP and PgBouncer operate at different layers.</p><p>HikariCP is an in-application JDBC connection pool used mainly in Java (like Spring Boot). It manages and reuses database connections within a single application instance.</p><p>PgBouncer, on the other hand, runs as a separate service between the application and PostgreSQL. It pools connections at the infrastructure level and reduces the total number of backend connections to the database.</p><p>In short:</p><ul><li>HikariCP optimizes connection handling inside the app.</li><li>PgBouncer protects and scales PostgreSQL at the system level.</li></ul><p>In high-concurrency production systems, both are often used together:</p><blockquote><strong>Application → HikariCP → PgBouncer → PostgreSQL</strong></blockquote><h3>How PgBouncer Solves the Problem</h3><p>When a client sends a request:</p><ol><li>PgBouncer accepts the connection.</li><li>It assigns an available connection from its pool.</li><li>If all connections are busy, it queues the request.</li><li>Once a connection is free, it serves the next request.</li></ol><p>Instead of PostgreSQL managing thousands of processes, PgBouncer manages the concurrency intelligently.</p><h3>Pooling Modes in PgBouncer</h3><p>One thing I found interesting is that PgBouncer supports different pooling strategies:</p><ol><li><strong>Session Pooling<br></strong>One server connection per client session.</li><li><strong>Transaction Pooling (Most Common)<br></strong>A connection is assigned only for the duration of a transaction.</li><li><strong>Statement Pooling<br></strong>Connection is assigned per statement (rarely used).</li></ol><p>For most scalable backend systems, transaction pooling is preferred.</p><h3>Advantages I Observed</h3><p>After understanding PgBouncer, the benefits became very clear:</p><h3>Better Performance</h3><p>Connections are reused instead of recreated. This saves time and system resources.</p><h3>Reduced Database Pressure</h3><p>Thousands of frontend connections can use a much smaller backend pool.</p><h3>Lightweight</h3><p>PgBouncer is written in C and adds minimal latency.</p><h3>Improved Scalability</h3><p>It allows PostgreSQL to handle high concurrency efficiently.</p><h3>Flexible Configuration</h3><p>Supports settings like:</p><ul><li>pool_size</li><li>listen_backlog</li><li>query_wait_timeout</li></ul><p>These help manage queues and traffic spikes.</p><h3>But It’s Not Perfect</h3><p>While PgBouncer is powerful, it does add complexity.</p><h3>Single Point of Failure</h3><p>If PgBouncer goes down, all database connections fail.</p><h3>No Native Failover</h3><p>It doesn’t automatically manage HA. You need tools like:</p><ul><li>HAProxy</li><li>Patroni</li></ul><h3>Extra Layer to Maintain</h3><p>It introduces another service in your infrastructure.</p><p>Still, the tradeoff is often worth it in high-traffic systems.</p><h3>My Key Takeaway</h3><p>Before this, I thought database scaling was only about:</p><ul><li>Indexing</li><li>Query optimization</li><li>Vertical scaling</li></ul><p>But connection management is just as important.</p><p>PgBouncer taught me that:</p><p>Scalability isn’t only about faster queries , it’s also about smarter connection handling.</p><p>If you’re building backend systems with PostgreSQL and expect high concurrency, learning PgBouncer is definitely worth it.</p><h3><strong>GitHub:</strong></h3><blockquote>Here’s my simple setup I tried:</blockquote><blockquote><a href="https://github.com/hamsa-09/PgBouncer">https://github.com/hamsa-09/PgBouncer</a></blockquote><h3>References</h3><ul><li><a href="https://github.com/guedim/docker-postgres-pgbouncer">https://github.com/guedim/docker-postgres-pgbouncer</a></li><li><a href="https://scalegrid.io/blog/postgresql-connection-pooling-part-2-pgbouncer/">https://scalegrid.io/blog/postgresql-connection-pooling-part-2-pgbouncer/</a></li><li><a href="https://scalegrid.io/blog/postgresql-connection-pooling-part-1-pros-and-cons/">https://scalegrid.io/blog/postgresql-connection-pooling-part-1-pros-and-cons/</a></li><li><a href="https://youtu.be/nCA8HdGjMWo?si=d_gQn3tpv1YoufjF">https://youtu.be/nCA8HdGjMWo?si=d_gQn3tpv1YoufjF</a></li><li><a href="https://youtu.be/ddKm7a7xOpk?si=PSv3oGtWm6fKeoxp">https://youtu.be/ddKm7a7xOpk?si=PSv3oGtWm6fKeoxp</a></li><li><a href="https://medium.com/@rrbadam/how-pgbouncer-and-hikaricp-work-together-lessons-from-a-real-world-spike-48d25f50cbe1">https://medium.com/@rrbadam/how-pgbouncer-and-hikaricp-work-together-lessons-from-a-real-world-spike-48d25f50cbe1</a></li><li><a href="https://hashcoder.medium.com/the-developers-guide-to-taming-postgresql-how-we-tripled-throughput-with-pgbouncer-8409854dd4af">https://hashcoder.medium.com/the-developers-guide-to-taming-postgresql-how-we-tripled-throughput-with-pgbouncer-8409854dd4af</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a27ac0d31902" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>