<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marc</title>
    <description>The latest articles on DEV Community by Marc (@cramxd).</description>
    <link>https://dev.to/cramxd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4214562%2F1f668f09-a443-4cb9-a4d4-1149299ec19b.jpg</url>
      <title>DEV Community: Marc</title>
      <link>https://dev.to/cramxd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cramxd"/>
    <language>en</language>
    <item>
      <title>Your Docker Hub rate limit is a NAT problem, not a registry problem</title>
      <dc:creator>Marc</dc:creator>
      <pubDate>Sat, 14 Nov 2026 18:43:33 +0000</pubDate>
      <link>https://dev.to/cramxd/your-docker-hub-rate-limit-is-a-nat-problem-not-a-registry-problem-1312</link>
      <guid>https://dev.to/cramxd/your-docker-hub-rate-limit-is-a-nat-problem-not-a-registry-problem-1312</guid>
      <description>&lt;p&gt;Suppose your CI runs on a handful of machines behind one office IP, and each pipeline wave pulls fifteen images across ten jobs. That is 150 pulls. Docker Hub gives an unauthenticated client 100 per six hours — keyed to the IPv4 address or the IPv6 &lt;code&gt;/64&lt;/code&gt; — so the second wave of the afternoon fails with a &lt;code&gt;429&lt;/code&gt; and a message about upgrading, which the person on call reads as a broken tag.&lt;/p&gt;

&lt;p&gt;A pull-through cache is the cheap answer: one container that speaks the Registry v2 API to your machines and speaks it back to Docker Hub only on a miss. The full build is in the guide below — one JSON config, one compose file, measured twice against &lt;code&gt;zot:v2.1.23&lt;/code&gt;, verified 2026-11-10.&lt;/p&gt;

&lt;h2&gt;
  
  
  The numbers that surprised me
&lt;/h2&gt;

&lt;p&gt;A hit is ten to twenty times faster than a direct pull: 0.21–0.26 s against 1.7–6.4 s across two runs on &lt;code&gt;alpine:3.22&lt;/code&gt; and &lt;code&gt;nginx:1.29-alpine&lt;/code&gt;. That part is expected.&lt;/p&gt;

&lt;p&gt;What is not expected is that a cold cache did not cost anything. The naive model says the cache is an extra hop, so the first pull should be slower. For the 26 MB nginx image it was 2.2–2.6 s through a cold zot against 5.1–6.4 s straight from Docker Hub, in both rounds. The reason is in the next section, and it is the part worth designing around.&lt;/p&gt;

&lt;h2&gt;
  
  
  A manifest request fills the whole image
&lt;/h2&gt;

&lt;p&gt;Ask zot for a manifest and it syncs the image, without waiting for the client to request layer three. In the measurement, a client requested the manifest list and the child manifest and then went idle: &lt;code&gt;redis:7-alpine&lt;/code&gt; grew the store by 12,659,243 bytes six seconds later, &lt;code&gt;busybox:1.37&lt;/code&gt; by 2,243,024 bytes eight seconds later, with zero blobs requested by the client.&lt;/p&gt;

&lt;p&gt;So the cache warms itself ahead of the client, which explains the fast cold pulls — and it means disk usage tracks the number of distinct tags somebody asks for, not the number of containers running in production. A floating &lt;code&gt;latest&lt;/code&gt;, or a per-commit tag in CI, adds a full image every rebuild, forever. Size the volume for tag churn you do not control, and alert on free disk rather than on cache size.&lt;/p&gt;

&lt;p&gt;The upside is real: identical blobs are hardlinked across repositories, so pulling &lt;code&gt;redis:7-alpine&lt;/code&gt; (16,420,206 bytes of layers) grew the store by only 12,659,243 — the Alpine base layer was already there. Two full runs over the same two images ended at 29,999,658 bytes, identical to the byte both times. A cache whose contents are deterministic is a cache you can reason about.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would do differently
&lt;/h2&gt;

&lt;p&gt;Publish the port on &lt;code&gt;127.0.0.1&lt;/code&gt;, never &lt;code&gt;0.0.0.0&lt;/code&gt;. An unauthenticated zot answers &lt;code&gt;/v2/&lt;/code&gt; with &lt;code&gt;200&lt;/code&gt;, so a public port is a free bandwidth relay wearing your IP address; reach it over an SSH tunnel until you have TLS and auth in front.&lt;/p&gt;

&lt;p&gt;Pick one client path and stick to it. A registry-prefixed reference (&lt;code&gt;localhost:5000/library/nginx:1.29-alpine&lt;/code&gt;) tells you in the compose file whether a pull goes through the cache; a daemon-wide &lt;code&gt;registry-mirrors&lt;/code&gt; entry is less typing and invisible in the reference the CLI prints, which is exactly what you do not want at 2 a.m.&lt;/p&gt;

&lt;p&gt;And measure disk from inside a root container. zot does not run as root, so &lt;code&gt;du -sb&lt;/code&gt; on the data directory as your own user fails with &lt;code&gt;Permission denied&lt;/code&gt; on &lt;code&gt;blobs/&lt;/code&gt; and reports a cache of 170 KB. Idle cost of the finished cache: 65 MiB of RAM, 0.17% CPU.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://runcheap.dev/guides/pull-through-registry-cache-zot/" rel="noopener noreferrer"&gt;Build a Pull-Through Container Registry Cache with Zot&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>registry</category>
      <category>devops</category>
      <category>selfhosted</category>
    </item>
    <item>
      <title>Meilisearch is the easy part. The sync worker is where it hurts.</title>
      <dc:creator>Marc</dc:creator>
      <pubDate>Fri, 06 Nov 2026 08:07:27 +0000</pubDate>
      <link>https://dev.to/cramxd/meilisearch-is-the-easy-part-the-sync-worker-is-where-it-hurts-5fa2</link>
      <guid>https://dev.to/cramxd/meilisearch-is-the-easy-part-the-sync-worker-is-where-it-hurts-5fa2</guid>
      <description>&lt;p&gt;Suppose your product catalog lives in Postgres and search is &lt;code&gt;ILIKE '%term%'&lt;/code&gt;. It works, nobody complains, and the table is small. Then &lt;code&gt;hedphones&lt;/code&gt; returns nothing, the query plan turns into a sequential scan, and you start reading about Meilisearch.&lt;/p&gt;

&lt;p&gt;The indexing part is genuinely easy. &lt;code&gt;docker compose up&lt;/code&gt;, create the index, push documents, done. The guide linked below walks the whole build and every number in it comes from two runs against &lt;code&gt;postgres:18.6-alpine&lt;/code&gt; and &lt;code&gt;getmeili/meilisearch:v1.56.0&lt;/code&gt; over 20,002 rows, verified 2026-11-03.&lt;/p&gt;

&lt;p&gt;What is not easy is the part nobody writes about: the worker that keeps the two in step.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bug is a timestamp, not a query
&lt;/h2&gt;

&lt;p&gt;Postgres &lt;code&gt;now()&lt;/code&gt; is the transaction timestamp. A single &lt;code&gt;INSERT ... SELECT&lt;/code&gt; of 20,000 rows gives every row the exact same &lt;code&gt;updated_at&lt;/code&gt; — checked directly against that seed, 20,000 rows, one distinct value.&lt;/p&gt;

&lt;p&gt;Now write the obvious cursor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First page indexes 1,000 rows. The cursor becomes the shared timestamp. The second page returns nothing. No error, no log line, 19,000 documents silently missing. Switch to &lt;code&gt;&amp;gt;=&lt;/code&gt; and you get the mirror bug: the same 1,000 rows forever while the worker spins, which is how a worker stalled at 500 documents during this build.&lt;/p&gt;

&lt;p&gt;The fix is a row comparison on &lt;code&gt;(updated_at, id)&lt;/code&gt; with a composite index and a strict &lt;code&gt;&amp;gt;&lt;/code&gt;. The id breaks the tie, and the total order survives a bulk load. It does not survive commit order — which is the part I had wrong until lycore pointed it out in the comments.&lt;/p&gt;

&lt;p&gt;There is a second trap underneath it. &lt;code&gt;pg&lt;/code&gt; parses &lt;code&gt;timestamptz&lt;/code&gt; into a JavaScript &lt;code&gt;Date&lt;/code&gt;, which keeps milliseconds. Select the column without a cast and you hand back a value slightly earlier than the rows you just read, so the next page starts inside the previous one — reported progress that never advances. &lt;code&gt;updated_at::text&lt;/code&gt; as the cursor format is the whole fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  The case the tuple does not cover
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;now()&lt;/code&gt; is the transaction timestamp, not the commit time. A transaction that starts at 09:00, writes one row and commits at 09:04 stamps that row with 09:00. If the worker read past 09:00 at 09:02, the row sits behind the cursor forever. &lt;code&gt;(updated_at, id)&lt;/code&gt; orders rows by timestamp; commit order is a different sequence, so the tie-breaker does not rescue it.&lt;/p&gt;

&lt;p&gt;Two fixes, neither free. &lt;strong&gt;Overlap&lt;/strong&gt;: read from &lt;code&gt;cursor - interval '5 minutes'&lt;/code&gt; and upsert by primary key, which is idempotent and only narrows the hole to transactions longer than the overlap. &lt;strong&gt;A scheduled rebuild&lt;/strong&gt;: at 20,000 documents a reset and reindex takes about a second, so a nightly rebuild clears what slipped through, and that is the cheapest correct answer while the index is small.&lt;/p&gt;

&lt;p&gt;An outbox does not remove it either. A &lt;code&gt;bigserial&lt;/code&gt; hands out ids in insert order, not commit order, so a lower id can still commit after a higher one. Past the size where rebuilds are cheap, the cursor has to come from the WAL — logical replication — because that is the only sequence that matches commit order.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you actually gain
&lt;/h2&gt;

&lt;p&gt;The same four queries on both engines, counts identical across both runs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;wireless headphones&lt;/code&gt; — 31 hits in Postgres with &lt;code&gt;plainto_tsquery&lt;/code&gt;, 1,112 in Meilisearch.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;hedphones&lt;/code&gt; — 0 versus 578.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mech&lt;/code&gt; as a prefix — 0 versus 1,123.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The second and third rows are the real story, and they are not the same story. The prefix gap is a query shape: &lt;code&gt;to_tsquery('english', 'mech:*')&lt;/code&gt; gets Postgres the same 1,123. The typo gap is structural. Substring matching also returns 0 because the missing character is in the middle, and edit distance is not in Postgres core — you would add &lt;code&gt;pg_trgm&lt;/code&gt;, a second index and a second scoring model.&lt;/p&gt;

&lt;p&gt;The 31-versus-1,112 gap on two words is a design choice, not a bug either way: strict AND is easier to trust, term dropping is easier to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  The cost is disk, and it is 4.3x
&lt;/h2&gt;

&lt;p&gt;Roughly 330 bytes per document in Postgres against 1,400 in Meilisearch. At 20 million documents that is 6.6 GB of Postgres index against 28 GB of Meilisearch — size the disk for the second number.&lt;/p&gt;

&lt;p&gt;The trade is fine once you notice the index is disposable. Reset the cursor to &lt;code&gt;to_timestamp(0)&lt;/code&gt; and a full rebuild of 20,000 documents takes about a second. A corrupt read model is a one-minute problem, not a restore-from-backup problem, and that is the property that makes the whole architecture worth it.&lt;/p&gt;

&lt;p&gt;Full build: schema, trigger, keyset worker, search endpoint with allowlisted filters, and the measured latency tables — including why timing Postgres through &lt;code&gt;psql \timing&lt;/code&gt; in &lt;code&gt;docker exec&lt;/code&gt; gave numbers an order of magnitude too high.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://runcheap.dev/guides/self-hosted-search-meilisearch-postgres/" rel="noopener noreferrer"&gt;Build a Self-Hosted Search API with Meilisearch and PostgreSQL&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>meilisearch</category>
      <category>search</category>
      <category>docker</category>
    </item>
    <item>
      <title>The managed Postgres bill nobody puts on the pricing page</title>
      <dc:creator>Marc</dc:creator>
      <pubDate>Fri, 30 Oct 2026 16:31:25 +0000</pubDate>
      <link>https://dev.to/cramxd/the-managed-postgres-bill-nobody-puts-on-the-pricing-page-26ha</link>
      <guid>https://dev.to/cramxd/the-managed-postgres-bill-nobody-puts-on-the-pricing-page-26ha</guid>
      <description>&lt;p&gt;Suppose you move your database to a managed Postgres plan. Twenty-five dollars a month, no patching, a dashboard with a restore button. Compared to the VPS you were going to run yourself, it looks like the responsible choice.&lt;/p&gt;

&lt;p&gt;Then you read the pricing page properly, all the way down, and find the line that changes the comparison: point-in-time recovery, billed at &lt;strong&gt;$100/month per 7 days of retention&lt;/strong&gt;, on top of the plan.&lt;/p&gt;

&lt;p&gt;That is not a hosting cost. That is a different product, priced like insurance, and it is the one thing a self-hosted &lt;code&gt;pgBackRest&lt;/code&gt; gives you for the price of a cron job.&lt;/p&gt;

&lt;h2&gt;
  
  
  The comparison everyone makes
&lt;/h2&gt;

&lt;p&gt;Prices read from the providers' own pages on 2026-10-29, before tax:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;th&gt;Monthly&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OVHcloud VPS-1&lt;/td&gt;
&lt;td&gt;2 vCores, 4 GB RAM, 40 GB NVMe, daily backup&lt;/td&gt;
&lt;td&gt;€4.49&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Supabase Pro&lt;/td&gt;
&lt;td&gt;8 GB disk, $10 compute credit covering one Micro instance&lt;/td&gt;
&lt;td&gt;$25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Supabase PITR add-on&lt;/td&gt;
&lt;td&gt;7-day retention&lt;/td&gt;
&lt;td&gt;+$100&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On RAM per euro, the VPS wins by roughly a factor of twenty. A Supabase Micro instance is 1 GB of RAM for $25. A 4 GB VPS is four euros and change.&lt;/p&gt;

&lt;p&gt;So the easy conclusion is "managed is a rip-off". That conclusion is wrong, and it is wrong for a reason that has nothing to do with RAM.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you are actually buying
&lt;/h2&gt;

&lt;p&gt;Five things, none of which appear in the spec column:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Backups someone else scheduled.&lt;/li&gt;
&lt;li&gt;Point-in-time recovery — if you pay the line above.&lt;/li&gt;
&lt;li&gt;Major-version upgrades someone else ran first.&lt;/li&gt;
&lt;li&gt;Failover, on the tiers that include it.&lt;/li&gt;
&lt;li&gt;A connection pooler in front of a database that does not enjoy thousands of connections.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you can do 1 through 3 reliably, self-hosting wins on money and you should close this tab. If you cannot, the managed price is not hosting. It is insurance, and insuring a database is cheaper than losing one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The calculation nobody does
&lt;/h2&gt;

&lt;p&gt;Write your hourly rate down first. Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;self-hosted = VPS + (hours of database work × your rate)
managed     = plan + (hours of migration and plumbing × your rate)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A 4 GB VPS is €4.49. The managed plan is $25. The gap is about €20 a month — half an hour of a freelance rate. If self-hosting costs you more than thirty minutes a month in patching, backup checks and the occasional restore rehearsal, you are subsidising the server with your evenings.&lt;/p&gt;

&lt;p&gt;That arithmetic flips at the first incident. An unrehearsed restore is not thirty minutes. It is a night, and sometimes a customer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one question that decides it
&lt;/h2&gt;

&lt;p&gt;Not "which is cheaper". This one:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have you restored from your own backup in the last 90 days, and did you time it?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If yes, self-hosting is a defensible engineering choice and you can stop paying for a dashboard.&lt;/p&gt;

&lt;p&gt;If no, you do not currently have a backup strategy. You have a backup job whose success you have never verified, and the managed plan is the cheaper way to fix that today.&lt;/p&gt;

&lt;p&gt;The full comparison, with the Neon per-CU maths, the migration path in both directions and the checklist I would run before choosing:&lt;br&gt;
&lt;strong&gt;&lt;a href="https://runcheap.dev/guides/managed-postgresql-vs-postgresql-on-vps/" rel="noopener noreferrer"&gt;Managed PostgreSQL vs PostgreSQL on a VPS&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>database</category>
      <category>cost</category>
      <category>selfhosting</category>
    </item>
    <item>
      <title>I got tired of tutorials that hide the bill</title>
      <dc:creator>Marc</dc:creator>
      <pubDate>Thu, 29 Oct 2026 07:10:34 +0000</pubDate>
      <link>https://dev.to/cramxd/i-got-tired-of-tutorials-that-hide-the-bill-2m63</link>
      <guid>https://dev.to/cramxd/i-got-tired-of-tutorials-that-hide-the-bill-2m63</guid>
      <description>&lt;p&gt;Hello. I am Marc, and I write &lt;a href="https://runcheap.dev" rel="noopener noreferrer"&gt;runcheap.dev&lt;/a&gt; — a small blog of executable technical guides.&lt;/p&gt;

&lt;p&gt;Not "executable" as in "here is a snippet". As in: the commands, the config file, the deploy, and the monthly invoice at the end. I started writing it because I kept landing on tutorials that got me to a working app and then said &lt;em&gt;"hosting starts at $4/month"&lt;/em&gt; and stopped.&lt;/p&gt;

&lt;p&gt;Four dollars for what, exactly? How much RAM? Is the backup included? Does it survive a database that does not fit in memory?&lt;/p&gt;

&lt;p&gt;So the rule on my blog is simple: &lt;strong&gt;every price carries the date I read it on the provider's own page&lt;/strong&gt;, and every command was run somewhere before it was published. No affiliate links, no "as low as", no number I could not verify myself.&lt;/p&gt;

&lt;p&gt;That rule has an awkward consequence, and it is the part I actually want to write about.&lt;/p&gt;

&lt;p&gt;Last week I rewrote a comparison between two European hosting providers. One of them served me no prices at all — its storefront marked every plan as currently unavailable and showed no figures. The easy move was to quote the prices from an older version of my own article. Instead I wrote down what I saw: no prices served, model line changed, price it yourself on their calculator before you budget.&lt;/p&gt;

&lt;p&gt;An empty cell with an explanation is more useful than a confident wrong number. It just does not look as good in a table.&lt;/p&gt;

&lt;p&gt;What you will find here: cross-posts of the guides I publish on runcheap.dev, one at a time, with a canonical link back to the original. The cost breakdowns first — those are the ones people actually need and the ones nobody wants to write.&lt;/p&gt;

&lt;p&gt;If a number here is wrong, tell me. It gets fixed and republished with a new verification date, not quietly deleted.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>writing</category>
    </item>
  </channel>
</rss>
