<?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 TechTurtLes on Medium]]></title>
        <description><![CDATA[Stories by TechTurtLes on Medium]]></description>
        <link>https://medium.com/@techturtles51?source=rss-92b2928093eb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*uvyrL6Ar7zFAagny</url>
            <title>Stories by TechTurtLes on Medium</title>
            <link>https://medium.com/@techturtles51?source=rss-92b2928093eb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 17:04:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@techturtles51/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[Simple Ratelimiter without dropping requests]]></title>
            <link>https://medium.com/@techturtles51/simple-ratelimiter-without-dropping-request-184a136a5c69?source=rss-92b2928093eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/184a136a5c69</guid>
            <dc:creator><![CDATA[TechTurtLes]]></dc:creator>
            <pubDate>Thu, 02 Oct 2025 14:56:17 GMT</pubDate>
            <atom:updated>2025-10-02T19:44:55.234Z</atom:updated>
            <content:encoded><![CDATA[<p>When managing a high volume of requests, it’s often necessary to control the rate at which these requests are processed. However, in scenarios where you don’t want to drop any requests but instead phase them out evenly, a non-dropping rate limiter becomes essential.</p><p>In Java, the Guava library offers a built-in rate limiter that allows you to manage request flow without rejecting any incoming requests. This built-in solution helps you avoid the need for custom implementations, making it easier to ensure smooth and reliable request handling.</p><h3>Guava’s RateLimiter</h3><p>Google’s Guava library provides a <strong>simple and production-ready rate limiter</strong>. It uses the concept of a <strong>token bucket algorithm</strong> to smooth out the request rate.</p><pre>import com.google.common.util.concurrent.RateLimiter;<br><br>public class NonDroppingRateLimiterExample {<br>    public static void main(String[] args) {<br>        // Create a rate limiter that allows 5 permits per second<br>        RateLimiter rateLimiter = RateLimiter.create(5.0);<br><br>        for (int i = 0; i &lt; 20; i++) {<br>            // acquire() blocks until a permit is available<br>            rateLimiter.acquire();<br>            logger.info(&quot;Request &quot; + i + &quot; at &quot; + System.currentTimeMillis());<br>        }<br>    }<br>}</pre><h3>What happens here?</h3><ul><li>The RateLimiter is configured to allow <strong>5 requests per second</strong>.</li><li>Each call to acquire() <strong>blocks until a permit is available</strong>.</li><li>No requests are dropped; they’re just spread out evenly.</li></ul><h3>Alternatives to Guava RateLimiter</h3><ul><li><strong>Resilience4j</strong> (RateLimiter module) – provides more advanced policies with fallback and async support.</li><li><strong>Bucket4j</strong> — powerful Java library for both in-memory and distributed rate limiting.</li><li><strong>Custom Scheduled Executors</strong> — if you want to implement queueing + scheduling yourself.</li></ul><p>If you found the post helpful, don’t forget to shower us with as many claps :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=184a136a5c69" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[System Design Interview : Top K Heavy Hitters]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@techturtles51/system-design-interview-top-k-heavy-hitters-ab49640f3ec9?source=rss-92b2928093eb------2"><img src="https://cdn-images-1.medium.com/max/1482/1*09nKkfgaRkj7nlAWXHFiuw.png" width="1482"></a></p><p class="medium-feed-snippet">Problem Statement&#xA0;: Identify the top K trending events, like popular hashtags on LinkedIn, most liked photos on Instagram, or most played&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@techturtles51/system-design-interview-top-k-heavy-hitters-ab49640f3ec9?source=rss-92b2928093eb------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@techturtles51/system-design-interview-top-k-heavy-hitters-ab49640f3ec9?source=rss-92b2928093eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab49640f3ec9</guid>
            <category><![CDATA[trending-events]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[count-min-sketch]]></category>
            <category><![CDATA[heavy-hitters]]></category>
            <category><![CDATA[hld]]></category>
            <dc:creator><![CDATA[TechTurtLes]]></dc:creator>
            <pubDate>Thu, 23 May 2024 18:24:18 GMT</pubDate>
            <atom:updated>2024-08-10T11:26:45.240Z</atom:updated>
        </item>
    </channel>
</rss>