<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caching on Java &amp; Software Architecture Knowledge Hub</title><link>https://samirsahoo.github.io/design-patterns-hub/tags/caching/</link><description>Recent content in Caching on Java &amp; Software Architecture Knowledge Hub</description><generator>Hugo</generator><language>en-US</language><copyright>© 2026 Samir Kumar Sahoo (https://github.com/samirsahoo). All rights reserved.</copyright><atom:link href="https://samirsahoo.github.io/design-patterns-hub/tags/caching/index.xml" rel="self" type="application/rss+xml"/><item><title>Designing a URL Shortener</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/url-shortener/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/url-shortener/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;a class="heading-anchor" href="#overview" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;A URL shortener turns &lt;code&gt;https://example.com/blog/2026/11/a-very-long-article-title?utm_source=newsletter&lt;/code&gt; into &lt;code&gt;https://sho.rt/3Fq9Zk&lt;/code&gt; and redirects visitors from the short URL to the original. It is a classic first system design question because it is small enough to finish, yet touches ID generation, encoding, caching, read-heavy scaling and analytics. It follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Caching Strategies: Patterns, Invalidation, Eviction and Failure Modes</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/caching-strategies/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/caching-strategies/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;A &lt;strong&gt;cache&lt;/strong&gt; is a small, fast store holding copies of data that is expensive to fetch or compute. It works because of &lt;strong&gt;locality of reference&lt;/strong&gt;: recently requested data is likely to be requested again. Caches exist at almost every layer — hardware, operating system, browser, CDN, application, database — and they are the cheapest way to cut latency and load.&lt;/p&gt;</description></item><item><title>Consistent Hashing</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/consistent-hashing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/consistent-hashing/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;Consistent hashing&lt;/strong&gt; is a way to assign keys to servers so that when a server is &lt;strong&gt;added or removed, only a small fraction of keys move&lt;/strong&gt; — about &lt;em&gt;K / N&lt;/em&gt; of &lt;em&gt;K&lt;/em&gt; keys for &lt;em&gt;N&lt;/em&gt; servers — instead of nearly all of them. It is the standard technique for distributing data across distributed caches and leaderless databases.&lt;/p&gt;</description></item><item><title>Designing a Proximity Service (Nearby Places)</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/proximity-service/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/proximity-service/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;a class="heading-anchor" href="#overview" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;A &lt;strong&gt;proximity service&lt;/strong&gt; answers &amp;ldquo;what is near me?&amp;rdquo;: restaurants within 1 km, hotels near a landmark, drivers near a pickup point. Yelp and Google Maps rely on one. The interesting part is the &lt;strong&gt;geospatial index&lt;/strong&gt;: how to find nearby points among hundreds of millions quickly. This design follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt; and expands the ByteByteGo handbook&amp;rsquo;s Yelp and quadtree discussions.&lt;/p&gt;</description></item><item><title>Spring Cache Abstraction and Redis Integration</title><link>https://samirsahoo.github.io/design-patterns-hub/spring/data/caching/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/spring/data/caching/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;The &lt;strong&gt;Spring Cache abstraction&lt;/strong&gt; lets you cache method results declaratively with &lt;code&gt;@Cacheable&lt;/code&gt; and friends. &lt;strong&gt;Where&lt;/strong&gt; data is cached is pluggable: &lt;strong&gt;Caffeine&lt;/strong&gt; in local memory, &lt;strong&gt;Redis&lt;/strong&gt; (or Valkey) shared across instances, Hazelcast and others.&lt;/p&gt;&#10;&lt;h2 id="the-problem"&gt;The problem&lt;a class="heading-anchor" href="#the-problem" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Repeated expensive calls (database aggregations, remote price lookups, reference data) waste latency and load. Ad-hoc &lt;code&gt;Map&lt;/code&gt; caches have no eviction or TTL, are not shared, and are scattered through the code.&lt;/p&gt;</description></item><item><title>Designing a News Feed (Twitter / Instagram Timeline)</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/news-feed/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/news-feed/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;a class="heading-anchor" href="#overview" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;A news feed shows each user the recent posts of the accounts they follow, newest or best first. It is the canonical example of &lt;strong&gt;fan-out&lt;/strong&gt;: one post must appear in the feeds of every follower, and follower counts range from zero to hundreds of millions. Kleppmann uses Twitter&amp;rsquo;s home timeline as his main example of describing load. This design follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Designing Search Autocomplete (Typeahead)</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/search-autocomplete/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/search-autocomplete/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;a class="heading-anchor" href="#overview" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;As a user types &amp;ldquo;sys&amp;rdquo;, the search box suggests &amp;ldquo;system design&amp;rdquo;, &amp;ldquo;system of a down&amp;rdquo;, &amp;ldquo;sysadmin&amp;rdquo;. &lt;strong&gt;Search autocomplete&lt;/strong&gt; must return the top suggestions for a prefix in under 100 ms while users type several characters per second, so the serving path is pure in-memory lookup and all heavy work happens offline. Follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt;.&lt;/p&gt;</description></item></channel></rss>