<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Redis on vnykmshr</title><link>https://blog.vnykmshr.com/writing/tags/redis/</link><description>Recent content in Redis on vnykmshr</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 20 Jun 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.vnykmshr.com/writing/tags/redis/index.xml" rel="self" type="application/rss+xml"/><item><title>Redis caching patterns</title><link>https://blog.vnykmshr.com/writing/redis-caching-patterns/</link><pubDate>Thu, 20 Jun 2024 00:00:00 +0000</pubDate><guid>https://blog.vnykmshr.com/writing/redis-caching-patterns/</guid><description>&lt;p&gt;Put Redis in front of a database and reads get fast. The cost is a cache layer that&amp;rsquo;s now load-bearing, and a set of failure modes that come with that.&lt;/p&gt;
&lt;p&gt;Three write patterns, three hard problems. The patterns determine consistency. The problems determine whether your cache layer is a net positive or a source of outages.&lt;/p&gt;
&lt;h2 id="write-patterns"&gt;Write patterns&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Cache-aside&lt;/strong&gt; (lazy loading). The application checks cache on read. On miss, it reads from the database and populates cache. Writes go directly to the database; cache entries are either invalidated or left to expire.&lt;/p&gt;</description></item><item><title>URL mapping in Redis</title><link>https://blog.vnykmshr.com/writing/url-mapping-in-redis/</link><pubDate>Sun, 10 Jun 2012 00:00:00 +0000</pubDate><guid>https://blog.vnykmshr.com/writing/url-mapping-in-redis/</guid><description>&lt;p&gt;I&amp;rsquo;m working on an e-commerce app in Node.js. The store has SEO-friendly URLs &amp;ndash; &lt;code&gt;/blue-widget/SKU12345/p/&lt;/code&gt; for products, &lt;code&gt;/category-name.html&lt;/code&gt; for categories, &lt;code&gt;/brand-name/&lt;/code&gt; for brands. Those URLs are indexed, bookmarked, linked from everywhere. They can&amp;rsquo;t change.&lt;/p&gt;
&lt;p&gt;Express routes are defined in code. The catalog has enough products, categories, and brands that I&amp;rsquo;m not writing a route for each one. I need a way to map the friendly URL to an internal route at runtime.&lt;/p&gt;</description></item></channel></rss>