<?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 Vijaykumar Ponnusamy on Medium]]></title>
        <description><![CDATA[Stories by Vijaykumar Ponnusamy on Medium]]></description>
        <link>https://medium.com/@vijayponnusamy?source=rss-37203f980a5c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*b72jnM7vhBQb7n5W.jpg</url>
            <title>Stories by Vijaykumar Ponnusamy on Medium</title>
            <link>https://medium.com/@vijayponnusamy?source=rss-37203f980a5c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 08:19:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vijayponnusamy/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[Redis Overview]]></title>
            <link>https://medium.com/@vijayponnusamy/redis-overview-9763ce0e97ae?source=rss-37203f980a5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9763ce0e97ae</guid>
            <category><![CDATA[cache]]></category>
            <category><![CDATA[redis]]></category>
            <dc:creator><![CDATA[Vijaykumar Ponnusamy]]></dc:creator>
            <pubDate>Sat, 26 Jul 2025 04:24:48 GMT</pubDate>
            <atom:updated>2025-07-26T04:35:45.611Z</atom:updated>
            <content:encoded><![CDATA[<p>Redis is widely used to meet a variety of caching requirements, ranging from small-scale to large-scale use cases. This document outlines my understanding of the different Redis products and offerings.</p><h3><strong>Redis Enterprise</strong></h3><p>Redis Enterprise is the commercial version of Redis, available as a software offering that can be deployed on-premises — whether on bare-metal servers, virtual machines, or Kubernetes clusters.<br> It ensures high availability by replicating data both within and across availability zones, Regions. It also supports multi-tenancy by isolating each database instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-_at5mrtiRvFjhAwDV2Ouw.png" /><figcaption>Multi Region Deployments</figcaption></figure><h3><strong>Redis Open Source (Cluster Mode)</strong></h3><p>The open-source version of Redis is well-suited for small to moderate caching needs. It supports clustering for horizontal scaling and fault tolerance.</p><h3><strong>Redis Flex</strong></h3><p>Redis Flex uses a Solid State Drive to extend the database beyond DRAM. It allows users to cache 5 times more data for the same price, significantly reducing deployment costs by up to 80%. This is achieved by leveraging solid-state drives (SSDs) in addition to DRAM, making it more affordable compared to other memory solutions like ElastiCache, Memorystore, and even the Redis Community Edition.</p><h3><strong>Redis Modules</strong></h3><p>Redis provides a set of modules that extend its core functionality — such as full-text search, time series, JSON document storage, and more — to address specialized use cases.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9763ce0e97ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Overview of Rate Limiting Algorithms — Part 1]]></title>
            <link>https://medium.com/@vijayponnusamy/an-overview-of-rate-limiting-algorithms-part-1-a3c6861122dc?source=rss-37203f980a5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3c6861122dc</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[rate-limiting]]></category>
            <dc:creator><![CDATA[Vijaykumar Ponnusamy]]></dc:creator>
            <pubDate>Mon, 16 Sep 2024 16:31:54 GMT</pubDate>
            <atom:updated>2024-09-16T16:31:54.235Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>An Overview of Rate Limiting Algorithms — Part 1</strong></p><p>A rate limiter plays a critical role in protecting APIs from Denial of Service (DoS) attacks and preventing resource overload from unknown sources. It controls the rate at which users or services can access resources.</p><p>Different rate-limiting algorithms are available, allowing you to choose the one that best suits your needs.</p><ol><li>Fixed window algorithm</li><li>Sliding window log</li><li>Sliding window counter</li><li>Token bucket</li><li>Leaky bucket</li></ol><p><strong>Fixed window algorithm</strong></p><p>The implementation has three major configurations:</p><ul><li><strong>Window size</strong>: The size of the window, typically in milliseconds or seconds.</li><li><strong>Request counter</strong>: A counter to track incoming requests, which resets at the start of each window.</li><li><strong>Max requests allowed per window</strong>: The maximum number of requests allowed within each window.</li></ul><p>The time is divided into fixed windows, and a counter tracks the incoming requests. If the request counter is less than the maximum allowed requests for the current window, the request is allowed; otherwise, it is rejected. The request counter resets at the end of each window.</p><p>Here is the simple implementation of the Fixed window algorithm in Java.</p><pre><br>import java.util.concurrent.atomic.AtomicLong;<br><br>public class FixedWindowCounterRateLimiter {<br>    private long windowCreatedTimeInMiliSeconds ;<br>    private final long WINDOW_SIZE_IN_MILI_SEC = 1 * 1000L;<br>    private final long MAX_ALLOWED_REQUESTS_PER_WINDOW = 5L;<br>    private AtomicLong requestCounter = new AtomicLong();<br><br>    public FixedWindowCounterRateLimiter() {<br>        this.windowCreatedTimeInMiliSeconds = System.currentTimeMillis();<br>        this.requestCounter = new AtomicLong(0);<br>    }<br><br>    public synchronized boolean isAllowed(){<br><br>        Long currentTimeinMiliSec = System.currentTimeMillis();<br>        if(currentTimeinMiliSec - windowCreatedTimeInMiliSeconds &gt; WINDOW_SIZE_IN_MILI_SEC){<br>            windowCreatedTimeInMiliSeconds = currentTimeinMiliSec;<br>            requestCounter.set(0L);<br>        }<br>        requestCounter.incrementAndGet();<br>        if(requestCounter.get() &lt;= MAX_ALLOWED_REQUESTS_PER_WINDOW){<br>            return  true;<br>        }<br>        return false;<br>    }<br><br>}</pre><p><strong>Pros</strong>:</p><ul><li>Very easy to implement with no complexity involved.</li><li>It consumes very little memory, as only the request counter needs to be tracked.</li></ul><p><strong>Cons</strong>:</p><ul><li>Not highly accurate.</li><li>Allows burst traffic at the boundaries between window ends and starts.</li></ul><p><strong>Sliding window log algorithm</strong></p><p>The difference between a fixed window counter and a sliding window log is that in the fixed window, we maintain only a counter to track requests, while in the sliding window, we keep track of each individual request within the window. If the request count does not exceed the threshold, we process the request; otherwise, we discard it. Note that we need to adjust the sliding window to the appropriate position based on the current time.</p><p>Here is the simple implementation of the Sliding window log algorithm in Java.</p><pre><br>import java.util.LinkedList;<br>import java.util.Queue;<br><br>public class SlidingWindowLogRateLimiter {<br><br>    private Queue&lt;Long&gt; requestStore;<br>    private final Long SLIDING_WINDOW_SIZE_IN_MILI_SEC = 1000L;<br>    private final Long MAX_ALLOWED_REQUEST_PER_WINDOW = 5L;<br><br>    public SlidingWindowLogRateLimiter(){<br>        requestStore = new LinkedList&lt;&gt;();<br>    }<br>    public boolean isAllowed(){<br>        Long currentTimeInMiliSec = System.currentTimeMillis();<br>        while(requestStore.peek() != null &amp;&amp; currentTimeInMiliSec - requestStore.peek() &gt; SLIDING_WINDOW_SIZE_IN_MILI_SEC){<br>            requestStore.poll();<br>        }<br>        requestStore.add(currentTimeInMiliSec);<br>        if(requestStore.size() &lt;= MAX_ALLOWED_REQUEST_PER_WINDOW){<br>            return true;<br>        }<br>        return false;<br>    }<br>}</pre><p><strong>Pros</strong>:</p><ul><li>Very accurate, as every request is tracked.</li><li>Does not allow burst traffic at the boundaries between window ends and starts.</li></ul><p><strong>Cons</strong>:</p><ul><li>Consumes a lot of memory and is not scalable.</li><li>More complex compared to the fixed window counter algorithm.</li></ul><p>We will explore and discuss the remaining rate-limiting algorithms in the next chapter.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3c6861122dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Outbox design pattern in Microservice architecture]]></title>
            <link>https://medium.com/@vijayponnusamy/outbox-design-pattern-in-microservice-architecture-f66172eb6d79?source=rss-37203f980a5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f66172eb6d79</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[outbox-pattern]]></category>
            <dc:creator><![CDATA[Vijaykumar Ponnusamy]]></dc:creator>
            <pubDate>Sun, 15 Sep 2024 03:16:26 GMT</pubDate>
            <atom:updated>2024-09-15T03:16:26.418Z</atom:updated>
            <content:encoded><![CDATA[<p>When working with microservices architecture, a common use case involves ensuring consistency between databases and messaging systems. This often arises when updating a database and publishing an event, or vice versa. For instance, you might want to write data to a database and simultaneously notify other services by publishing an event.</p><p>While two-phase commit (2PC) can be used to maintain consistency across multiple systems within a single database, it’s not suitable for ensuring consistency between a database and a messaging system.</p><p>Another challenge in microservices architectures is maintaining event order when your application is distributed across multiple pods. Ensuring that events are processed in the correct sequence can be difficult, especially when dealing with distributed systems.</p><p>The outbox design pattern offers a practical solution to these challenges.</p><h3>What is the outbox design pattern?</h3><p>The outbox design pattern decouples database updates from message publication. A new table, known as the outbox table, is introduced to store events awaiting delivery to a message broker to implement this pattern. When a service needs to update its database and publish a corresponding event, it creates a local transaction to modify both the main table and the outbox table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Cn3x03fV5PlnX-Pn.png" /></figure><p><strong>CustomerService:</strong> This represents the microservice responsible for handling customer data. It interacts with both the Customer table in the Customer DB and the CustomerOutbox table.</p><p><strong>Customer DB:</strong> This is the database where the main customer data is stored. It contains the Customer table.</p><p><strong>CustomerOutbox:</strong> This is the outbox table, a dedicated table for storing messages that need to be published to a message broker. It serves as a temporary holding area for events that have been created but not yet delivered.</p><p><strong>Outbox Scheduler:</strong> This is a component responsible for periodically scanning the CustomerOutbox table and delivering pending messages to the message broker. It acts as a background task or service.</p><p><strong>Broker:</strong> This represents the message broker, such as Kafka or RabbitMQ, where the published events are sent. It receives messages from the Outbox Scheduler.</p><h3>Benefits:</h3><p><strong>Data Consistency:</strong> Ensures that database updates and message publication are atomic, preventing inconsistencies.<br><strong>Reliability:</strong> Reduces the risk of message loss due to failures in the messaging system.<br><strong>Decoupling:</strong> Separates message production from delivery, improving system resilience.<br><strong>Flexibility:</strong> Allows for different message delivery mechanisms without affecting the core business logic.</p><h3>Limitations:</h3><p><strong>Increased Complexity:</strong> Introducing an additional table and a dedicated process can make your system more complex to manage and understand.<br><strong>Potential Performance Overhead:</strong> The outbox table and message delivery process can introduce overhead, especially in high-traffic scenarios.<br><strong>Duplicate Event Delivery:</strong> Duplicate events may be delivered. Implementing an idempotent event consumer is essential.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f66172eb6d79" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>