<?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 Luther Monson</title>
    <link>https://luth.io/tags/redis/</link>
    <description>Recent content in Redis on Luther Monson</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 13 Oct 2026 20:40:00 -0700</lastBuildDate>
    <atom:link href="https://luth.io/tags/redis/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>A Lock Is Only as Good as Its Release</title>
      <link>https://luth.io/blog/2026/10/a-lock-is-only-as-good-as-its-release/</link>
      <pubDate>Tue, 13 Oct 2026 20:40:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/10/a-lock-is-only-as-good-as-its-release/</guid>
      <description>&lt;p&gt;Every &amp;ldquo;build a lock on Redis&amp;rdquo; tutorial spends its time on acquisition: &lt;code&gt;SET key value NX PX 30000&lt;/code&gt;, one winner, done. The&#xA;release gets one line, &lt;code&gt;DEL key&lt;/code&gt;. That line is where most of the lock bugs I&amp;rsquo;ve had in ePHPm lived. Over about three&#xA;months the same mistake showed up in three places. First the native session handler, then two of the Composer wrapper&#xA;packages, and finally the cluster. Each time it wore a slightly different costume.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calling Rust From PHP Without a Socket, Part 2: Making Existing Code Use It</title>
      <link>https://luth.io/blog/2026/09/calling-rust-from-php-without-a-socket-part-2/</link>
      <pubDate>Mon, 21 Sep 2026 19:55:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/calling-rust-from-php-without-a-socket-part-2/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://luth.io/blog/2026/09/calling-rust-from-php-without-a-socket-part-1/&#34;&gt;Part 1&lt;/a&gt; covered the plumbing. ePHPm registers&#xA;&lt;code&gt;ephpm_kv_*&lt;/code&gt; and &lt;code&gt;ephpm_db_*&lt;/code&gt; functions that call straight into Rust. A cache read through one costs about a tenth of a&#xA;microsecond instead of a loopback round trip. That&amp;rsquo;s nice and also useless on its own. Nobody is going to rewrite their&#xA;WordPress object cache or their Laravel cache store around a function called &lt;code&gt;ephpm_kv_set()&lt;/code&gt;. Applications talk to&#xA;existing APIs instead:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Redis through phpredis or Predis&lt;/li&gt;&#xA;&lt;li&gt;the cache through PSR-6/16 or &lt;code&gt;wp_cache_*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;the database through &lt;code&gt;wpdb&lt;/code&gt;, mysqli, Eloquent or DBAL&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So there&amp;rsquo;s a set of Composer packages in the &lt;a href=&#34;https://github.com/ephpm&#34;&gt;ephpm org&lt;/a&gt; whose whole job is to sit under those&#xA;APIs and route them to the native functions. This post covers what&amp;rsquo;s in them and the rule that decides when they switch&#xA;on. It also covers the bugs that only showed up once real applications ran on top.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calling Rust From PHP Without a Socket, Part 1: The Native Functions</title>
      <link>https://luth.io/blog/2026/09/calling-rust-from-php-without-a-socket-part-1/</link>
      <pubDate>Mon, 14 Sep 2026 20:40:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/calling-rust-from-php-without-a-socket-part-1/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; is a single Rust binary that embeds PHP. It carries its own KV store and its own&#xA;SQLite-backed database in the same process. For a long time PHP code could only reach that KV store the same way it&#xA;reaches Redis. It opened a TCP socket to the RESP listener ePHPm runs on localhost, encoded a command and waited for the&#xA;reply. That works, and every PHP Redis client in existence already speaks it. But it is a strange thing to do when the&#xA;hash map you&amp;rsquo;re talking to lives a few pointers away in the same address space.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rolling Your Own KV Store Instead of Embedding Redis</title>
      <link>https://luth.io/blog/2026/08/rolling-your-own-kv-store/</link>
      <pubDate>Mon, 17 Aug 2026 20:44:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/rolling-your-own-kv-store/</guid>
      <description>&lt;p&gt;Every PHP deployment I&amp;rsquo;ve run eventually grew a Redis. Sessions, the WordPress object cache, Laravel&amp;rsquo;s cache and locks,&#xA;rate limiting. &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; is supposed to be one binary that replaces nginx + php-fpm +&#xA;Redis, so it needed a cache in the box. I didn&amp;rsquo;t want to write one. This post covers why I did anyway and how it&amp;rsquo;s&#xA;built. It also covers the bug that sat in its eviction code from March until last month. Then I compare it against a&#xA;stock Redis on the same machine with &lt;code&gt;redis-benchmark&lt;/code&gt; doing the talking.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
