<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Sqlite on Luther Monson</title>
    <link>https://luth.io/tags/sqlite/</link>
    <description>Recent content in Sqlite on Luther Monson</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 15 Sep 2026 21:08:00 -0700</lastBuildDate>
    <atom:link href="https://luth.io/tags/sqlite/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Clustered SQLite in ePHPm, Part 3: CDC Over the Cluster Channel</title>
      <link>https://luth.io/blog/2026/09/clustered-sqlite-cdc-cluster-channel/</link>
      <pubDate>Tue, 15 Sep 2026 21:08:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/clustered-sqlite-cdc-cluster-channel/</guid>
      <description>&lt;p&gt;By the end of &lt;a href=&#34;https://luth.io/blog/2026/08/clustered-sqlite-adding-turso/&#34;&gt;Part 2&lt;/a&gt; ePHPm v0.7.0 ran exactly one SQLite engine in&#xA;process. That was Turso, for single-node and clustered mode alike. The sidecar was gone. What I skipped over is how a&#xA;replica actually gets the primary&amp;rsquo;s writes, and what happens when the primary dies with data on it. That&amp;rsquo;s this post.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://luth.io/blog/2026/08/clustered-sqlite-sqld-sidecar/&#34;&gt;Part 1: Replication by sidecar with sqld&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://luth.io/blog/2026/08/clustered-sqlite-adding-turso/&#34;&gt;Part 2: Adding Turso&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Part 3: CDC over the cluster channel (this post)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;cdc-from-the-engine-itself&#34;&gt;CDC from the engine itself&lt;/h3&gt;&#xA;&lt;p&gt;Turso has change data capture built in. Turn it on for a connection and every committed change lands in a &lt;code&gt;turso_cdc&lt;/code&gt;&#xA;table. Each row has a monotonically increasing &lt;code&gt;change_id&lt;/code&gt;, the table, the rowid, and before/after images of the record.&#xA;The primary tails that table and ships transaction batches. Replicas apply them. That&amp;rsquo;s the whole design. It landed as&#xA;an experimental path in &lt;a href=&#34;https://github.com/ephpm/ephpm/pull/186&#34;&gt;#186&lt;/a&gt; at the end of July. The tailer and applier live&#xA;in litewire (&lt;a href=&#34;https://github.com/ephpm/litewire/pull/10&#34;&gt;litewire#10&lt;/a&gt;).&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>Zero-Dependency Deployments - Single Binary for WordPress</title>
      <link>https://luth.io/blog/2026/09/single-binary-wordpress/</link>
      <pubDate>Tue, 08 Sep 2026 20:25:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/single-binary-wordpress/</guid>
      <description>&lt;p&gt;The standard way to run a WordPress site is four services:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;nginx for HTTP and TLS&lt;/li&gt;&#xA;&lt;li&gt;php-fpm to run PHP&lt;/li&gt;&#xA;&lt;li&gt;MySQL for data&lt;/li&gt;&#xA;&lt;li&gt;Redis, once the site gets slow enough that someone installs an object cache plugin&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;That&amp;rsquo;s four processes and four config files. There are three sockets between them and four things to upgrade. For a&#xA;big site that&amp;rsquo;s fine. For a brochure site or a staging copy it&amp;rsquo;s absurd. The same goes for a PR preview, a box at the&#xA;edge, or a CI job that needs a real WordPress to test a plugin against.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Security and Performance Hardening of a Rust Database Proxy</title>
      <link>https://luth.io/blog/2026/08/hardening-rust-database-proxy/</link>
      <pubDate>Thu, 27 Aug 2026 20:30:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/hardening-rust-database-proxy/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com/ephpm/litewire&#34;&gt;litewire&lt;/a&gt; is the piece of ePHPm that lets PHP apps talk MySQL to a SQLite file. I&#xA;wrote about &lt;a href=&#34;https://luth.io/blog/2026/07/sqlite-production-database-protocol-translation/&#34;&gt;how it works&lt;/a&gt; and about &lt;a href=&#34;https://luth.io/blog/2026/08/faking-mysql-quirks-wordpress/&#34;&gt;the MySQL quirks&#xA;WordPress depends on&lt;/a&gt;. This one is the less visible half of August:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;an audit pass on litewire&lt;/li&gt;&#xA;&lt;li&gt;a multi-tenant mode that turned a database proxy into a security boundary&lt;/li&gt;&#xA;&lt;li&gt;a performance regression I shipped and then had to go find&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It&amp;rsquo;s written in Rust. Memory safety is supposed to be the part I don&amp;rsquo;t have to think about, and it mostly is. The&#xA;use-after-free in this story was in a dependency. The worst bug wasn&amp;rsquo;t a memory bug at all.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What Does One More WordPress Site Cost?</title>
      <link>https://luth.io/blog/2026/08/what-does-one-more-wordpress-site-cost/</link>
      <pubDate>Tue, 25 Aug 2026 20:20:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/what-does-one-more-wordpress-site-cost/</guid>
      <description>&lt;p&gt;ePHPm v0.7.0 shipped per-site multi-tenancy. Point &lt;code&gt;[server] sites_dir&lt;/code&gt; at a directory and every &lt;code&gt;Host&lt;/code&gt; maps to its own&#xA;docroot and its own Turso database file. One process serves all of them. The first question anybody asks about that is&#xA;&amp;ldquo;how many sites fit on a box?&amp;rdquo; The honest way to answer it is to turn the question around. What does &lt;strong&gt;one more&lt;/strong&gt; site&#xA;cost? If you know the marginal RAM, file descriptors, CPU and disk for a tenant, the box size falls out of arithmetic.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Clustered SQLite in ePHPm, Part 2: Adding Turso</title>
      <link>https://luth.io/blog/2026/08/clustered-sqlite-adding-turso/</link>
      <pubDate>Wed, 19 Aug 2026 20:37:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/clustered-sqlite-adding-turso/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://luth.io/blog/2026/08/clustered-sqlite-sqld-sidecar/&#34;&gt;Part 1&lt;/a&gt; ended with ePHPm running two SQLite engines. rusqlite ran&#xA;in-process for a single node, and an embedded sqld child process ran for a cluster. The sidecar fell off a cliff past&#xA;four concurrent writers. The best fix I could ship was a semaphore set to 1. This post is about replacing both engines&#xA;with one, and about how I decided that engine was ready.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://luth.io/blog/2026/08/clustered-sqlite-sqld-sidecar/&#34;&gt;Part 1: Replication by sidecar with sqld&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Part 2: Adding Turso (this post)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://luth.io/blog/2026/09/clustered-sqlite-cdc-cluster-channel/&#34;&gt;Part 3: CDC over the cluster channel&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;the-thesis&#34;&gt;The thesis&lt;/h3&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/tursodatabase/turso&#34;&gt;Turso Database&lt;/a&gt; is a rewrite of SQLite in Rust:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Faking MySQL&#39;s Quirks Well Enough to Fool WordPress</title>
      <link>https://luth.io/blog/2026/08/faking-mysql-quirks-wordpress/</link>
      <pubDate>Sun, 16 Aug 2026 15:50:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/faking-mysql-quirks-wordpress/</guid>
      <description>&lt;p&gt;Last month I wrote about &lt;a href=&#34;https://luth.io/blog/2026/07/sqlite-production-database-protocol-translation/&#34;&gt;running SQLite behind a MySQL socket&lt;/a&gt;&#xA;with &lt;a href=&#34;https://github.com/ephpm/litewire&#34;&gt;litewire&lt;/a&gt;. I ended on &amp;ldquo;passing an install suite is not the same thing as&#xA;behaving like MySQL&amp;rdquo;. That turned out to be accurate. On August 10th a few things happened at once:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I put a real WordPress 7.0.3 site through a benchmark on ePHPm.&lt;/li&gt;&#xA;&lt;li&gt;I A/B tested the new in-process database bridge against the wire path.&lt;/li&gt;&#xA;&lt;li&gt;I started building &lt;a href=&#34;https://github.com/ephpm/db-wordpress&#34;&gt;ephpm/db-wordpress&lt;/a&gt;, a &lt;code&gt;wpdb&lt;/code&gt; drop-in that talks to the&#xA;database in-process instead of over a socket.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Between them they produced six litewire issues in about three hours. None of them broke the install. All of them made&#xA;WordPress quietly do the wrong thing.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Clustered SQLite in ePHPm, Part 1: Replication by Sidecar</title>
      <link>https://luth.io/blog/2026/08/clustered-sqlite-sqld-sidecar/</link>
      <pubDate>Sat, 08 Aug 2026 20:14:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/clustered-sqlite-sqld-sidecar/</guid>
      <description>&lt;p&gt;Most PHP sites I have run in the last twenty years did not need a MySQL server. They needed &lt;em&gt;a&lt;/em&gt; database, and MySQL was the&#xA;one every framework spoke. With &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; I have been trying to get rid of that server for&#xA;the common case. The piece that makes it possible is &lt;a href=&#34;https://github.com/ephpm/litewire&#34;&gt;litewire&lt;/a&gt;. PHP connects with&#xA;plain &lt;code&gt;pdo_mysql&lt;/code&gt;. litewire speaks the MySQL wire protocol, and the queries land in a SQLite file. WordPress and Laravel&#xA;don&amp;rsquo;t know the difference. No &lt;code&gt;mysqld&lt;/code&gt;, no child processes, just &lt;code&gt;ephpm&lt;/code&gt; and a &lt;code&gt;.db&lt;/code&gt; file.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SQLite as a Production Database via Protocol Translation</title>
      <link>https://luth.io/blog/2026/07/sqlite-production-database-protocol-translation/</link>
      <pubDate>Sat, 25 Jul 2026 20:40:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/07/sqlite-production-database-protocol-translation/</guid>
      <description>&lt;p&gt;Most of the PHP sites I&amp;rsquo;d put on &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; don&amp;rsquo;t need a MySQL server. A brochure&#xA;WordPress, an internal Laravel tool, a preview environment that lives for an afternoon. What they do need is something&#xA;that &lt;em&gt;looks&lt;/em&gt; like MySQL, because &lt;code&gt;mysqli&lt;/code&gt; and &lt;code&gt;pdo_mysql&lt;/code&gt; are the only database drivers their code has ever been&#xA;pointed at. I mentioned this in the &lt;a href=&#34;https://luth.io/blog/2026/06/ephpm-pragmatism/&#34;&gt;ePHPm pragmatism post&lt;/a&gt; as a one-paragraph&#xA;&amp;ldquo;because&amp;rdquo;. This is the longer version, now that WordPress 7.0 and Laravel 13 both install and run end to end on it.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
