<?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: Mary Olowu</title>
    <description>The latest articles on DEV Community by Mary Olowu (@restofstack).</description>
    <link>https://dev.to/restofstack</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F716762%2Fdc53569e-f923-4062-9a65-d47a8730562e.png</url>
      <title>DEV Community: Mary Olowu</title>
      <link>https://dev.to/restofstack</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/restofstack"/>
    <language>en</language>
    <item>
      <title>I Renamed a Hot Postgres Table Without Dropping a Request</title>
      <dc:creator>Mary Olowu</dc:creator>
      <pubDate>Thu, 21 May 2026 15:23:19 +0000</pubDate>
      <link>https://dev.to/restofstack/i-renamed-a-hot-postgres-table-without-dropping-a-request-1bal</link>
      <guid>https://dev.to/restofstack/i-renamed-a-hot-postgres-table-without-dropping-a-request-1bal</guid>
      <description>&lt;p&gt;Most table renames are database-easy and deploy-hard.&lt;/p&gt;

&lt;p&gt;The SQL looked trivial:&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;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;oidc_clients&lt;/span&gt; &lt;span class="k"&gt;RENAME&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;oidc_provider_clients&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In PostgreSQL, that rename is fast and metadata-only.&lt;/p&gt;

&lt;p&gt;The real problem was the rollout window around it.&lt;/p&gt;

&lt;p&gt;This was a live IAM service on the login path, deployed across multiple pods. During a rolling deploy, there is always a period where some instances run the new code and some still run the old code.&lt;/p&gt;

&lt;p&gt;During that window:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;new pods query &lt;code&gt;oidc_provider_clients&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;old pods still query &lt;code&gt;oidc_clients&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you rename the table and do nothing else, old pods start failing with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;relation "oidc_clients" does not exist
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fix was a two-line compatibility shim:&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;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;oidc_clients&lt;/span&gt; &lt;span class="k"&gt;RENAME&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;oidc_provider_clients&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;oidc_clients&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;oidc_provider_clients&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That was enough to let old pods survive the rollout window while new pods moved to the renamed table.&lt;/p&gt;

&lt;p&gt;If the only thing that changed is the table name, the old name can keep working for another minute.&lt;/p&gt;

&lt;p&gt;That was the whole trick.&lt;/p&gt;

&lt;h2&gt;
  
  
  The real failure mode
&lt;/h2&gt;

&lt;p&gt;On a static database, &lt;code&gt;ALTER TABLE ... RENAME&lt;/code&gt; is boring.&lt;/p&gt;

&lt;p&gt;On a live service, the schema and application versions are temporarily out of sync by design:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the migration has already run&lt;/li&gt;
&lt;li&gt;some pods still serve old code&lt;/li&gt;
&lt;li&gt;some pods already serve new code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That mismatch window is where destructive naming changes fail.&lt;/p&gt;

&lt;p&gt;The usual options are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;accept a maintenance window&lt;/li&gt;
&lt;li&gt;do a multi-release expand/contract migration with dual writes&lt;/li&gt;
&lt;li&gt;add a short-lived compatibility layer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For a pure rename, option 3 is much cheaper than the other two.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shim
&lt;/h2&gt;

&lt;p&gt;Right after the rename, create a view with the old name:&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;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;oidc_clients&lt;/span&gt; &lt;span class="k"&gt;RENAME&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;oidc_provider_clients&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;oidc_clients&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;oidc_provider_clients&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now old code can keep using the old relation name:&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;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;oidc_clients&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nv"&gt;"workspaceSlug"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'acme'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And new code can use the new one:&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;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;oidc_provider_clients&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nv"&gt;"workspaceSlug"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'acme'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the rollout finishes and no old pods remain, drop the view in a follow-up migration.&lt;/p&gt;

&lt;p&gt;For a rename, that is exactly the kind of temporary compatibility boundary you want.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part people miss: writes
&lt;/h2&gt;

&lt;p&gt;The first reaction to this pattern is usually:&lt;/p&gt;

&lt;p&gt;"Fine for reads, but views are read-only."&lt;/p&gt;

&lt;p&gt;That is not true for simple PostgreSQL views.&lt;/p&gt;

&lt;p&gt;PostgreSQL automatically makes a view updatable when it is simple enough, which in practice means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one table in the &lt;code&gt;FROM&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;no &lt;code&gt;GROUP BY&lt;/code&gt;, &lt;code&gt;DISTINCT&lt;/code&gt;, &lt;code&gt;HAVING&lt;/code&gt;, &lt;code&gt;LIMIT&lt;/code&gt;, &lt;code&gt;OFFSET&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;no set operations&lt;/li&gt;
&lt;li&gt;no aggregates or window functions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a shim like this:&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;CREATE&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;oidc_clients&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;oidc_provider_clients&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, and &lt;code&gt;DELETE&lt;/code&gt; route to the base table automatically.&lt;/p&gt;

&lt;p&gt;So old code like this still works during the rollout window:&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;UPDATE&lt;/span&gt; &lt;span class="n"&gt;oidc_clients&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;revoked&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nv"&gt;"workspaceSlug"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'acme'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;oidc_clients&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nv"&gt;"workspaceSlug"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'__some_test__'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is no trigger to write. No dual-write logic. No extra application routing code.&lt;/p&gt;

&lt;p&gt;You still get the normal locks and write behavior of hitting the base table. You just do not have to build extra migration machinery to keep the old name alive for 60 seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  The objection that mattered
&lt;/h2&gt;

&lt;p&gt;One reviewer raised the real objection:&lt;/p&gt;

&lt;p&gt;what about &lt;code&gt;INSERT ... ON CONFLICT DO UPDATE&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;That was not hypothetical. One old path still did an upsert against the old relation name.&lt;/p&gt;

&lt;p&gt;The concern looked legitimate because a lot of older advice around updatable views says they do not support &lt;code&gt;ON CONFLICT&lt;/code&gt;, and search results still surface that warning.&lt;/p&gt;

&lt;p&gt;So I tested it directly before complicating the migration.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I tested
&lt;/h2&gt;

&lt;p&gt;With the renamed table and compatibility view in place:&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;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;oidc_clients&lt;/span&gt; &lt;span class="k"&gt;RENAME&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;oidc_provider_clients&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;oidc_clients&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;oidc_provider_clients&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I ran an upsert through the view:&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;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;oidc_clients&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;"clientId"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'test_x'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'{"v":1}'&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;jsonb&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;CONFLICT&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;"clientId"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;DO&lt;/span&gt; &lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;metadata&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;EXCLUDED&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I ran it again with different data to force the conflict path:&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;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;oidc_clients&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;"clientId"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'test_x'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'{"v":2}'&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;jsonb&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;CONFLICT&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;"clientId"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;DO&lt;/span&gt; &lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;metadata&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;EXCLUDED&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both statements succeeded. The row landed in &lt;code&gt;oidc_provider_clients&lt;/code&gt;, and the second statement updated the existing row as expected.&lt;/p&gt;

&lt;p&gt;We verified it on PostgreSQL 16.12 in production and 16.13 locally.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://www.postgresql.org/docs/current/sql-createview.html" rel="noopener noreferrer"&gt;current PostgreSQL docs for &lt;code&gt;CREATE VIEW&lt;/code&gt;&lt;/a&gt; also say that &lt;code&gt;INSERT&lt;/code&gt; statements with &lt;code&gt;ON CONFLICT UPDATE&lt;/code&gt; are fully supported on automatically updatable views.&lt;/p&gt;

&lt;p&gt;So if your shim is a simple single-table view, modern Postgres can carry more of the rollout than a lot of engineers assume.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this beats expand/contract for a pure rename
&lt;/h2&gt;

&lt;p&gt;Expand/contract is still the right answer when the shape changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;new columns with new semantics&lt;/li&gt;
&lt;li&gt;type changes&lt;/li&gt;
&lt;li&gt;split or merged fields&lt;/li&gt;
&lt;li&gt;different write paths&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But for a pure rename, dual-write is wasted complexity.&lt;/p&gt;

&lt;p&gt;You are not changing where the data logically lives. You are changing the name application code uses to reach it.&lt;/p&gt;

&lt;p&gt;That is exactly the kind of mismatch a short-lived compatibility view is good at absorbing.&lt;/p&gt;

&lt;p&gt;If PostgreSQL can cheaply preserve compatibility during the rollout, I would rather buy compatibility than orchestrate a bigger migration plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  When I would use this
&lt;/h2&gt;

&lt;p&gt;This pattern is a good fit when all of these are true:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the old and new code need the same row shape&lt;/li&gt;
&lt;li&gt;the compatibility layer can be a simple single-table view&lt;/li&gt;
&lt;li&gt;you only need the shim for the duration of a rolling deploy&lt;/li&gt;
&lt;li&gt;the real change is a rename, not a semantic rewrite&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When I would not
&lt;/h2&gt;

&lt;p&gt;Do not use this as a magic answer for every migration.&lt;/p&gt;

&lt;p&gt;It stops being the right tool when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the view would need joins or aggregates&lt;/li&gt;
&lt;li&gt;old and new code disagree on column names or types&lt;/li&gt;
&lt;li&gt;the application depends on shape changes the view cannot hide&lt;/li&gt;
&lt;li&gt;you need a long-lived compatibility contract instead of a short-lived rollout shim&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One subtle caveat: &lt;code&gt;SELECT *&lt;/code&gt; in a view captures the column list at view creation time. Fine for a short-lived rename shim. Another reason not to turn this into a permanent abstraction.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the rollout looked like
&lt;/h2&gt;

&lt;p&gt;In our case, the release did two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;archive and delete stale legacy rows&lt;/li&gt;
&lt;li&gt;rename the table and create the compatibility view&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first new pod applied the migration. Old pods kept serving traffic against &lt;code&gt;oidc_clients&lt;/code&gt;, which was now a view. New pods used &lt;code&gt;oidc_provider_clients&lt;/code&gt;. Kubernetes finished rolling the old pods out. Then we removed the shim in a later migration.&lt;/p&gt;

&lt;p&gt;No maintenance window.&lt;br&gt;
No dual-write phase.&lt;br&gt;
No dropped login traffic during the rollout.&lt;/p&gt;
&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;The rule I would reuse is simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If the only thing that changed is the table name, make the old name keep working until the rollout is over.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In PostgreSQL, the cheapest version of that rule is often:&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;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;old_name&lt;/span&gt; &lt;span class="k"&gt;RENAME&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;new_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;old_name&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;new_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is a small trick.&lt;/p&gt;

&lt;p&gt;It is also the kind of trick that turns a risky production rename into a boring deploy, which is the whole point.&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>database</category>
      <category>devops</category>
      <category>backend</category>
    </item>
    <item>
      <title>LLMs Are Probabilistic. Your Workflow Shouldn't Be.</title>
      <dc:creator>Mary Olowu</dc:creator>
      <pubDate>Wed, 20 May 2026 14:05:57 +0000</pubDate>
      <link>https://dev.to/restofstack/llms-are-probabilistic-your-workflow-shouldnt-be-hg</link>
      <guid>https://dev.to/restofstack/llms-are-probabilistic-your-workflow-shouldnt-be-hg</guid>
      <description>&lt;p&gt;Most AI app demos make the same mistake:&lt;/p&gt;

&lt;p&gt;they treat the model like the application.&lt;/p&gt;

&lt;p&gt;Prompt in, answer out, maybe a few tool calls, then everybody acts surprised when the thing becomes weird in production.&lt;/p&gt;

&lt;p&gt;The problem is not that the model is useless.&lt;/p&gt;

&lt;p&gt;The problem is that we keep asking a probabilistic component to behave like deterministic workflow code.&lt;/p&gt;

&lt;p&gt;That is the wrong boundary.&lt;/p&gt;

&lt;p&gt;The better pattern is simpler:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;let the model interpret&lt;/li&gt;
&lt;li&gt;let software validate&lt;/li&gt;
&lt;li&gt;let the workflow own state&lt;/li&gt;
&lt;li&gt;let high-risk actions require approval&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you remember nothing else, remember this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do not let the model own irreversible state transitions.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;p&gt;The reliability problem is not hypothetical anymore.&lt;/p&gt;

&lt;p&gt;Stanford HAI's 2026 AI Index reports that in a new accuracy benchmark, hallucination rates across 26 top models ranged from 22% to 94%. The same report says documented AI incidents rose from 233 in 2024 to 362 in 2025.&lt;/p&gt;

&lt;p&gt;And yet adoption keeps rising. In the 2026 AI Index economy chapter, 88% of surveyed organizations reported using AI in at least one business function in 2025, and 79% reported regular generative-AI use in at least one function.&lt;/p&gt;

&lt;p&gt;So yes, teams are shipping this stuff.&lt;/p&gt;

&lt;p&gt;But the same chapter also says scaled AI-agent use stayed in the single digits across nearly all business functions.&lt;/p&gt;

&lt;p&gt;That makes sense. People want the upside of LLMs without letting them quietly become the database, the rules engine, and the compliance department at the same time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Even the Model Vendors Are Telling You This
&lt;/h2&gt;

&lt;p&gt;Anthropic's "Building Effective Agents" says the most successful implementations they saw used simple, composable patterns, and draws a clear line between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;workflows, where LLMs and tools are orchestrated through predefined code paths&lt;/li&gt;
&lt;li&gt;agents, where models dynamically direct their own processes and tool usage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They also recommend starting with the simplest solution possible and only adding complexity when needed.&lt;/p&gt;

&lt;p&gt;OpenAI says something similar in a different way. In the Structured Outputs launch, they explicitly note that model behavior is inherently non-deterministic, and that better model performance alone still did not meet the reliability developers need for robust applications. Their answer was not "prompt harder." It was deterministic constrained decoding around model output.&lt;/p&gt;

&lt;p&gt;That is the pattern.&lt;/p&gt;

&lt;p&gt;Use the model where probability is acceptable.&lt;br&gt;
Use deterministic engineering where correctness has to be enforced.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Architectural Rule
&lt;/h2&gt;

&lt;p&gt;Here is the rule I trust:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLMs should propose actions. Software should decide whether those actions are allowed.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That means the model is great for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;intent extraction&lt;/li&gt;
&lt;li&gt;document understanding&lt;/li&gt;
&lt;li&gt;summarization&lt;/li&gt;
&lt;li&gt;classification&lt;/li&gt;
&lt;li&gt;drafting&lt;/li&gt;
&lt;li&gt;tool selection in bounded contexts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And it should usually not be the final authority for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;permissions&lt;/li&gt;
&lt;li&gt;pricing&lt;/li&gt;
&lt;li&gt;payment execution&lt;/li&gt;
&lt;li&gt;account state&lt;/li&gt;
&lt;li&gt;refunds&lt;/li&gt;
&lt;li&gt;contract interpretation&lt;/li&gt;
&lt;li&gt;compliance gates&lt;/li&gt;
&lt;li&gt;destructive writes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the model says "refund this order," that is not a refund. That is a recommendation.&lt;/p&gt;

&lt;p&gt;Your application should still check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;does the order exist?&lt;/li&gt;
&lt;li&gt;is it refundable?&lt;/li&gt;
&lt;li&gt;is the amount within policy?&lt;/li&gt;
&lt;li&gt;does the caller have permission?&lt;/li&gt;
&lt;li&gt;is there already a refund in flight?&lt;/li&gt;
&lt;li&gt;does this require human approval?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That logic belongs in code, not in hope.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Boring Architecture That Wins
&lt;/h2&gt;

&lt;p&gt;This is the stack I would trust in production.&lt;/p&gt;
&lt;h3&gt;
  
  
  1. LLM as interpreter
&lt;/h3&gt;

&lt;p&gt;The model turns unstructured input into a candidate action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"intent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"issue_refund"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"order_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ord_123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"reason"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"duplicate_charge"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;49.0&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Typed output contract
&lt;/h3&gt;

&lt;p&gt;Do not parse vibes. Parse a schema.&lt;/p&gt;

&lt;p&gt;OpenAI's Structured Outputs guide exists for a reason: even when model quality improves, you still need deterministic enforcement around output shape.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Deterministic validator
&lt;/h3&gt;

&lt;p&gt;Now your real application runs checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;schema validation&lt;/li&gt;
&lt;li&gt;authz&lt;/li&gt;
&lt;li&gt;business rules&lt;/li&gt;
&lt;li&gt;idempotency&lt;/li&gt;
&lt;li&gt;resource existence&lt;/li&gt;
&lt;li&gt;threshold checks&lt;/li&gt;
&lt;li&gt;rate limits&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Workflow engine or state machine
&lt;/h3&gt;

&lt;p&gt;The model does not own the state transition. Your workflow does.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;requested -&amp;gt; validated -&amp;gt; approved -&amp;gt; executed -&amp;gt; recorded
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If validation fails, the workflow branches. If approval is required, it pauses. If execution fails, it retries or dead-letters.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Scoped tools
&lt;/h3&gt;

&lt;p&gt;Tools should be narrow, explicit, and permissioned.&lt;/p&gt;

&lt;p&gt;OpenAI's practical guide to building agents recommends assessing tool risk based on things like write access, reversibility, and financial impact, then pausing or escalating to a human for high-risk functions.&lt;/p&gt;

&lt;p&gt;That is not compliance theater. That is basic architecture.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Tracing, logs, and evals
&lt;/h3&gt;

&lt;p&gt;If you cannot inspect which prompt, tool result, validation step, and branch decision led to an action, you are not debugging a system. You are guessing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Anti-Pattern
&lt;/h2&gt;

&lt;p&gt;Here is the version I do not trust:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User message goes straight to agent.&lt;/li&gt;
&lt;li&gt;Agent decides what the business rule probably is.&lt;/li&gt;
&lt;li&gt;Agent writes to the database.&lt;/li&gt;
&lt;li&gt;Agent sends the email.&lt;/li&gt;
&lt;li&gt;Agent updates the CRM.&lt;/li&gt;
&lt;li&gt;Everybody hopes the prompt was good enough.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This looks fast in a demo because all the complexity is hidden.&lt;/p&gt;

&lt;p&gt;It breaks in production because all the accountability is hidden too.&lt;/p&gt;

&lt;p&gt;When something goes wrong, you will not know whether the failure came from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;bad retrieval&lt;/li&gt;
&lt;li&gt;bad prompt assumptions&lt;/li&gt;
&lt;li&gt;stale tool data&lt;/li&gt;
&lt;li&gt;missing permission checks&lt;/li&gt;
&lt;li&gt;race conditions&lt;/li&gt;
&lt;li&gt;duplicate writes&lt;/li&gt;
&lt;li&gt;a plain old hallucination&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And worse, you may not know until after money moved or customers were contacted.&lt;/p&gt;

&lt;h2&gt;
  
  
  NIST Is Basically Handing You the Blueprint
&lt;/h2&gt;

&lt;p&gt;NIST's AI Risk Management Framework is not just policy paperwork. It is practical engineering guidance if you read it that way.&lt;/p&gt;

&lt;p&gt;Some of the most useful parts for builders:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;define and differentiate human and AI roles&lt;/li&gt;
&lt;li&gt;document knowledge limits and how outputs will be overseen&lt;/li&gt;
&lt;li&gt;test systems before deployment and regularly in production&lt;/li&gt;
&lt;li&gt;monitor functionality and behavior in production&lt;/li&gt;
&lt;li&gt;make sure systems can fail safely beyond their knowledge limits&lt;/li&gt;
&lt;li&gt;document risks, controls, and third-party dependencies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is just good software engineering with a better vocabulary.&lt;/p&gt;

&lt;p&gt;NIST's Generative AI Profile goes further and says generative AI may require additional human review, tracking, documentation, and management oversight.&lt;/p&gt;

&lt;p&gt;Which is exactly what experienced teams discover after the first few production incidents anyway.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Good Mental Model
&lt;/h2&gt;

&lt;p&gt;Think about the LLM as a perception layer, not a transaction layer.&lt;/p&gt;

&lt;p&gt;It helps you turn messy human input into structured candidates.&lt;/p&gt;

&lt;p&gt;It does not get to redefine the core invariants of your system.&lt;/p&gt;

&lt;p&gt;So instead of this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;model -&amp;gt; action
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Build this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;model -&amp;gt; proposal -&amp;gt; validation -&amp;gt; policy check -&amp;gt; approval (if needed) -&amp;gt; execution -&amp;gt; audit log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That extra machinery is not bureaucracy.&lt;/p&gt;

&lt;p&gt;It is the difference between an AI feature and an AI system you can trust.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Would Build First
&lt;/h2&gt;

&lt;p&gt;If I were building an AI workflow today, I would start in this order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;One narrow use case with real pain.&lt;/li&gt;
&lt;li&gt;One model call that returns typed output.&lt;/li&gt;
&lt;li&gt;One validator layer with explicit business rules.&lt;/li&gt;
&lt;li&gt;One small set of tools with clear permissions.&lt;/li&gt;
&lt;li&gt;One approval path for high-risk actions.&lt;/li&gt;
&lt;li&gt;One trace per run.&lt;/li&gt;
&lt;li&gt;One eval set based on real failures, not synthetic optimism.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Anthropic's guidance to start simple is right. OpenAI's guardrail guidance is right. The teams getting burned are usually the ones skipping the boring layers because the model looked good in staging.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Take
&lt;/h2&gt;

&lt;p&gt;AI does not remove the need for software architecture.&lt;/p&gt;

&lt;p&gt;It raises the price of getting architecture wrong.&lt;/p&gt;

&lt;p&gt;LLMs are powerful because they handle ambiguity well. They are dangerous when you let that ambiguity leak into the parts of your system that are supposed to be exact.&lt;/p&gt;

&lt;p&gt;So let the model read.&lt;br&gt;
Let the model classify.&lt;br&gt;
Let the model draft.&lt;br&gt;
Let the model suggest.&lt;/p&gt;

&lt;p&gt;But let deterministic systems own:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;truth&lt;/li&gt;
&lt;li&gt;policy&lt;/li&gt;
&lt;li&gt;permissions&lt;/li&gt;
&lt;li&gt;state transitions&lt;/li&gt;
&lt;li&gt;side effects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI makes mistakes.&lt;/p&gt;

&lt;p&gt;That is not a reason to avoid building with it.&lt;/p&gt;

&lt;p&gt;It is a reason to build the part around it like an engineer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Stanford HAI, 2026 AI Index, Responsible AI chapter: &lt;a href="https://hai.stanford.edu/ai-index/2026-ai-index-report/responsible-ai" rel="noopener noreferrer"&gt;https://hai.stanford.edu/ai-index/2026-ai-index-report/responsible-ai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Stanford HAI, 2026 AI Index, Economy chapter: &lt;a href="https://hai.stanford.edu/assets/files/ai_index_report_2026_chapter_4_economy.pdf" rel="noopener noreferrer"&gt;https://hai.stanford.edu/assets/files/ai_index_report_2026_chapter_4_economy.pdf&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Anthropic, "Building Effective Agents": &lt;a href="https://www.anthropic.com/engineering/building-effective-agents" rel="noopener noreferrer"&gt;https://www.anthropic.com/engineering/building-effective-agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;OpenAI, "Introducing Structured Outputs in the API": &lt;a href="https://openai.com/index/introducing-structured-outputs-in-the-api/" rel="noopener noreferrer"&gt;https://openai.com/index/introducing-structured-outputs-in-the-api/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;OpenAI, "A practical guide to building agents": &lt;a href="https://openai.com/business/guides-and-resources/a-practical-guide-to-building-ai-agents/" rel="noopener noreferrer"&gt;https://openai.com/business/guides-and-resources/a-practical-guide-to-building-ai-agents/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;NIST AI RMF Core: &lt;a href="https://airc.nist.gov/airmf-resources/airmf/5-sec-core/" rel="noopener noreferrer"&gt;https://airc.nist.gov/airmf-resources/airmf/5-sec-core/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;NIST Generative AI Profile (NIST-AI-600-1): &lt;a href="https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.600-1.pdf" rel="noopener noreferrer"&gt;https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.600-1.pdf&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>automation</category>
      <category>devops</category>
    </item>
    <item>
      <title>What an AI Agent's Memory Layer Actually Has to Store</title>
      <dc:creator>Mary Olowu</dc:creator>
      <pubDate>Mon, 18 May 2026 19:17:35 +0000</pubDate>
      <link>https://dev.to/restofstack/what-an-ai-agents-memory-layer-actually-has-to-store-3nml</link>
      <guid>https://dev.to/restofstack/what-an-ai-agents-memory-layer-actually-has-to-store-3nml</guid>
      <description>&lt;p&gt;AI agents do not usually break mature codebases because they cannot write code.&lt;/p&gt;

&lt;p&gt;They break them because they forget why the code is shaped the way it is.&lt;/p&gt;

&lt;p&gt;They forget the package boundary.&lt;br&gt;
They forget the feature shipped, but it is still flagged off.&lt;br&gt;
They forget we are only halfway through a multi-stage migration.&lt;br&gt;
They forget that one abstraction already caused problems once.&lt;/p&gt;

&lt;p&gt;Then a later session makes a locally reasonable change that is globally wrong.&lt;/p&gt;

&lt;p&gt;When people talk about AI memory, the conversation often drifts toward the same&lt;br&gt;
idea:&lt;/p&gt;

&lt;p&gt;give the agent more.&lt;/p&gt;

&lt;p&gt;More chat history.&lt;br&gt;
More docs.&lt;br&gt;
More logs.&lt;br&gt;
More old reasoning.&lt;/p&gt;

&lt;p&gt;That is why I am skeptical of the idea that better AI memory means storing more.&lt;/p&gt;

&lt;p&gt;If all of that just turns into a larger pile to drag from session to session,&lt;br&gt;
the memory layer becomes a junk drawer.&lt;/p&gt;

&lt;p&gt;The agent has "more context," but the work does not get more coherent.&lt;br&gt;
It just gets noisier.&lt;/p&gt;

&lt;p&gt;I think the goal is much narrower:&lt;/p&gt;

&lt;p&gt;an AI-assisted project needs to preserve the small set of durable facts that are&lt;br&gt;
load-bearing later.&lt;/p&gt;

&lt;p&gt;Not everything.&lt;br&gt;
Just the things that stop a later session from making a locally reasonable and&lt;br&gt;
globally wrong decision.&lt;/p&gt;

&lt;p&gt;Most project context is temporary.&lt;/p&gt;

&lt;p&gt;The exact wording of a prompt is temporary.&lt;br&gt;
The full output of a log search is temporary.&lt;br&gt;
The back-and-forth while exploring an implementation is temporary.&lt;br&gt;
The rough dead ends you hit during one session are mostly temporary too.&lt;/p&gt;

&lt;p&gt;What actually needs to survive is a much smaller set.&lt;/p&gt;

&lt;p&gt;For me, it looks something like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;decisions&lt;/li&gt;
&lt;li&gt;boundaries&lt;/li&gt;
&lt;li&gt;authoritative sources&lt;/li&gt;
&lt;li&gt;failure modes&lt;/li&gt;
&lt;li&gt;mandatory conventions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the real memory layer.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Decisions&lt;/code&gt; are the obvious one.&lt;/p&gt;

&lt;p&gt;Not "we discussed this once."&lt;/p&gt;

&lt;p&gt;I mean:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what was decided&lt;/li&gt;
&lt;li&gt;why it was decided&lt;/li&gt;
&lt;li&gt;whether it is still active&lt;/li&gt;
&lt;li&gt;what it replaced&lt;/li&gt;
&lt;li&gt;what is now off the table&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last part matters more than people admit.&lt;/p&gt;

&lt;p&gt;If a new decision supersedes an old one, the relationship has to be explicit.&lt;br&gt;
Otherwise every later session has to guess whether the old rule is still alive.&lt;/p&gt;

&lt;p&gt;A memory layer also has to store status.&lt;/p&gt;

&lt;p&gt;I hit this recently on a staged release.&lt;/p&gt;

&lt;p&gt;One release shipped the metrics and observer path for a future cutover, but the&lt;br&gt;
actual cutover was still dormant. The next step was not "start the future&lt;br&gt;
implementation." The next step was "watch the baseline for the agreed window,&lt;br&gt;
then decide."&lt;/p&gt;

&lt;p&gt;That is a very different kind of memory.&lt;/p&gt;

&lt;p&gt;The important fact was not just that code had shipped.&lt;/p&gt;

&lt;p&gt;It was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;this capability is live but still dormant&lt;/li&gt;
&lt;li&gt;the follow-up is intentionally blocked for now&lt;/li&gt;
&lt;li&gt;we are in the observation window&lt;/li&gt;
&lt;li&gt;the earlier decision has not been superseded yet&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without that state recorded somewhere durable, a later session can easily treat&lt;br&gt;
"the metrics shipped" as "the gate is cleared" and start nudging the project&lt;br&gt;
forward too early.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Boundaries&lt;/code&gt; are the next thing.&lt;/p&gt;

&lt;p&gt;This is where a lot of mature-repo drift starts.&lt;/p&gt;

&lt;p&gt;The code the agent writes can be perfectly competent and still be wrong because&lt;br&gt;
it landed in the wrong layer.&lt;/p&gt;

&lt;p&gt;The package that defines canonical query types should not quietly become the&lt;br&gt;
package that knows about one storage engine.&lt;br&gt;
The service that owns orchestration should not quietly absorb unrelated business&lt;br&gt;
logic just because the local edit looked convenient.&lt;/p&gt;

&lt;p&gt;A useful memory layer needs to preserve those boundaries in plain language:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what belongs here&lt;/li&gt;
&lt;li&gt;what does not belong here&lt;/li&gt;
&lt;li&gt;where the adjacent responsibility actually lives&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;Authoritative sources&lt;/code&gt; are another big one.&lt;/p&gt;

&lt;p&gt;Projects often have several places that mention the same thing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;code&lt;/li&gt;
&lt;li&gt;docs&lt;/li&gt;
&lt;li&gt;tickets&lt;/li&gt;
&lt;li&gt;release notes&lt;/li&gt;
&lt;li&gt;generated configs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the agent cannot tell which source actually owns a field, a state transition,&lt;br&gt;
or a behavior contract, it can make a change that looks harmless and still&lt;br&gt;
quietly violate the system.&lt;/p&gt;

&lt;p&gt;The project has to say, somewhere durable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;this path owns this behavior&lt;/li&gt;
&lt;li&gt;this service is authoritative for this record&lt;/li&gt;
&lt;li&gt;this generated file should not be hand-edited&lt;/li&gt;
&lt;li&gt;this contract is defined here, not inferred from nearby code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;Failure modes&lt;/code&gt; are the other kind of memory people under-capture.&lt;/p&gt;

&lt;p&gt;Some of the most valuable project knowledge is not "how it works."&lt;/p&gt;

&lt;p&gt;It is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what broke before&lt;/li&gt;
&lt;li&gt;which direction created drift&lt;/li&gt;
&lt;li&gt;which retry shape caused trouble&lt;/li&gt;
&lt;li&gt;which abstraction looked elegant and turned into a maintenance tax&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If that only lives in one old chat or in your head, the agent will keep&lt;br&gt;
rediscovering the same trap with total confidence.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Mandatory conventions&lt;/code&gt; matter too.&lt;/p&gt;

&lt;p&gt;Not every common pattern is a rule.&lt;br&gt;
Not every rule can be inferred from code.&lt;/p&gt;

&lt;p&gt;Some things really are optional style preferences.&lt;br&gt;
Some things are hard constraints.&lt;/p&gt;

&lt;p&gt;If the agent cannot tell the difference, it will treat both like vibes.&lt;/p&gt;

&lt;p&gt;A good memory layer should also encode when the agent must pause and ask for&lt;br&gt;
human review.&lt;/p&gt;

&lt;p&gt;Some decisions should not be made autonomously at all. Introducing a new Kafka&lt;br&gt;
consumer, creating a new RPC boundary, changing auth or billing behavior,&lt;br&gt;
removing backward compatibility, or adding a new queue or datastore are not&lt;br&gt;
just implementation details. They are moments where the project should require&lt;br&gt;
human judgment on purpose.&lt;/p&gt;

&lt;p&gt;That is why I think the useful memory question is not:&lt;/p&gt;

&lt;p&gt;"How do I make the agent remember more?"&lt;/p&gt;

&lt;p&gt;It is:&lt;/p&gt;

&lt;p&gt;"What absolutely has to survive a fresh session?"&lt;/p&gt;

&lt;p&gt;That is a much better filter.&lt;/p&gt;

&lt;p&gt;It also makes the "what not to store" side much clearer.&lt;/p&gt;

&lt;p&gt;A durable memory layer probably does not need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;every exploration path&lt;/li&gt;
&lt;li&gt;every copied stack trace&lt;/li&gt;
&lt;li&gt;every draft explanation&lt;/li&gt;
&lt;li&gt;every implementation detail from every task&lt;/li&gt;
&lt;li&gt;giant transcript dumps pretending to be knowledge&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those things belong in the window while you are working.&lt;br&gt;
They do not all belong in the store.&lt;/p&gt;

&lt;p&gt;This is why I keep coming back to one idea:&lt;/p&gt;

&lt;p&gt;memory without a schema is just a bigger transcript.&lt;/p&gt;

&lt;p&gt;And bigger transcripts rot.&lt;/p&gt;

&lt;p&gt;They get longer.&lt;br&gt;
They get noisier.&lt;br&gt;
They become expensive to reread.&lt;br&gt;
They make retrieval harder.&lt;br&gt;
They turn "remember this" into "search this pile and hope."&lt;/p&gt;

&lt;p&gt;Structured memory is less exciting to talk about.&lt;/p&gt;

&lt;p&gt;It is also much more useful.&lt;/p&gt;

&lt;p&gt;A small, boring memory layer with decisions, boundaries, ownership, and failure&lt;br&gt;
modes will usually beat a richer but sloppier pile of context.&lt;/p&gt;

&lt;p&gt;That does not have to mean some grand new platform.&lt;/p&gt;

&lt;p&gt;It could be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a few markdown files&lt;/li&gt;
&lt;li&gt;a strict JSON ledger&lt;/li&gt;
&lt;li&gt;a tiny SQLite table&lt;/li&gt;
&lt;li&gt;a set of durable docs with clear update rules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The implementation matters less than the shape.&lt;/p&gt;

&lt;p&gt;The shape is the point.&lt;/p&gt;

&lt;p&gt;And it should not grow forever without judgment.&lt;/p&gt;

&lt;p&gt;Some memory stops being useful because the project has moved on.&lt;/p&gt;

&lt;p&gt;A boundary gets replaced.&lt;br&gt;
A migration completes.&lt;br&gt;
A temporary constraint expires.&lt;br&gt;
A failure mode gets designed out.&lt;/p&gt;

&lt;p&gt;If those records stay mixed in with the live ones forever, the memory layer&lt;br&gt;
slowly turns back into the same clutter problem it was supposed to fix.&lt;/p&gt;

&lt;p&gt;So part of a healthy memory layer is occasional pruning.&lt;/p&gt;

&lt;p&gt;Not deleting history recklessly.&lt;/p&gt;

&lt;p&gt;I mean deliberately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;archiving records that are no longer active&lt;/li&gt;
&lt;li&gt;marking superseded decisions clearly&lt;/li&gt;
&lt;li&gt;removing stale task-local notes from durable memory&lt;/li&gt;
&lt;li&gt;keeping the live memory surface small enough to stay high-signal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That matters for quality and for cost.&lt;/p&gt;

&lt;p&gt;A smaller, cleaner memory layer is easier to query, easier to trust, and easier&lt;br&gt;
to carry forward across sessions.&lt;/p&gt;

&lt;p&gt;If your AI sessions keep feeling like first contact, I do not think the answer&lt;br&gt;
is automatically more memory.&lt;/p&gt;

&lt;p&gt;It may just be better memory.&lt;/p&gt;

&lt;p&gt;What is the smallest set of durable records that would stop your project from&lt;br&gt;
forgetting itself between sessions?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>architecture</category>
      <category>discuss</category>
    </item>
    <item>
      <title>AI Can Write the Code. It Still Forgets the Decisions That Matter.</title>
      <dc:creator>Mary Olowu</dc:creator>
      <pubDate>Thu, 14 May 2026 18:20:17 +0000</pubDate>
      <link>https://dev.to/restofstack/ai-can-write-the-code-it-still-forgets-the-decisions-that-matter-20b8</link>
      <guid>https://dev.to/restofstack/ai-can-write-the-code-it-still-forgets-the-decisions-that-matter-20b8</guid>
      <description>&lt;p&gt;A lot of AI coding advice quietly assumes the same thing:&lt;/p&gt;

&lt;p&gt;if the output is bad, you probably need a better model, a better prompt, or more tooling.&lt;/p&gt;

&lt;p&gt;Sometimes that is true.&lt;/p&gt;

&lt;p&gt;But one AI coding failure keeps showing up for me, and I do not think a better model is the real fix.&lt;/p&gt;

&lt;p&gt;In one session, we make a decision that is supposed to guide the rest of the project.&lt;/p&gt;

&lt;p&gt;Then in a later session, the model answers that same question differently and starts nudging the project down another path.&lt;/p&gt;

&lt;p&gt;Usually it is more subtle than "the code is wrong."&lt;/p&gt;

&lt;p&gt;We already decided that deprecated paths stay backward compatible for a reason, that receivers fan out to downstream consumers instead of owning business logic inline, and that idempotency gets enforced before side effects fire. Then a later session solves the local task as if those decisions were optional because it only sees the immediate diff.&lt;/p&gt;

&lt;p&gt;Nothing is obviously broken right away.&lt;/p&gt;

&lt;p&gt;The code still looks competent.&lt;br&gt;
It still compiles.&lt;br&gt;
It still sounds reasonable.&lt;/p&gt;

&lt;p&gt;But the project starts to feel scattered.&lt;/p&gt;

&lt;p&gt;It no longer feels like one person with memory has been carrying the work forward.&lt;/p&gt;

&lt;p&gt;That changed how I think about AI coding.&lt;/p&gt;

&lt;p&gt;On an ongoing project, the bigger issue is often not generation quality. It is continuity.&lt;/p&gt;

&lt;p&gt;The model does not know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which decision had already been made&lt;/li&gt;
&lt;li&gt;which tradeoff we had already accepted&lt;/li&gt;
&lt;li&gt;which docs were still authoritative&lt;/li&gt;
&lt;li&gt;what had changed recently&lt;/li&gt;
&lt;li&gt;what should not be changed again&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is not really an intelligence problem.&lt;/p&gt;

&lt;p&gt;It is a memory problem.&lt;/p&gt;

&lt;p&gt;I feel this most on a solo-dev monorepo, where I am not just using AI for one-off code generation. I am also using it for backlog triage, bug capture, planning, reports, and picking work back up across sessions.&lt;/p&gt;

&lt;p&gt;The frustrating part is not that the model cannot code.&lt;/p&gt;

&lt;p&gt;It is that it can code while waking up without durable context.&lt;/p&gt;

&lt;p&gt;Sometimes the missing memory is shallow and local.&lt;/p&gt;

&lt;p&gt;A simple rule in the codebase or in &lt;code&gt;CLAUDE.md&lt;/code&gt; helps a lot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;follow the existing conventions&lt;/li&gt;
&lt;li&gt;match the existing code patterns&lt;/li&gt;
&lt;li&gt;use FIFO here, not LIFO&lt;/li&gt;
&lt;li&gt;do not add a second library when the current one already covers the job&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That kind of memory is useful and surprisingly high leverage.&lt;/p&gt;

&lt;p&gt;But the harder problem is when the missing memory is much deeper than code style.&lt;/p&gt;

&lt;p&gt;It is about remembering why the project should not go a certain direction again.&lt;/p&gt;

&lt;p&gt;Things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;deprecated behavior stays backward compatible until the migration path is actually complete&lt;/li&gt;
&lt;li&gt;receivers fan out work instead of embedding downstream business logic directly&lt;/li&gt;
&lt;li&gt;idempotency has to happen before side effects, not after them&lt;/li&gt;
&lt;li&gt;this webhook should update the existing record, not create a second one&lt;/li&gt;
&lt;li&gt;this state transition only happens after this other condition is true&lt;/li&gt;
&lt;li&gt;duplicate events should be absorbed here, not after side effects have already fired&lt;/li&gt;
&lt;li&gt;this source is authoritative for this field, so do not let another path quietly overwrite it&lt;/li&gt;
&lt;li&gt;this module already has a helper for this logic, so do not bypass it and create a second path&lt;/li&gt;
&lt;li&gt;do not bring in a new dependency to solve a problem the existing stack already solves&lt;/li&gt;
&lt;li&gt;do not create a retry flow that can turn into an infinite loop&lt;/li&gt;
&lt;li&gt;do not quietly undo an earlier system decision because the current session cannot see its history&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those decisions are usually load-bearing.&lt;/p&gt;

&lt;p&gt;They were made for a reason.&lt;/p&gt;

&lt;p&gt;Forgetting why they exist is a bit like forgetting why a house has support pillars in the frame. Once the reason disappears, the pillar starts to look optional. Then removing it or building around it the wrong way starts to feel harmless, right up until the cost shows up somewhere else.&lt;/p&gt;

&lt;p&gt;This is where AI-written code starts to feel different from human-guided code.&lt;/p&gt;

&lt;p&gt;A person with memory usually carries more invisible continuity into the work.&lt;/p&gt;

&lt;p&gt;They remember:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;why the earlier choice was made&lt;/li&gt;
&lt;li&gt;what problem we were trying to avoid&lt;/li&gt;
&lt;li&gt;which convention is mandatory versus just common&lt;/li&gt;
&lt;li&gt;which "reasonable" branch is actually the wrong one for this project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without that continuity, AI can produce code that looks fine in isolation while introducing costly mistakes into the project over time.&lt;/p&gt;

&lt;p&gt;If the model keeps re-litigating the same decision, reopening the same tradeoff, or proposing work that was already decided against, the problem is not just generation quality. The system has no reliable memory layer.&lt;/p&gt;

&lt;p&gt;That is why I have become much more interested in boring project context than in prompt tricks.&lt;/p&gt;

&lt;p&gt;What helped me was giving AI a few stable places to look:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;short repo guardrails&lt;/li&gt;
&lt;li&gt;maintainers docs for durable context&lt;/li&gt;
&lt;li&gt;lightweight local memory for session continuity&lt;/li&gt;
&lt;li&gt;real systems of record for backlog and releases&lt;/li&gt;
&lt;li&gt;explicit notes about patterns to keep following and failure modes to avoid&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of that is glamorous.&lt;/p&gt;

&lt;p&gt;It is also what made the biggest difference.&lt;/p&gt;

&lt;p&gt;Once I had that structure, the sessions stopped feeling like first contact every time.&lt;/p&gt;

&lt;p&gt;The model still made mistakes. It still needed review. It still needed boundaries.&lt;/p&gt;

&lt;p&gt;But the failures got more honest.&lt;/p&gt;

&lt;p&gt;Instead of "the AI is useless," the problem became easier to diagnose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the memory is stale&lt;/li&gt;
&lt;li&gt;the docs are weak&lt;/li&gt;
&lt;li&gt;the workflow has no source of truth&lt;/li&gt;
&lt;li&gt;the instructions are doing the job that documentation should be doing&lt;/li&gt;
&lt;li&gt;a deeper architectural rule is being treated like a surface-level style preference&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is a much better problem to have because you can actually fix it.&lt;/p&gt;

&lt;p&gt;I think a lot of AI coding frustration is really project-memory failure wearing a model-shaped mask.&lt;/p&gt;

&lt;p&gt;People keep trying to solve it with one more model upgrade or one more agent when the actual missing piece is memory that survives the chat window.&lt;/p&gt;

&lt;p&gt;That does not mean model quality is irrelevant.&lt;/p&gt;

&lt;p&gt;It means there is a ceiling on how useful any model can be if the project keeps forgetting its own load-bearing decisions.&lt;/p&gt;

&lt;p&gt;The shift for me was simple:&lt;/p&gt;

&lt;p&gt;I stopped asking, "How do I make the model smarter?"&lt;/p&gt;

&lt;p&gt;I started asking, "How do I stop a later session from quietly taking the project in a different direction?"&lt;/p&gt;

&lt;p&gt;The future of AI coding is not just better generation.&lt;/p&gt;

&lt;p&gt;It is better memory around the decisions that hold the work up.&lt;/p&gt;

&lt;p&gt;What breaks AI coding more often in your projects: weak generation, or weak continuity?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
      <category>discuss</category>
    </item>
    <item>
      <title>I Stopped Using Claude Code as a Giant Prompt and Started Using It as Project Ops</title>
      <dc:creator>Mary Olowu</dc:creator>
      <pubDate>Wed, 13 May 2026 03:54:37 +0000</pubDate>
      <link>https://dev.to/restofstack/i-stopped-using-claude-code-as-a-giant-prompt-and-started-using-it-as-project-ops-ec9</link>
      <guid>https://dev.to/restofstack/i-stopped-using-claude-code-as-a-giant-prompt-and-started-using-it-as-project-ops-ec9</guid>
      <description>&lt;p&gt;If you use Claude Code on a real project for more than one-off coding tasks, you eventually hit the same wall:&lt;/p&gt;

&lt;p&gt;the model is good at solving the task in front of it, but every new session still has to reconstruct the project.&lt;/p&gt;

&lt;p&gt;For me, that got especially annoying in a solo-dev monorepo. I was not just asking Claude to write code. I was also using it for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;backlog triage&lt;/li&gt;
&lt;li&gt;bug capture&lt;/li&gt;
&lt;li&gt;planning the next task&lt;/li&gt;
&lt;li&gt;weekly status summaries&lt;/li&gt;
&lt;li&gt;preserving decisions across sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At some point I realized I was trying to solve a workflow problem with a better prompt.&lt;/p&gt;

&lt;p&gt;That was the wrong move.&lt;/p&gt;

&lt;p&gt;What helped was building a thin project-ops layer around Claude Code instead.&lt;/p&gt;

&lt;p&gt;My current version uses Jira MCP for backlog work, Confluence for published reports, a local JSON context DB for working memory, maintainer docs for durable context, and a few commands like &lt;code&gt;/standup&lt;/code&gt;, &lt;code&gt;/bug&lt;/code&gt;, and &lt;code&gt;/rfe&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then I pulled the reusable parts into a public starter repo without shipping the private project details around them.&lt;/p&gt;

&lt;p&gt;The repo is here: &lt;a href="https://github.com/restofstack/claude-project-ops-starter" rel="noopener noreferrer"&gt;restofstack/claude-project-ops-starter&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;The useful part of my setup is not one giant prompt.&lt;/p&gt;

&lt;p&gt;It is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;a short &lt;code&gt;CLAUDE.md&lt;/code&gt; for guardrails&lt;/li&gt;
&lt;li&gt;a &lt;code&gt;docs/maintainers/&lt;/code&gt; folder for durable project context&lt;/li&gt;
&lt;li&gt;a tiny local JSON file for rolling memory&lt;/li&gt;
&lt;li&gt;real systems of record for backlog, PRs, and releases&lt;/li&gt;
&lt;li&gt;reusable commands for common project-ops tasks&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is the pattern I extracted into a public starter repo.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem With Default AI Usage on Ongoing Projects
&lt;/h2&gt;

&lt;p&gt;The default interaction pattern looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;open Claude Code&lt;/li&gt;
&lt;li&gt;paste context&lt;/li&gt;
&lt;li&gt;explain the task&lt;/li&gt;
&lt;li&gt;repeat tomorrow&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is fine for isolated implementation work.&lt;/p&gt;

&lt;p&gt;It breaks down when each session has to renegotiate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what matters in the repo&lt;/li&gt;
&lt;li&gt;where architecture context lives&lt;/li&gt;
&lt;li&gt;what work is already in progress&lt;/li&gt;
&lt;li&gt;which tools are authoritative&lt;/li&gt;
&lt;li&gt;how status should be reported&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once a project is large enough, "just paste more context" stops being a serious strategy.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Structure I Ended Up With
&lt;/h2&gt;

&lt;p&gt;This is the rough shape:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CLAUDE.md
docs/
  maintainers/
    README.md
    overview/
    development/
.workspace-temp/
  context-db.json
.claude/
  commands/
    standup.md
    bug.md
    rfe.md
    reflect.md
    weekly-report.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each part has a different job.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;code&gt;CLAUDE.md&lt;/code&gt; Is for Rules, Not Everything
&lt;/h2&gt;

&lt;p&gt;I keep &lt;code&gt;CLAUDE.md&lt;/code&gt; short and boring on purpose.&lt;/p&gt;

&lt;p&gt;It only contains the repo-level rules that should apply in every session, things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;prefer the existing system of record over invented state&lt;/li&gt;
&lt;li&gt;finish work in progress before proposing new work&lt;/li&gt;
&lt;li&gt;never fabricate backlog items or counts&lt;/li&gt;
&lt;li&gt;keep outputs concise and actionable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That file is not where I put architecture notes, runbooks, or a giant project brain dump.&lt;/p&gt;

&lt;p&gt;If you overload it, both you and the model stop trusting it.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. &lt;code&gt;docs/maintainers/&lt;/code&gt; Holds the Durable Context
&lt;/h2&gt;

&lt;p&gt;Anything that should survive beyond a session goes into maintainers docs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;system overviews&lt;/li&gt;
&lt;li&gt;service boundaries&lt;/li&gt;
&lt;li&gt;local development notes&lt;/li&gt;
&lt;li&gt;runbooks&lt;/li&gt;
&lt;li&gt;release notes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This gives Claude a clean place to start, and it has a side benefit: the docs also become useful to humans.&lt;/p&gt;

&lt;p&gt;That matters more than it sounds. If a doc is good enough for future-you, it is usually better context for AI too.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Local JSON Memory Is Good Enough
&lt;/h2&gt;

&lt;p&gt;I use a small local JSON file for rolling working memory.&lt;/p&gt;

&lt;p&gt;Not a service. Not a database product. Just a file.&lt;/p&gt;

&lt;p&gt;It stores a few useful things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what shipped recently&lt;/li&gt;
&lt;li&gt;branch or PR context&lt;/li&gt;
&lt;li&gt;decisions worth remembering&lt;/li&gt;
&lt;li&gt;estimate patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This has been the right level of complexity for solo work because it is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cheap&lt;/li&gt;
&lt;li&gt;easy to inspect&lt;/li&gt;
&lt;li&gt;easy to edit&lt;/li&gt;
&lt;li&gt;easy to replace later&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also use a &lt;code&gt;/reflect&lt;/code&gt; command to append small memory items instead of trying to manually maintain that file all the time.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Real Systems of Record Stay Real
&lt;/h2&gt;

&lt;p&gt;Claude should not become your shadow Jira, shadow GitHub, or shadow release tracker.&lt;/p&gt;

&lt;p&gt;The actual source of truth should stay in the actual system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Jira, GitHub Issues, Linear, or whatever you use for backlog&lt;/li&gt;
&lt;li&gt;PR system&lt;/li&gt;
&lt;li&gt;release history&lt;/li&gt;
&lt;li&gt;docs or wiki&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The AI should read from those systems and synthesize useful outputs. It should not replace them.&lt;/p&gt;

&lt;p&gt;That boundary is what keeps the workflow practical instead of magical-and-fragile.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Commands Were the Biggest UX Upgrade
&lt;/h2&gt;

&lt;p&gt;The structure matters, but the commands are what made the whole thing usable day to day.&lt;/p&gt;

&lt;p&gt;I extracted the workflows I kept repeating:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/standup&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/bug&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/rfe&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/reflect&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/weekly-report&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And when I cleaned the setup for a public starter, a few surrounding workflows became part of the picture too: &lt;code&gt;/checkpoint&lt;/code&gt;, &lt;code&gt;/sanitize&lt;/code&gt;, &lt;code&gt;/docs-sync&lt;/code&gt;, &lt;code&gt;/release-notes&lt;/code&gt;, and &lt;code&gt;/root-cause&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Each one has a defined job.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/standup&lt;/code&gt; checks memory, git state, PR state, backlog state, and maintainers docs, then recommends the next actions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/bug&lt;/code&gt; captures a clean bug report without turning it into a full debugging session&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/weekly-report&lt;/code&gt; turns project signals into a durable report instead of a one-off chat response&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That consistency removed a lot of prompt thrash.&lt;/p&gt;

&lt;p&gt;Without commands, every request is basically a blank page. With commands, the common project tasks have defaults.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where This Fits Relative to Spec Kit
&lt;/h2&gt;

&lt;p&gt;I still use Spec Kit, and I do not think this starter replaces it.&lt;/p&gt;

&lt;p&gt;Spec Kit is useful when I want to take one feature or product change and push it toward a clearer spec and implementation path.&lt;/p&gt;

&lt;p&gt;This starter handles a different layer: working memory, maintainer docs, standups, bug and RFE capture, reports, handoff, and the repeatable repo workflows that help Claude pick up the thread again tomorrow.&lt;/p&gt;

&lt;p&gt;So for me this fills a different gap than Spec Kit or other Claude "superpowers" style workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Was Especially Useful in a Monorepo
&lt;/h2&gt;

&lt;p&gt;Monorepos create a context problem fast.&lt;/p&gt;

&lt;p&gt;Even as a solo developer, I still need a reliable way to answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what changed recently?&lt;/li&gt;
&lt;li&gt;what is in progress?&lt;/li&gt;
&lt;li&gt;what got forgotten?&lt;/li&gt;
&lt;li&gt;what should be picked up next?&lt;/li&gt;
&lt;li&gt;what decisions should persist beyond this session?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I did not want to build a custom agent platform to solve that.&lt;/p&gt;

&lt;p&gt;I also did not want to keep improvising.&lt;/p&gt;

&lt;p&gt;This setup gave me a middle path.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Portable Part
&lt;/h2&gt;

&lt;p&gt;The original version of this workflow was tied pretty closely to my own stack.&lt;/p&gt;

&lt;p&gt;The part worth sharing was the pattern, not the exact tools.&lt;/p&gt;

&lt;p&gt;It also needed a cleanup pass before it was publishable. A real working setup usually contains things you should not ship as-is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;local Claude settings&lt;/li&gt;
&lt;li&gt;project-specific IDs and URLs&lt;/li&gt;
&lt;li&gt;live working memory files&lt;/li&gt;
&lt;li&gt;internal naming conventions&lt;/li&gt;
&lt;li&gt;backlog details that only make sense inside the project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is why I split the starter into adapters like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Jira + Confluence&lt;/li&gt;
&lt;li&gt;GitHub Issues + repo docs&lt;/li&gt;
&lt;li&gt;local JSON + markdown only&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So if your stack is different, you can still keep the same model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stable guardrails&lt;/li&gt;
&lt;li&gt;durable docs&lt;/li&gt;
&lt;li&gt;lightweight memory&lt;/li&gt;
&lt;li&gt;real systems of record&lt;/li&gt;
&lt;li&gt;repeatable workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That was the real extraction goal: publish the useful workflows, not the private residue of my specific project.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Would Recommend If You Try This
&lt;/h2&gt;

&lt;p&gt;If you want to copy the idea, I would start with this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Keep &lt;code&gt;CLAUDE.md&lt;/code&gt; short.&lt;/li&gt;
&lt;li&gt;Move durable project context into maintainers docs.&lt;/li&gt;
&lt;li&gt;Use a tiny local memory file before building anything fancier.&lt;/li&gt;
&lt;li&gt;Pick 3-5 workflows you repeat all the time and formalize them.&lt;/li&gt;
&lt;li&gt;Keep the real backlog and release data in the systems you already trust.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is enough to get most of the value.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;The useful change was not "add more prompt."&lt;/p&gt;

&lt;p&gt;It was "design better interfaces for the model."&lt;/p&gt;

&lt;p&gt;That is what made Claude Code feel less like a clever autocomplete session and more like a practical project-ops layer for an ongoing codebase.&lt;/p&gt;

&lt;p&gt;If you are already using AI on a real repo, that is where I think the leverage is.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>monorepo</category>
      <category>devtools</category>
    </item>
    <item>
      <title>Ingest Webhooks From Any Provider — GitHub as the Example</title>
      <dc:creator>Mary Olowu</dc:creator>
      <pubDate>Sun, 10 May 2026 04:54:21 +0000</pubDate>
      <link>https://dev.to/restofstack/ingest-webhooks-from-any-provider-github-as-the-example-hj2</link>
      <guid>https://dev.to/restofstack/ingest-webhooks-from-any-provider-github-as-the-example-hj2</guid>
      <description>&lt;p&gt;Centrali can store webhook events from any provider that sends HTTP POST requests. The signature settings are configurable per trigger, so each provider gets its own verification rules — Stripe, GitHub, Shopify, Twilio, or anything else.&lt;/p&gt;

&lt;p&gt;This walkthrough uses GitHub as the example: one function, one trigger, signature verification, permanent storage. The same pattern works for any provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  How GitHub Webhook Signatures Work
&lt;/h2&gt;

&lt;p&gt;GitHub signs every webhook delivery with HMAC-SHA256. The signature arrives in the &lt;code&gt;x-hub-signature-256&lt;/code&gt; header, prefixed with &lt;code&gt;sha256=&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x-hub-signature-256: sha256=d57c68ca6f92289e6987922ff26938930f6e66a2d161ef06abdf1859230aa23c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is different from Stripe's compound header (&lt;code&gt;t=...,v1=...&lt;/code&gt;), which is why signature settings are per-trigger rather than a global config. Every provider has its own format.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Write the Store Function
&lt;/h2&gt;

&lt;p&gt;In the Centrali console, go to &lt;strong&gt;Logic &amp;gt; Functions&lt;/strong&gt; and create a new function called &lt;code&gt;Store GitHub Event&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftm9j3e0pwys23nxukm6s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftm9j3e0pwys23nxukm6s.png" alt="Function editor with Store GitHub Event code" width="800" height="454"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;executionParams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;executionParams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;eventType&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;x-github-event&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;unknown&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;deliveryId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;x-github-delivery&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;record&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createRecord&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;github-events&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;eventType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;eventType&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;deliveryId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;deliveryId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;login&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;repository&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;full_name&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Event stored&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;eventType&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;repository&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;full_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;recordId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;success&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;recordId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few things to note:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;executionParams.payload&lt;/code&gt;&lt;/strong&gt; is the raw HTTP body GitHub sends. For HTTP triggers, this is the full POST body — no wrapping.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;executionParams.headers&lt;/code&gt;&lt;/strong&gt; gives you the request headers. GitHub puts the event type in &lt;code&gt;x-github-event&lt;/code&gt; and a unique delivery ID in &lt;code&gt;x-github-delivery&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The function flattens key fields (&lt;code&gt;eventType&lt;/code&gt;, &lt;code&gt;sender&lt;/code&gt;, &lt;code&gt;repo&lt;/code&gt;, &lt;code&gt;action&lt;/code&gt;) to the top level for easy filtering and keeps the full payload in &lt;code&gt;raw&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before running this, create a &lt;strong&gt;schemaless&lt;/strong&gt; collection called &lt;code&gt;github-events&lt;/code&gt;. Schemaless mode accepts any shape — a &lt;code&gt;push&lt;/code&gt; event looks nothing like an &lt;code&gt;issues&lt;/code&gt; event.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Want to follow along? &lt;a href="https://centrali.io/signup?utm_source=blog&amp;amp;utm_medium=content&amp;amp;utm_campaign=ingest-github-webhooks" rel="noopener noreferrer"&gt;Create a free workspace&lt;/a&gt; — this takes less than 5 minutes, no deployment required.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 2: Create the HTTP Trigger
&lt;/h2&gt;

&lt;p&gt;Go to &lt;strong&gt;Logic &amp;gt; Triggers&lt;/strong&gt; and create a new trigger.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffztz8z3kkfv4ykuf4ndq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffztz8z3kkfv4ykuf4ndq.png" alt="Trigger detail showing HTTP trigger URL and signature verification enabled" width="800" height="537"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;github-webhook&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Function&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Store GitHub Event&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Type&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HTTP Trigger&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Path&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;github&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This gives you a public webhook URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://api.centrali.io/data/workspace/{your-workspace}/api/v1/http-trigger/github
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Configure Signature Verification
&lt;/h3&gt;

&lt;p&gt;GitHub uses a simpler signature format than Stripe — no compound header, no timestamp. Toggle &lt;strong&gt;Validate Signature&lt;/strong&gt; on and configure:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpcr6lls0dlnnvj12qfj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpcr6lls0dlnnvj12qfj.png" alt="Signature configuration with x-hub-signature-256 header and sha256 extraction" width="800" height="530"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Validate Signature&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;On&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Signing Secret&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Your GitHub webhook secret (you'll set this in GitHub too)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Signature Header Name&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;x-hub-signature-256&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Expand &lt;strong&gt;Advanced Signature Settings&lt;/strong&gt; to see the extraction defaults:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F292mj81q0xf9ofokpk4s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F292mj81q0xf9ofokpk4s.png" alt="Advanced signature settings showing sha256 algorithm, hex encoding, and extraction regex" width="800" height="759"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;HMAC Algorithm&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sha256&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Digest Encoding&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;hex&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Signature Extraction Regex&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sha256=(.+)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Secret Encoding&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;raw (default)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The extraction regex &lt;code&gt;sha256=(.+)&lt;/code&gt; strips the &lt;code&gt;sha256=&lt;/code&gt; prefix from GitHub's header value, leaving just the HMAC digest for verification.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; GitHub doesn't include a timestamp in the signature header, so there's no replay protection timestamp to configure. If you need replay protection, you can enable it separately — Centrali will track delivery IDs and reject duplicates.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 3: Configure the Webhook in GitHub
&lt;/h2&gt;

&lt;p&gt;Open your repository on GitHub. Go to &lt;strong&gt;Settings &amp;gt; Webhooks &amp;gt; Add webhook&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3zgxs93qecb1l37pq2c6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3zgxs93qecb1l37pq2c6.png" alt="GitHub webhook settings page with Centrali URL and JSON content type" width="800" height="611"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Payload URL&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Your Centrali HTTP trigger URL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Content type&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;application/json&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Secret&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The same secret you entered in the Centrali trigger&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Events&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Choose which events to receive&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Click &lt;strong&gt;Add webhook&lt;/strong&gt;. GitHub sends a &lt;code&gt;ping&lt;/code&gt; event immediately to verify the endpoint is reachable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: See Your Data
&lt;/h2&gt;

&lt;p&gt;Push a commit, open a pull request, or create an issue — any event you subscribed to. Then open the &lt;code&gt;github-events&lt;/code&gt; collection in the Centrali console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xxno2f8eyogfdi7s6d5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xxno2f8eyogfdi7s6d5.png" alt="Collection view showing stored GitHub events with eventType, sender, and repo columns" width="800" height="235"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click into any record to see the flattened fields and the full raw payload:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frk7cms5dd3kjuqgdt70u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frk7cms5dd3kjuqgdt70u.png" alt="Record detail showing push event with sender, repo, and raw JSON payload" width="800" height="856"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Toggle &lt;strong&gt;JSON editor&lt;/strong&gt; to see the complete payload GitHub delivered:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsszsd601rs6nagk3mfjc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsszsd601rs6nagk3mfjc.png" alt="JSON editor view showing the full GitHub webhook payload" width="800" height="736"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can verify the delivery on GitHub's side too. Go to your webhook settings and click &lt;strong&gt;Recent Deliveries&lt;/strong&gt; — you'll see the response status and headers:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcgftu0kt7befqud8y9yv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcgftu0kt7befqud8y9yv.png" alt="GitHub recent deliveries showing successful 202 response from Centrali" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; After your first events arrive, run &lt;strong&gt;Schema Discovery&lt;/strong&gt; on the &lt;code&gt;github-events&lt;/code&gt; collection to turn the auto-detected fields into filterable, sortable columns.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Pattern Works for Any Provider
&lt;/h2&gt;

&lt;p&gt;The function + trigger pattern is the same regardless of the provider. The only things that change are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Signature Header&lt;/th&gt;
&lt;th&gt;Extraction Regex&lt;/th&gt;
&lt;th&gt;Secret Format&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Stripe&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;stripe-signature&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;v1=([^,]+)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;whsec_...&lt;/code&gt; (raw)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GitHub&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;x-hub-signature-256&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sha256=(.+)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Any string (raw)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Shopify&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;x-shopify-hmac-sha256&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;(entire header)&lt;/td&gt;
&lt;td&gt;API secret (base64)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Twilio&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;Uses URL-based auth&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For providers that don't sign webhooks at all, just leave signature verification off. The function and collection work the same way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Query Programmatically
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;CentraliSDK&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@centrali-io/centrali-sdk&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;CentraliSDK&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;workspaceId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your-workspace&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;clientId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CENTRALI_CLIENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;clientSecret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CENTRALI_CLIENT_SECRET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// All push events&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pushes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;queryRecords&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;github-events&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data.eventType&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;push&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Events from a specific repo&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;repoEvents&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;queryRecords&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;github-events&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data.repo&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your-org/your-repo&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Pull request events from a specific user&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userPRs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;queryRecords&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;github-events&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data.eventType&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pull_request&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data.sender&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;octocat&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://centrali.io/blog/stripe-webhook-handler" rel="noopener noreferrer"&gt;Store Stripe Webhook Events and Query Them Forever&lt;/a&gt;&lt;/strong&gt; — the original walkthrough, if you want to add Stripe alongside GitHub&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://centrali.io/blog/alert-stripe-charge-failures" rel="noopener noreferrer"&gt;Get Alerted When a Stripe Charge Fails&lt;/a&gt;&lt;/strong&gt; — add real-time alerting on top of stored events&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://centrali.io/blog/query-stripe-webhook-events-like-a-database" rel="noopener noreferrer"&gt;Query Stripe Webhook Events Like a Database&lt;/a&gt;&lt;/strong&gt; — advanced querying patterns that work with any collection&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://centrali.io/blog/schema-discovery-guide" rel="noopener noreferrer"&gt;Your Webhook Data Is Schemaless — Here's How to Give It Structure&lt;/a&gt;&lt;/strong&gt; — turn raw webhook JSON into typed, validated properties&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://centrali.io/signup?utm_source=blog&amp;amp;utm_medium=content&amp;amp;utm_campaign=ingest-github-webhooks" rel="noopener noreferrer"&gt;Start building your own webhook pipeline&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>webdev</category>
      <category>webhooks</category>
      <category>saas</category>
    </item>
    <item>
      <title>Add Webhooks to Your SaaS in 10 Minutes (Without Queues or Retries)</title>
      <dc:creator>Mary Olowu</dc:creator>
      <pubDate>Mon, 04 May 2026 18:50:28 +0000</pubDate>
      <link>https://dev.to/restofstack/add-webhooks-to-your-saas-in-10-minutes-without-queues-or-retries-4e5c</link>
      <guid>https://dev.to/restofstack/add-webhooks-to-your-saas-in-10-minutes-without-queues-or-retries-4e5c</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — One API call subscribes a customer endpoint. Centrali signs each delivery with HMAC-SHA256, retries 5 times over ~40 minutes on failure, logs every attempt, and exposes a one-line replay endpoint. No queue. No retry logic. No Svix. The whole subscribe call is right below — scroll to it if you just want the shape.&lt;/p&gt;




&lt;p&gt;Your customers want webhooks. You know the checklist:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A queue so user requests don't block on HTTPS calls to third-party servers&lt;/li&gt;
&lt;li&gt;HMAC signing so customers can verify the request came from you&lt;/li&gt;
&lt;li&gt;Retry with exponential backoff, jitter, a max attempt count&lt;/li&gt;
&lt;li&gt;A circuit breaker so flaky endpoints don't cost you compute&lt;/li&gt;
&lt;li&gt;A delivery log with replay for the &lt;em&gt;"we never got that event"&lt;/em&gt; support ticket&lt;/li&gt;
&lt;li&gt;A subscription model with rotatable secrets, event filters, active/inactive state&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's two weeks of work, plus ongoing maintenance. &lt;strong&gt;This post shows how to skip all of it.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The whole thing, in one SDK call
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;CentraliSDK&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;RecordEvents&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@centrali-io/centrali-sdk&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sub&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;centrali&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;webhookSubscriptions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;customer-acme-order-events&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://customer-acme.example.com/webhooks&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;events&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;RecordEvents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CREATED&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;RecordEvents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;UPDATED&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;recordSlugs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;orders&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// `secret` is returned on create only — copy it now, reads omit it.&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Signing secret:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;secret&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the whole setup. HMAC signing, retry, circuit breaker, delivery log, replay — all behind that one call. The rest of this post explains what just got handled for you, and shows how to wire up the customer side.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'd build yourself (and won't have to)
&lt;/h2&gt;

&lt;p&gt;Before the tutorial, the honest version of what ships with a production-ready webhook system:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;An outbound queue.&lt;/strong&gt; You can't block the user's API request on an HTTPS call to a customer server. Something has to pull from a queue (Redis, SQS, BullMQ) and dispatch asynchronously.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HMAC signing.&lt;/strong&gt; Sign the raw body with the subscription's secret, attach as a header. Secrets must be rotatable and scoped per subscription.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retry with backoff.&lt;/strong&gt; When a delivery fails (5xx or timeout), retry — but not immediately, and not forever. Exponential backoff is the baseline. Most teams get this subtly wrong: no jitter, too many attempts, too aggressive early.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Circuit breaker.&lt;/strong&gt; When a customer's endpoint has been failing for minutes, stop attempting. Resume when it's healthy. Otherwise you waste compute on doomed requests and compound the outage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delivery log.&lt;/strong&gt; Every attempt: HTTP status, response body, error, timestamp. This is the contract with support. When a customer asks &lt;em&gt;"did you send it?"&lt;/em&gt;, the log is the only answer that matters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manual replay.&lt;/strong&gt; Customer deploys a fix, wants to catch up on the last hour. They need a replay endpoint. It shouldn't duplicate into your retry queue.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A subscription model.&lt;/strong&gt; Customers create subscriptions, scoped to events and record types. Activate/deactivate. Rotate the secret without losing history.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each item is a day of work. Together they're a sprint. Maintained well, they're an ongoing tax on your platform team.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Centrali gives you
&lt;/h2&gt;

&lt;p&gt;One line each, mapped to the list above:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Outbound queue:&lt;/strong&gt; built in, no worker to deploy. Dispatch happens on record changes automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HMAC signing:&lt;/strong&gt; SHA-256 over the raw body, base64-encoded, header is &lt;code&gt;X-Signature&lt;/code&gt;. Secret is &lt;code&gt;whsec_…&lt;/code&gt;, auto-generated per subscription, rotatable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retry with backoff:&lt;/strong&gt; 5 attempts over ~40 minutes — delays of &lt;code&gt;30s&lt;/code&gt;, &lt;code&gt;2m&lt;/code&gt;, &lt;code&gt;10m&lt;/code&gt;, &lt;code&gt;30m&lt;/code&gt; between attempts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Circuit breaker:&lt;/strong&gt; per-URL, opens when an endpoint is consistently failing, resets after a cool-down. Flaky endpoints stop costing you compute.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delivery log:&lt;/strong&gt; every attempt stored — HTTP status, error, payload, response body — visible in the console and queryable via API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manual replay:&lt;/strong&gt; one endpoint — &lt;code&gt;POST /webhook-subscriptions/deliveries/{id}/retry&lt;/code&gt;. New delivery is linked to the original via &lt;code&gt;replayedFrom&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subscription model:&lt;/strong&gt; collection-scoped (via &lt;code&gt;recordSlugs&lt;/code&gt;), event-type-filtered (&lt;code&gt;record_created&lt;/code&gt;, &lt;code&gt;record_updated&lt;/code&gt;, &lt;code&gt;record_deleted&lt;/code&gt;), active/inactive, rotatable secret.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Tutorial: ship an outbound webhook in 5 minutes
&lt;/h2&gt;

&lt;p&gt;The demo: a SaaS that tracks orders. When an order is created or updated, subscribed customers get a webhook.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Create a collection
&lt;/h3&gt;

&lt;p&gt;If you don't have one already, create an &lt;code&gt;orders&lt;/code&gt; collection in the Centrali console. Any collection works — Centrali emits record events for every collection in the workspace.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzeovma8ip0rmltgbng3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzeovma8ip0rmltgbng3.png" alt="Orders records table with pending, paid, and refunded orders" width="800" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Subscribe a customer endpoint
&lt;/h3&gt;

&lt;p&gt;You already saw the subscribe call at the top of the post. The response wraps the subscription under &lt;code&gt;sub.data&lt;/code&gt; — the two fields that matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;sub.data.id&lt;/code&gt; — subscription ID for updates and delivery queries&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sub.data.secret&lt;/code&gt; — signing secret, &lt;strong&gt;returned once on create&lt;/strong&gt;. Save it and hand it to your customer so they can verify incoming requests. If lost, rotate in the console: old-secret deliveries stay in the log, new deliveries use the new secret.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The console view shows the subscription with URL, event filters, a masked rotatable secret, signature header, and algorithm:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fee6shkbz4e4pgq92nvak.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fee6shkbz4e4pgq92nvak.png" alt="Subscription detail view showing URL, events, record filter, signing secret, and signature header" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Prefer raw HTTP?&lt;/strong&gt; Same shape over REST — &lt;code&gt;POST /data/workspace/{your-workspace}/api/v1/webhook-subscriptions&lt;/code&gt; with a bearer token and a body matching the SDK call. Translating &lt;code&gt;fetch&lt;/code&gt; or any HTTP client is one-to-one.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Step 3: Trigger an event
&lt;/h3&gt;

&lt;p&gt;Any record change in the &lt;code&gt;orders&lt;/code&gt; collection now fans out to subscribed endpoints. Create an order:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;centrali&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createRecord&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;orders&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;orderNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ORD-1045&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;customerEmail&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pia@terradome.studio&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;total&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;210&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;currency&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;USD&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pending&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;itemCount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Centrali dispatches a POST to the subscribed URL within seconds. The request body looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"event"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"record_created"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"workspaceSlug"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"demo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"recordSlug"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"orders"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"recordId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"7d5a87d5-b10c-48bb-85d8-c42dbdaab417"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"orderNumber"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ORD-1045"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"customerEmail"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pia@terradome.studio"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"total"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;210&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"currency"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"USD"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pending"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"itemCount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"placedAt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-04-22T04:59:00Z"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-04-22T04:59:02Z"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the headers include the HMAC signature:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;X-Signature: xXyHjYrTLS0bKh9qypUv8U5fj5UwBpIn2u0loyEoSQg=
Content-Type: application/json
User-Agent: Centrali-Webhooks/1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtfq0wnx5cpvbk0qmyt0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtfq0wnx5cpvbk0qmyt0.png" alt="webhook.site showing the request payload and X-Signature header" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Verify the signature on the customer side
&lt;/h3&gt;

&lt;p&gt;The signature is &lt;code&gt;HMAC-SHA256(signingSecret, rawBody)&lt;/code&gt;, base64-encoded. The critical word is &lt;strong&gt;raw&lt;/strong&gt;: compute it over the exact bytes you received, before any JSON parsing or middleware touches them.&lt;/p&gt;

&lt;p&gt;Here's an Express.js handler that does it right:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;crypto&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;WEBHOOK_SECRET&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CENTRALI_WEBHOOK_SECRET&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Use raw body middleware for the webhook route only&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/webhooks/centrali&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;signature&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;X-Signature&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;missing signature&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;expected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createHmac&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sha256&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;WEBHOOK_SECRET&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// req.body is a Buffer of the raw bytes&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;base64&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;valid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;timingSafeEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;valid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;401&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;invalid signature&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;got event:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;recordId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Do work, then 2xx to acknowledge&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ok&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The two gotchas that trip up every first implementation:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Parse after verification.&lt;/strong&gt; If you let &lt;code&gt;express.json()&lt;/code&gt; touch the request first, the raw bytes are gone and the signature won't match. Use &lt;code&gt;express.raw()&lt;/code&gt; for this route only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Constant-time comparison.&lt;/strong&gt; &lt;code&gt;===&lt;/code&gt; leaks timing information. Use &lt;code&gt;crypto.timingSafeEqual&lt;/code&gt; or your language's equivalent.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Normally you'd be writing the signing code too&lt;/strong&gt; — on your server. Here your server doesn't ship webhook code at all. The only HMAC work is on the customer's end, which is where it belongs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What happens when the customer's endpoint is down
&lt;/h2&gt;

&lt;p&gt;The honest failure mode is what sells the feature. Create a second subscription pointed at a deliberately broken endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;centrali&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;webhookSubscriptions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;customer-globex-order-events&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://httpbin.org/status/500&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;events&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;RecordEvents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CREATED&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;RecordEvents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;UPDATED&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;recordSlugs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;orders&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Trigger any order event and watch the delivery log. The first attempt fails with HTTP 500. The next four attempts happen at &lt;code&gt;+30s&lt;/code&gt;, &lt;code&gt;+2m&lt;/code&gt;, &lt;code&gt;+10m&lt;/code&gt;, &lt;code&gt;+30m&lt;/code&gt;. The log stays visible the whole time, with live &lt;code&gt;nextAttemptAt&lt;/code&gt; and &lt;code&gt;attemptCount&lt;/code&gt; values:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzt7oou3oitpzhvm4h6di.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzt7oou3oitpzhvm4h6di.png" alt="Delivery log during retry — record_created and record_updated retrying at attempt 4" width="800" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the fifth attempt, the delivery's status flips to &lt;code&gt;failed&lt;/code&gt; and the error is preserved:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq0pajrv0wkysgivx9ik9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq0pajrv0wkysgivx9ik9.png" alt="Delivery log with failed deliveries after retry exhaustion" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No retry code in your app. No job queue. No alerts you wired up and forgot about. Just a log you point support at when someone asks &lt;em&gt;"did it send?"&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Replay a failed delivery once the endpoint is healthy
&lt;/h2&gt;

&lt;p&gt;The customer fixes their endpoint. They want the missed events. Replay any failed delivery by ID:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;centrali&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;webhookSubscriptions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deliveries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;retry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;deliveryId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A new delivery is created, pointed at the current subscription URL. The new delivery's detail view shows the original delivery ID under &lt;code&gt;replayedFrom&lt;/code&gt; — you always know where a replay came from:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9n91ucfdgxhwastbz1k9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9n91ucfdgxhwastbz1k9.png" alt="Delivery detail showing Status Success, HTTP 200, attempts 1, Replayed from: 5a9b39e2-b695-44ba-aaae-be96bd3c4af8" width="800" height="976"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If replay was the entire story, you'd still need a queue. But combined with automatic retry plus the delivery log, the customer flow becomes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Customer endpoint goes down.&lt;/li&gt;
&lt;li&gt;Centrali tries for ~40 minutes, then gives up (logged).&lt;/li&gt;
&lt;li&gt;Customer fixes their endpoint.&lt;/li&gt;
&lt;li&gt;Customer (or you, from their support request) hits the replay endpoint once.&lt;/li&gt;
&lt;li&gt;Back to normal — no lost events.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What's in the subscription model
&lt;/h2&gt;

&lt;p&gt;If you've used Svix or Hookdeck, this shape will feel familiar:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Display name — usually the customer's name + event scope&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;url&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;HTTPS endpoint that receives deliveries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;events&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Event types to subscribe to — &lt;code&gt;record_created&lt;/code&gt;, &lt;code&gt;record_updated&lt;/code&gt;, &lt;code&gt;record_deleted&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;recordSlugs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Collection filter — deliver only for these record slugs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;status&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;active&lt;/code&gt; or &lt;code&gt;inactive&lt;/code&gt; — pause without deleting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;signingSecret&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shared secret for HMAC signing (auto-generated, rotatable)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;signatureHeader&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Header name for the signature (default: &lt;code&gt;X-Signature&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;algorithm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;HMAC algorithm (default: &lt;code&gt;sha256&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;encoding&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Signature encoding (default: &lt;code&gt;base64&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One subscription per customer-per-scope. Rotating the secret doesn't lose history — existing deliveries in the log remain readable, future deliveries use the new secret.&lt;/p&gt;

&lt;h2&gt;
  
  
  When you should still build it yourself
&lt;/h2&gt;

&lt;p&gt;If webhooks are core to your product — you're Zapier, or Segment, or you're Svix — you need more than what's in a backend platform. Per-customer delivery portals, detailed per-endpoint SLAs, webhook-as-a-product pricing, platform-wide rate budgets. Those companies exist for a reason and the category is real.&lt;/p&gt;

&lt;p&gt;If webhooks are a feature of your product — one of many things your API does, and your customers want them — you don't need dedicated webhook infrastructure. You need the seven things above, and you need them to work without turning into a team's full-time job.&lt;/p&gt;

&lt;p&gt;That's what the platform you're already using gives you.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Follow along:&lt;/strong&gt; &lt;a href="https://centrali.io/signup?utm_source=blog&amp;amp;utm_medium=content&amp;amp;utm_campaign=add-webhooks-to-your-saas" rel="noopener noreferrer"&gt;Create a free workspace&lt;/a&gt; and subscribe your first endpoint in 5 minutes. No deployment required.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Related reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://centrali.io/blog/ingest-github-webhooks" rel="noopener noreferrer"&gt;Ingest Webhooks From Any Provider — GitHub as the Example&lt;/a&gt; — the receive side, with signature verification&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://centrali.io/blog/stripe-webhook-handler" rel="noopener noreferrer"&gt;Stripe Webhook Handler&lt;/a&gt; — handle inbound Stripe events end-to-end&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://centrali.io/blog/query-stripe-webhook-events-like-a-database" rel="noopener noreferrer"&gt;Query Stripe Webhook Events Like a Database&lt;/a&gt; — what to do with webhooks once you've received them&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>tutorial</category>
      <category>webdev</category>
      <category>webhooks</category>
      <category>saas</category>
    </item>
    <item>
      <title>What Is Record TTL? Database Time-to-Live Explained</title>
      <dc:creator>Mary Olowu</dc:creator>
      <pubDate>Tue, 28 Apr 2026 18:22:25 +0000</pubDate>
      <link>https://dev.to/restofstack/what-is-record-ttl-database-time-to-live-explained-263c</link>
      <guid>https://dev.to/restofstack/what-is-record-ttl-database-time-to-live-explained-263c</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Cross-posted from &lt;a href="https://centrali.io/blog/what-is-record-ttl" rel="noopener noreferrer"&gt;the Centrali blog&lt;/a&gt;.&lt;/strong&gt; The canonical version with code highlighting and updates lives there.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Record TTL (time-to-live) is a database feature that automatically deletes records once they expire. You set an expiration time on a record — by duration ("delete in 1 hour") or by timestamp ("delete on March 1") — and the database removes it without a cron job. This is &lt;em&gt;database&lt;/em&gt; TTL; it's the same idea as DNS TTL but applied to rows in a table instead of cached DNS lookups.&lt;/p&gt;

&lt;p&gt;A note before we go further: if you searched for "TTL" and ended up here looking for &lt;strong&gt;DNS TTL&lt;/strong&gt; (how long a DNS resolver caches an A/AAAA/CNAME record), this isn't that post — try &lt;a href="https://developers.cloudflare.com/dns/manage-dns-records/reference/ttl/" rel="noopener noreferrer"&gt;Cloudflare's DNS TTL reference&lt;/a&gt;. This post is about &lt;strong&gt;record TTL in databases&lt;/strong&gt;: making rows in your data store auto-delete on a schedule.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Record TTL?
&lt;/h2&gt;

&lt;p&gt;Record TTL is a per-record expiration time. The database tracks an &lt;code&gt;expiresAt&lt;/code&gt; timestamp on the record (either set explicitly or computed from a duration), and once that timestamp passes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The record disappears from query results immediately (read-time filtering).&lt;/li&gt;
&lt;li&gt;A background sweep deletes it from storage permanently.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The two writes you make as a developer are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;ttlSeconds&lt;/code&gt;&lt;/strong&gt; — a duration. &lt;em&gt;"Delete this record 3,600 seconds from now."&lt;/em&gt; The database calculates the absolute &lt;code&gt;expiresAt&lt;/code&gt; for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;expiresAt&lt;/code&gt;&lt;/strong&gt; — an absolute timestamp. &lt;em&gt;"Delete this record at 2026-09-01T00:00:00Z."&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both end up storing the same field. Use &lt;code&gt;ttlSeconds&lt;/code&gt; when the deadline is relative ("expire 24 hours after creation"); use &lt;code&gt;expiresAt&lt;/code&gt; when the deadline is fixed ("expire on the sale end date").&lt;/p&gt;

&lt;h2&gt;
  
  
  How TTL Works (Mechanically)
&lt;/h2&gt;

&lt;p&gt;Three things happen between "you wrote a TTL" and "the record is gone":&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Write time&lt;/strong&gt; — you create or update a record with &lt;code&gt;ttlSeconds&lt;/code&gt; or &lt;code&gt;expiresAt&lt;/code&gt;. The database stores the absolute expiration timestamp on the record.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read time&lt;/strong&gt; — every query is implicitly filtered against &lt;code&gt;now()&lt;/code&gt;. Records past their &lt;code&gt;expiresAt&lt;/code&gt; are excluded from results, even if they haven't been physically deleted yet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sweep time&lt;/strong&gt; — a background job (every few minutes, depending on the database) finds expired records and deletes them. Some systems also publish an event ("record.expired") so your app can react before the row is gone.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The key property: &lt;strong&gt;expired records become invisible to your application instantly&lt;/strong&gt;, even if the on-disk delete lags by minutes. You don't need to filter &lt;code&gt;WHERE expiresAt &amp;gt; now()&lt;/code&gt; in every query — the database does it for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to Use Record TTL
&lt;/h2&gt;

&lt;p&gt;TTL is the right tool whenever you're tempted to write a "cleanup script that runs every night." Common cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Session tokens&lt;/strong&gt; — expire after 24 hours of inactivity, or 30 days from creation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verification codes&lt;/strong&gt; — one-time codes for email verification, magic links, password reset. Expire in 15 minutes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Promo codes and flash deals&lt;/strong&gt; — auto-disable when the deadline hits (or the flash window closes).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Draft content&lt;/strong&gt; — autosave drafts that should evaporate after N days unless promoted to a published post.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rate-limit windows&lt;/strong&gt; — track requests-per-minute by storing a record per request with a 60-second TTL.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audit logs with retention rules&lt;/strong&gt; — "delete after 90 days" without writing the cleanup job yourself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache-like records&lt;/strong&gt; — when you need durable storage with cache-like eviction.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The negative test: TTL is the wrong tool when you need &lt;em&gt;soft&lt;/em&gt; expiration — i.e., the record should be flagged as expired but kept around for analytics or recovery. For that, use a status field (&lt;code&gt;status: 'archived'&lt;/code&gt;) and filter explicitly. TTL means &lt;em&gt;gone&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Default TTL vs. Per-Record TTL
&lt;/h2&gt;

&lt;p&gt;Most databases that support record TTL let you set it at two levels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Default TTL on the collection (or table)&lt;/strong&gt; — every new record auto-inherits the duration. Set this for collections that are &lt;em&gt;always&lt;/em&gt; time-bounded (sessions, verification codes).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per-record TTL&lt;/strong&gt; — override the default (or set TTL on a record in a non-TTL collection). Set this for one-off cases — flash promos in a long-lived "Promotions" table, for example.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A reasonable mental model: default TTL is for the table's &lt;em&gt;intent&lt;/em&gt;; per-record TTL is for the &lt;em&gt;exception&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Database TTL vs. DNS TTL
&lt;/h2&gt;

&lt;p&gt;Same name, different concept. They share the underlying idea — "this thing is valid for N seconds, then forget it" — but they apply to different layers:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;DNS TTL&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Database (record) TTL&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;What expires&lt;/td&gt;
&lt;td&gt;A DNS record cached at a resolver&lt;/td&gt;
&lt;td&gt;A row stored in your database&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Who enforces it&lt;/td&gt;
&lt;td&gt;DNS resolvers worldwide&lt;/td&gt;
&lt;td&gt;Your database server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Typical duration&lt;/td&gt;
&lt;td&gt;Seconds to hours&lt;/td&gt;
&lt;td&gt;Minutes to months&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tunable per-record?&lt;/td&gt;
&lt;td&gt;Yes (per DNS record)&lt;/td&gt;
&lt;td&gt;Yes (per row, if the DB supports it)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What "expired" means&lt;/td&gt;
&lt;td&gt;Resolver re-fetches from authoritative server&lt;/td&gt;
&lt;td&gt;Row is hidden from queries and eventually deleted&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you're in the DNS world, TTL is about &lt;em&gt;cache freshness&lt;/em&gt;. In the database world, TTL is about &lt;em&gt;automatic cleanup&lt;/em&gt;. The mechanics aren't connected — your A-record TTL has nothing to do with your sessions table TTL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementing Record TTL
&lt;/h2&gt;

&lt;p&gt;Most managed databases now offer some form of record TTL: MongoDB has &lt;code&gt;expireAfterSeconds&lt;/code&gt; indexes; DynamoDB has TTL attributes; Redis has &lt;code&gt;EXPIRE&lt;/code&gt;. The exact API differs, but the shape is the same: a field on the record (or an index on a field) tells the database when to delete.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://centrali.io/" rel="noopener noreferrer"&gt;Centrali&lt;/a&gt;, record TTL is built into the storage layer. You set &lt;code&gt;ttlSeconds&lt;/code&gt; or &lt;code&gt;expiresAt&lt;/code&gt; when creating a record, or set a default at the collection level:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;CentraliSDK&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@centrali-io/centrali-sdk&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;centrali&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;CentraliSDK&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;workspaceId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my-workspace&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;clientId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CENTRALI_CLIENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;clientSecret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CENTRALI_CLIENT_SECRET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Per-record TTL: this verification code expires in 15 minutes&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;centrali&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createRecord&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;VerificationCodes&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user-123&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;482910&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;ttlSeconds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;900&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a step-by-step walkthrough — sessions with sliding expiration, promo codes with fixed deadlines, draft content with TTL clearing on publish — see the companion post: &lt;a href="https://centrali.io/blog/auto-expire-records-with-centrali-ttl" rel="noopener noreferrer"&gt;How to Auto-Expire Records with Centrali TTL&lt;/a&gt;. Full reference lives in the &lt;a href="https://docs.centrali.io/platform/record-ttl/" rel="noopener noreferrer"&gt;Record TTL docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Centrali sits in a broader category — a backend for ingesting third-party webhooks, storing them as data, and sending your own webhooks and workflows. Record TTL is one feature inside the storage layer; if you're working with &lt;a href="https://centrali.io/blog/stripe-webhook-handler" rel="noopener noreferrer"&gt;stored Stripe webhook events&lt;/a&gt; or &lt;a href="https://centrali.io/blog/schema-discovery-guide" rel="noopener noreferrer"&gt;schemaless data&lt;/a&gt;, the same TTL rules apply to those records.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Does TTL delete data immediately when it expires?&lt;/strong&gt;&lt;br&gt;
Records become invisible to queries the instant &lt;code&gt;expiresAt&lt;/code&gt; passes. Physical deletion happens on a background sweep, typically within a few minutes. Don't rely on instant disk deletion for security-sensitive data — use a separate purge if you need it gone &lt;em&gt;now&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I extend a TTL after the record is created?&lt;/strong&gt;&lt;br&gt;
Yes — update the record with a new &lt;code&gt;ttlSeconds&lt;/code&gt; or &lt;code&gt;expiresAt&lt;/code&gt;. This is how "sliding expiration" works for sessions: every authenticated request resets the TTL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I remove a TTL after setting one?&lt;/strong&gt;&lt;br&gt;
Yes — most TTL implementations support clearing the expiration so the record becomes permanent. In Centrali, pass &lt;code&gt;{ clearTtl: true }&lt;/code&gt; on the update.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is TTL the same as data retention policy?&lt;/strong&gt;&lt;br&gt;
TTL is a &lt;em&gt;mechanism&lt;/em&gt; for retention. A retention policy is the &lt;em&gt;rule&lt;/em&gt; ("keep audit logs for 90 days"); TTL is one way to enforce it. Other ways: scheduled jobs, archival to cold storage, manual purges.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's the smallest practical TTL?&lt;/strong&gt;&lt;br&gt;
Depends on the database, but seconds-level TTL is common. Sub-second TTL usually doesn't make sense — by the time the write replicates, the record may already be expired.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Record TTL is the database equivalent of "set it and forget it" cleanup: assign an expiration to a record, and the database handles the rest. Use it for any data that's intrinsically time-bounded — sessions, codes, promos, drafts, rate-limit windows. Don't confuse it with DNS TTL; same name, different layer.&lt;/p&gt;

&lt;p&gt;If you want to see TTL in action with concrete code, the &lt;a href="https://centrali.io/blog/auto-expire-records-with-centrali-ttl" rel="noopener noreferrer"&gt;auto-expire records guide&lt;/a&gt; walks through three full use cases.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://centrali.io/blog/what-is-record-ttl" rel="noopener noreferrer"&gt;centrali.io/blog/what-is-record-ttl&lt;/a&gt;. Centrali is the backend for webhooks in and out — ingest third-party webhooks, store them as data, and send your own workflows from one SDK.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Test Stripe Webhooks Locally (Stripe CLI + Replay + Logs)</title>
      <dc:creator>Mary Olowu</dc:creator>
      <pubDate>Wed, 22 Apr 2026 07:43:19 +0000</pubDate>
      <link>https://dev.to/restofstack/how-to-test-stripe-webhooks-locally-stripe-cli-replay-logs-7of</link>
      <guid>https://dev.to/restofstack/how-to-test-stripe-webhooks-locally-stripe-cli-replay-logs-7of</guid>
      <description>&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/Yacu_l6Qd4A"&gt;
  &lt;/iframe&gt;
&lt;br&gt;
Most Stripe webhook bugs are not business logic bugs. They are reproducibility bugs. If you can't replay the exact event path in under 30 seconds, debugging takes hours instead of minutes — because every attempt involves refreshing the Stripe Dashboard, re-triggering a test, and squinting at logs to figure out whether your handler ran at all.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F78bmt5bsgqz44xdwmkqg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F78bmt5bsgqz44xdwmkqg.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This post walks through the local loop that makes this painless: &lt;strong&gt;forward → trigger → replay → inspect.&lt;/strong&gt; Four steps, one terminal window, no guessing.&lt;/p&gt;
&lt;h2&gt;
  
  
  The loop, in full
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Terminal 1 — forward Stripe events to your local handler&lt;/span&gt;
stripe listen &lt;span class="nt"&gt;--forward-to&lt;/span&gt; &lt;span class="s2"&gt;"http://localhost:3000/api/stripe-webhook"&lt;/span&gt;

&lt;span class="c"&gt;# Terminal 2 — trigger real Stripe test events&lt;/span&gt;
stripe trigger payment_intent.succeeded
stripe trigger charge.failed
stripe trigger invoice.payment_failed

&lt;span class="c"&gt;# When something fails, replay the exact event&lt;/span&gt;
stripe events resend evt_1NfP6Q2eZvKYlo2CsKT4a5oS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;That is the whole loop. Everything below is how to make it reliable.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1 — Give your dev webhook its own path
&lt;/h2&gt;

&lt;p&gt;Don't forward Stripe events to your production webhook path. Use a dedicated dev path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;stripe listen &lt;span class="nt"&gt;--forward-to&lt;/span&gt; &lt;span class="s2"&gt;"http://localhost:3000/api/stripe-webhook-dev"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why separate? Because you want to test with lax validation (no signature verification, verbose logging) without loosening your production handler. Keep two paths:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/api/stripe-webhook&lt;/code&gt; — production. Strict signature verification, minimal logs.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/api/stripe-webhook-dev&lt;/code&gt; — dev only. Signature check optional, logs every field.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When &lt;code&gt;stripe listen&lt;/code&gt; starts, it prints a signing secret:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; Ready! Your webhook signing secret is whsec_abc123...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy that into your dev environment variable (&lt;code&gt;STRIPE_WEBHOOK_SECRET_DEV&lt;/code&gt;). This is NOT the same as the secret from your Stripe Dashboard — the CLI generates its own. This trips up everyone the first time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 — Trigger real events, not made-up payloads
&lt;/h2&gt;

&lt;p&gt;Do not hand-craft JSON payloads. Stripe's &lt;code&gt;trigger&lt;/code&gt; command sends a real event through your account's test data, which means you're testing against payloads that match production exactly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Core payment flows&lt;/span&gt;
stripe trigger payment_intent.succeeded
stripe trigger charge.succeeded
stripe trigger charge.failed

&lt;span class="c"&gt;# Subscription lifecycle&lt;/span&gt;
stripe trigger customer.subscription.created
stripe trigger customer.subscription.updated
stripe trigger customer.subscription.deleted

&lt;span class="c"&gt;# Invoice / billing&lt;/span&gt;
stripe trigger invoice.payment_succeeded
stripe trigger invoice.payment_failed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each trigger writes a real event to your Stripe test account. That means every event has a real &lt;code&gt;id&lt;/code&gt; (starts with &lt;code&gt;evt_&lt;/code&gt;) that you can replay later.&lt;/p&gt;

&lt;p&gt;Run all the events your handler cares about at least once. Anything you haven't triggered locally is a surprise waiting in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 — Replay the exact event, on demand
&lt;/h2&gt;

&lt;p&gt;This is the step most people skip, and it's where debugging speed compounds. When a test fails, you can replay the exact same event by ID:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;stripe events resend evt_1NfP6Q2eZvKYlo2CsKT4a5oS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same payload. Same signature. Same timestamp. Your handler sees a byte-for-byte identical request.&lt;/p&gt;

&lt;p&gt;This is gold for two reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Idempotency testing.&lt;/strong&gt; Your handler should be safe to call with the same event ID twice. Replay it five times in a row and confirm you create one record, not five. If you create five, you have a bug.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic debugging.&lt;/strong&gt; When something fails at 2am, you can add a &lt;code&gt;console.log&lt;/code&gt;, restart your server, and replay the same event. No hunting for a new trigger, no hoping you can reproduce the path.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 4 — Validate via logs, not hope
&lt;/h2&gt;

&lt;p&gt;For every event, verify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✓ Your handler returned 200 (Stripe will retry otherwise)&lt;/li&gt;
&lt;li&gt;✓ The event ID was logged&lt;/li&gt;
&lt;li&gt;✓ A record was created (first time)&lt;/li&gt;
&lt;li&gt;✓ A replay was skipped (second time — idempotency)&lt;/li&gt;
&lt;li&gt;✓ Unknown event types no-op safely (don't throw)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A minimal handler that makes this visible:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;verifySignature&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// or skip on dev path&lt;/span&gt;

  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`[stripe] &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;existing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;findEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;existing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`[stripe] skipped duplicate &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;received&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;skipped&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;switch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;payment_intent.succeeded&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;handlePaymentSucceeded&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;charge.failed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;handleChargeFailed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`[stripe] no-op for &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;recordEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;received&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three rules this enforces:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Log the event ID on every call.&lt;/strong&gt; When something goes wrong, the event ID is the only key that connects Stripe's dashboard to your logs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Return 200 even for no-ops.&lt;/strong&gt; Stripe retries non-200 responses. A &lt;code&gt;throw&lt;/code&gt; on an unknown event type will get retried for 3 days and fill up your logs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make duplicate detection visible.&lt;/strong&gt; When you replay for testing, you want to SEE that the skip branch fired.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Pre-production checklist
&lt;/h2&gt;

&lt;p&gt;Before you switch Stripe from your CLI forwarder to your real endpoint:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Every event type you care about has been triggered locally at least once&lt;/li&gt;
&lt;li&gt;[ ] Each one has been &lt;strong&gt;replayed&lt;/strong&gt; and the idempotency branch ran&lt;/li&gt;
&lt;li&gt;[ ] At least one unknown event type was sent — handler returned 200, did not throw&lt;/li&gt;
&lt;li&gt;[ ] Signature verification works in prod mode with the real Dashboard secret (not the CLI secret)&lt;/li&gt;
&lt;li&gt;[ ] Handler returns 200 in under 5 seconds for all event types (Stripe times out at 30s but backs off aggressively if you're slow)&lt;/li&gt;
&lt;li&gt;[ ] Logs include event ID on every line relevant to the event&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What this costs
&lt;/h2&gt;

&lt;p&gt;Nothing. The Stripe CLI is free. &lt;code&gt;stripe trigger&lt;/code&gt; uses your test mode data. &lt;code&gt;stripe events resend&lt;/code&gt; uses events you already generated. You don't need a tunnel service (ngrok, localtunnel) — &lt;code&gt;stripe listen&lt;/code&gt; does the forwarding itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to pair this with
&lt;/h2&gt;

&lt;p&gt;If you want stored event history you can query later (replay a 2-week-old event, audit a customer's event sequence, etc.), you need something between Stripe and your handler that logs every event permanently. Stripe's own Events API only goes back 30 days and can't filter by fields you care about.&lt;/p&gt;

&lt;p&gt;Centrali's webhook triggers do this out of the box — every inbound event is stored in a collection you can query later. But the testing loop above works with any handler, framework, or platform. The important part is the loop.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If this was useful, I write more about webhook reliability and Stripe integration patterns. Follow me for more.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>stripe</category>
      <category>webhooks</category>
      <category>nextjs</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Stop Writing Custom Scrapers: Index Static Content into Meilisearch with One Config</title>
      <dc:creator>Mary Olowu</dc:creator>
      <pubDate>Wed, 22 Apr 2026 07:42:56 +0000</pubDate>
      <link>https://dev.to/restofstack/stop-writing-custom-scrapers-index-static-content-into-meilisearch-with-one-config-742</link>
      <guid>https://dev.to/restofstack/stop-writing-custom-scrapers-index-static-content-into-meilisearch-with-one-config-742</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdh6vnn32lqtyp4q5yt3p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdh6vnn32lqtyp4q5yt3p.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — &lt;a href="https://github.com/blueinit/content-mill" rel="noopener noreferrer"&gt;content-mill&lt;/a&gt; is an open-source CLI and library that reads static content — MkDocs sites, markdown directories, JSON files, HTML pages — and indexes it into Meilisearch, driven by a YAML config. You define the document shape; it handles extraction, templating, chunking, and atomic zero-downtime re-indexing. You still tune templates and debug extraction for your own content — that part's on you — but you stop maintaining bespoke scraper code.&lt;/p&gt;


&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @centrali-io/content-mill
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;p&gt;If you've ever tried to make your docs, blog posts, or changelogs searchable with Meilisearch, you know the drill: write a custom scraper, parse the content, transform it into the right shape, push it to an index, and hope you don't break search during re-indexing.&lt;/p&gt;

&lt;p&gt;I got tired of writing that glue code for every project, so I built &lt;strong&gt;content-mill&lt;/strong&gt; — a CLI and library that indexes static content into Meilisearch, driven by a YAML config.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Meilisearch is fantastic for search, but getting your content &lt;em&gt;into&lt;/em&gt; it is surprisingly manual. Every docs site, every changelog, every collection of markdown files needs its own extraction pipeline. And if you want zero-downtime re-indexing? That's more code on top.&lt;/p&gt;

&lt;p&gt;Most existing solutions are either tightly coupled to a specific framework (like DocSearch for Algolia) or expect you to run a full crawler. Lighter-weight options exist — usually ad-hoc scripts people write once per project — but nothing I could find that's reusable across source types and explicit about document shape.&lt;/p&gt;

&lt;h2&gt;
  
  
  What content-mill does
&lt;/h2&gt;

&lt;p&gt;You describe your content sources and the document shape you want in a YAML config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;meili&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http://localhost:7700&lt;/span&gt;
  &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${MEILI_MASTER_KEY}&lt;/span&gt;

&lt;span class="na"&gt;sources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docs&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mkdocs&lt;/span&gt;
    &lt;span class="na"&gt;config&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./mkdocs.yml&lt;/span&gt;
    &lt;span class="na"&gt;index&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docs&lt;/span&gt;
    &lt;span class="na"&gt;document&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;primaryKey&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;id&lt;/span&gt;
      &lt;span class="na"&gt;fields&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;slug&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;heading&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
        &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;body&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
        &lt;span class="na"&gt;section&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;nav_section&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
        &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;path&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;docs"&lt;/span&gt;
      &lt;span class="na"&gt;searchableAttributes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
      &lt;span class="na"&gt;filterableAttributes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;section&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @centrali-io/content-mill index &lt;span class="nt"&gt;--config&lt;/span&gt; content-mill.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the config matches your content, re-running is a single command. You'll still spend time tuning templates and sanity-checking extraction (use &lt;code&gt;--dry-run&lt;/code&gt; for that) — but you're not maintaining scraper code anymore. content-mill handles extraction, templating, and atomic index swapping, so search never goes down during re-indexing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four source types, one interface
&lt;/h2&gt;

&lt;p&gt;content-mill ships with adapters for the content formats you're most likely already using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;mkdocs&lt;/code&gt;&lt;/strong&gt; — Reads your &lt;code&gt;mkdocs.yml&lt;/code&gt;, follows the nav tree, and parses each markdown page. You get &lt;code&gt;nav_section&lt;/code&gt; context so you know which part of the docs each page belongs to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;markdown-dir&lt;/code&gt;&lt;/strong&gt; — Recursively reads &lt;code&gt;.md&lt;/code&gt; files from a directory. Supports YAML frontmatter, so you can pull version numbers, dates, or any metadata into your search index. Great for changelogs and blog posts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;json&lt;/code&gt;&lt;/strong&gt; — Reads a JSON array (or directory of JSON files). Every key in each object becomes a template variable. Perfect for structured data you already have lying around.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;html&lt;/code&gt;&lt;/strong&gt; — Reads &lt;code&gt;.html&lt;/code&gt; files, strips scripts/styles/nav/footer, and gives you clean text. Useful for indexing a built static site.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Templating: you control the document shape
&lt;/h2&gt;

&lt;p&gt;The key design decision is that &lt;strong&gt;you&lt;/strong&gt; define what your Meilisearch documents look like. Source adapters extract raw variables (&lt;code&gt;slug&lt;/code&gt;, &lt;code&gt;heading&lt;/code&gt;, &lt;code&gt;body&lt;/code&gt;, &lt;code&gt;path&lt;/code&gt;, &lt;code&gt;frontmatter.*&lt;/code&gt;, etc.), and you map them to fields using &lt;code&gt;{{ template }}&lt;/code&gt; syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;fields&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;slug&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}-{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;chunk_index&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;chunk_heading&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;chunk_body&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
  &lt;span class="na"&gt;excerpt&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;body&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;|&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;truncate(200)&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
  &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;path&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}#{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;chunk_heading&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;|&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;slugify&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Filters like &lt;code&gt;truncate&lt;/code&gt;, &lt;code&gt;slugify&lt;/code&gt;, &lt;code&gt;lower&lt;/code&gt;, &lt;code&gt;upper&lt;/code&gt;, and &lt;code&gt;strip_md&lt;/code&gt; can be chained with pipes. This means you're not locked into someone else's schema — your search index looks exactly the way your frontend expects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Chunking for granular results
&lt;/h2&gt;

&lt;p&gt;Whole-page results are often too broad for docs search. content-mill can split pages by heading level:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;chunking&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;heading&lt;/span&gt;
  &lt;span class="na"&gt;level&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This turns one long page into multiple documents — one per &lt;code&gt;##&lt;/code&gt; section — each with its own &lt;code&gt;chunk_heading&lt;/code&gt;, &lt;code&gt;chunk_body&lt;/code&gt;, and &lt;code&gt;chunk_index&lt;/code&gt;. Your search results can now link directly to the relevant section instead of dumping users at the top of a page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Zero-downtime re-indexing
&lt;/h2&gt;

&lt;p&gt;Every indexing run uses Meilisearch's index swap:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Documents go into a temp index (&lt;code&gt;docs_tmp&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Atomic swap with the live index (&lt;code&gt;docs&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Old index gets cleaned up&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If something fails mid-way, your live index is untouched. No maintenance windows needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  CI/CD in two lines
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# GitHub Actions&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Index docs&lt;/span&gt;
  &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;MEILI_MASTER_KEY&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.MEILI_MASTER_KEY }}&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npx @centrali-io/content-mill index --config content-mill.yml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hook this into your release pipeline and your search index stays in sync with every deploy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use as a library
&lt;/h2&gt;

&lt;p&gt;Don't need the CLI? Import it directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;loadConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;indexAll&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@centrali-io/content-mill&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;loadConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./content-mill.yml&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;indexAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;dryRun&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or build the config object in code if you prefer programmatic control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why not docs-scraper, DocSearch, or a custom crawler?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;docs-scraper&lt;/strong&gt; (the Meilisearch-native option) is a Scrapy-based web crawler. Works well for live sites, heavy for "I already have markdown in a repo."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Algolia DocSearch&lt;/strong&gt; is excellent, but framework-specific and indexes into Algolia — not useful if you've chosen Meilisearch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom scrapers&lt;/strong&gt; work fine for one project. Painful when you have three of them to maintain across different repos.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;content-mill is intentionally narrow: static content in, Meilisearch out, config-driven shape in between. If you're not already on Meilisearch, use something else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @centrali-io/content-mill
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a &lt;code&gt;content-mill.yml&lt;/code&gt; with your Meilisearch connection and source definitions&lt;/li&gt;
&lt;li&gt;Run with &lt;code&gt;--dry-run&lt;/code&gt; first to preview the extracted documents&lt;/li&gt;
&lt;li&gt;Run for real and check your Meilisearch dashboard&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The full config reference and source type examples are in the &lt;a href="https://github.com/blueinit/content-mill" rel="noopener noreferrer"&gt;README on GitHub&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;content-mill is MIT-licensed and open source. If you use Meilisearch and have static content to index, try it — and if your source type isn't covered (AsciiDoc, RST, Notion export, whatever), &lt;a href="https://github.com/blueinit/content-mill/issues" rel="noopener noreferrer"&gt;open an issue&lt;/a&gt; and I'll look at adding an adapter.&lt;/p&gt;

</description>
      <category>meilisearch</category>
      <category>search</category>
      <category>typescript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Stop Writing Custom Scrapers: Index Any Static Content into Meilisearch with One Config File</title>
      <dc:creator>Mary Olowu</dc:creator>
      <pubDate>Wed, 25 Mar 2026 05:16:16 +0000</pubDate>
      <link>https://dev.to/restofstack/stop-writing-custom-scrapers-index-any-static-content-into-meilisearch-with-one-config-file-2g65</link>
      <guid>https://dev.to/restofstack/stop-writing-custom-scrapers-index-any-static-content-into-meilisearch-with-one-config-file-2g65</guid>
      <description>&lt;p&gt;If you've ever tried to make your docs, blog posts, or changelogs searchable with Meilisearch, you know the drill: write a custom scraper, parse the content, transform it into the right shape, push it to an index, and hope you don't break search during re-indexing.&lt;/p&gt;

&lt;p&gt;I got tired of writing that glue code for every project, so I built &lt;strong&gt;content-mill&lt;/strong&gt; — a CLI and library that indexes static content into Meilisearch from a single YAML config.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Meilisearch is fantastic for search, but getting your content &lt;em&gt;into&lt;/em&gt; it is surprisingly manual. Every docs site, every changelog, every collection of markdown files needs its own extraction pipeline. And if you want zero-downtime re-indexing? That's more code on top.&lt;/p&gt;

&lt;p&gt;Most existing solutions are either tightly coupled to a specific framework (like DocSearch for Algolia) or require you to write a full crawler. If you just have some markdown files and a Meilisearch instance, there's nothing lightweight that bridges the gap.&lt;/p&gt;

&lt;h2&gt;
  
  
  What content-mill Does
&lt;/h2&gt;

&lt;p&gt;You describe your content sources and the document shape you want in a YAML config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;meili&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http://localhost:7700&lt;/span&gt;
  &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${MEILI_MASTER_KEY}&lt;/span&gt;

&lt;span class="na"&gt;sources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docs&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mkdocs&lt;/span&gt;
    &lt;span class="na"&gt;config&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./mkdocs.yml&lt;/span&gt;
    &lt;span class="na"&gt;index&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docs&lt;/span&gt;
    &lt;span class="na"&gt;document&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;primaryKey&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;id&lt;/span&gt;
      &lt;span class="na"&gt;fields&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;slug&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;heading&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
        &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;body&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
        &lt;span class="na"&gt;section&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;nav_section&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
        &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;path&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;docs"&lt;/span&gt;
      &lt;span class="na"&gt;searchableAttributes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
      &lt;span class="na"&gt;filterableAttributes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;section&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @centrali-io/content-mill index &lt;span class="nt"&gt;--config&lt;/span&gt; content-mill.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. content-mill reads your sources, extracts content, applies your field templates, and pushes everything to Meilisearch with atomic index swapping (so search never goes down during re-indexing).&lt;/p&gt;

&lt;h2&gt;
  
  
  Four Source Types, One Interface
&lt;/h2&gt;

&lt;p&gt;content-mill ships with adapters for the content formats you're most likely already using:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;mkdocs&lt;/code&gt;&lt;/strong&gt; — Reads your &lt;code&gt;mkdocs.yml&lt;/code&gt;, follows the nav tree, and parses each markdown page. You get &lt;code&gt;nav_section&lt;/code&gt; context so you know which part of the docs each page belongs to.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;markdown-dir&lt;/code&gt;&lt;/strong&gt; — Recursively reads &lt;code&gt;.md&lt;/code&gt; files from a directory. Supports YAML frontmatter, so you can pull version numbers, dates, or any metadata into your search index. Great for changelogs and blog posts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;json&lt;/code&gt;&lt;/strong&gt; — Reads a JSON array (or directory of JSON files). Every key in each object becomes a template variable. Perfect for structured data you already have lying around.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;html&lt;/code&gt;&lt;/strong&gt; — Reads &lt;code&gt;.html&lt;/code&gt; files, strips scripts/styles/nav/footer, and gives you clean text. Useful for indexing a built static site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Templating: You Control the Document Shape
&lt;/h2&gt;

&lt;p&gt;The key design decision is that &lt;strong&gt;you&lt;/strong&gt; define what your Meilisearch documents look like. Source adapters extract raw variables (&lt;code&gt;slug&lt;/code&gt;, &lt;code&gt;heading&lt;/code&gt;, &lt;code&gt;body&lt;/code&gt;, &lt;code&gt;path&lt;/code&gt;, &lt;code&gt;frontmatter.*&lt;/code&gt;, etc.), and you map them to fields using &lt;code&gt;{{ template }}&lt;/code&gt; syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;fields&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;slug&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}-{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;chunk_index&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;chunk_heading&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;chunk_body&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
  &lt;span class="na"&gt;excerpt&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;body&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;|&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;truncate(200)&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
  &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;path&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}#{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;chunk_heading&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;|&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;slugify&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Filters like &lt;code&gt;truncate&lt;/code&gt;, &lt;code&gt;slugify&lt;/code&gt;, &lt;code&gt;lower&lt;/code&gt;, &lt;code&gt;upper&lt;/code&gt;, and &lt;code&gt;strip_md&lt;/code&gt; can be chained with pipes. This means you're not locked into someone else's schema — your search index looks exactly the way your frontend expects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Chunking for Granular Results
&lt;/h2&gt;

&lt;p&gt;Whole-page results are often too broad for docs search. content-mill can split pages by heading level:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;chunking&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;heading&lt;/span&gt;
  &lt;span class="na"&gt;level&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This turns one long page into multiple documents — one per &lt;code&gt;##&lt;/code&gt; section — each with its own &lt;code&gt;chunk_heading&lt;/code&gt;, &lt;code&gt;chunk_body&lt;/code&gt;, and &lt;code&gt;chunk_index&lt;/code&gt;. Your search results can now link directly to the relevant section instead of dumping users at the top of a page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Zero-Downtime Re-indexing
&lt;/h2&gt;

&lt;p&gt;Every indexing run uses Meilisearch's index swap:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Documents go into a temp index (&lt;code&gt;docs_tmp&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Atomic swap with the live index (&lt;code&gt;docs&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Old index gets cleaned up&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If something fails mid-way, your live index is untouched. No maintenance windows needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  CI/CD in Two Lines
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# GitHub Actions&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Index docs&lt;/span&gt;
  &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;MEILI_MASTER_KEY&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.MEILI_MASTER_KEY }}&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npx @centrali-io/content-mill index --config content-mill.yml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hook this into your release pipeline and your search index stays in sync with every deploy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use as a Library
&lt;/h2&gt;

&lt;p&gt;Don't need the CLI? Import it directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;loadConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;indexAll&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@centrali-io/content-mill&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;loadConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./content-mill.yml&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;indexAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;dryRun&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or build the config object in code if you prefer programmatic control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @centrali-io/content-mill
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a &lt;code&gt;content-mill.yml&lt;/code&gt; with your Meilisearch connection and source definitions&lt;/li&gt;
&lt;li&gt;Run with &lt;code&gt;--dry-run&lt;/code&gt; first to preview the extracted documents&lt;/li&gt;
&lt;li&gt;Run for real and check your Meilisearch dashboard&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The full config reference and source type examples are in the &lt;a href="https://github.com/blueinit/content-mill" rel="noopener noreferrer"&gt;README on GitHub&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;content-mill is MIT licensed and open source. If you're using Meilisearch and have static content to index, I'd love to hear how it works for your use case. Issues and PRs welcome on &lt;a href="https://github.com/blueinit/content-mill" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;em&gt;Tags: #meilisearch #search #typescript #opensource&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

</description>
      <category>meilisearch</category>
      <category>typescript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Exponential vs Linear: How to Tell If Your Event-Driven Trigger Is Looping</title>
      <dc:creator>Mary Olowu</dc:creator>
      <pubDate>Sun, 15 Mar 2026 23:46:07 +0000</pubDate>
      <link>https://dev.to/restofstack/exponential-vs-linear-how-to-tell-if-your-event-driven-trigger-is-looping-1gc</link>
      <guid>https://dev.to/restofstack/exponential-vs-linear-how-to-tell-if-your-event-driven-trigger-is-looping-1gc</guid>
      <description>&lt;h1&gt;
  
  
  Exponential vs Linear: How to Tell If Your Event-Driven Trigger Is Looping
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fne8kgwa53mqcx103xz5x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fne8kgwa53mqcx103xz5x.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Core Idea
&lt;/h2&gt;

&lt;p&gt;When you're building rate limits for event-driven triggers, you face a fundamental problem: how do you set a threshold that catches loops without blocking legitimate high-volume workloads?&lt;/p&gt;

&lt;p&gt;The answer is that loops and legitimate traffic have fundamentally different growth characteristics:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Legitimate triggers scale linearly with user actions.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 user creates 1 order → 1 trigger execution&lt;/li&gt;
&lt;li&gt;50 users create 50 orders per minute → 50 trigger executions per minute&lt;/li&gt;
&lt;li&gt;The ratio is always 1:1. Trigger executions track user actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Recursive loops scale exponentially from a single user action.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 user creates 1 record → trigger fires → function creates another record → trigger fires again&lt;/li&gt;
&lt;li&gt;After 10 seconds: 100+ executions&lt;/li&gt;
&lt;li&gt;After 60 seconds: 700+ executions&lt;/li&gt;
&lt;li&gt;All from 1 user action. The trigger is its own input.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This isn't a subtle distinction. It's the difference between a line and an exponential curve. And it means your rate limit doesn't need to be clever — it just needs to sit in the massive gap between the two curves.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Matters for Rate Limit Design
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff2ywwvjgjzhq6vlavatu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff2ywwvjgjzhq6vlavatu.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A rate limit of 100 executions per 60 seconds:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Never blocks legitimate traffic.&lt;/strong&gt; Even a high-volume e-commerce system processing 80 orders per minute sits under the limit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Always catches loops.&lt;/strong&gt; A recursive loop hits 100 executions in under 8 seconds.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The gap between "highest legitimate volume" and "slowest possible loop" is enormous. You don't need machine learning or anomaly detection. You just need basic arithmetic.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Math
&lt;/h2&gt;

&lt;p&gt;A recursive trigger loop doubles (at minimum) with each iteration. If one trigger execution creates one record, and that record fires one trigger:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Executions (cumulative)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Iteration 1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Iteration 2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Iteration 3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Iteration 10&lt;/td&gt;
&lt;td&gt;1,024&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Iteration 16&lt;/td&gt;
&lt;td&gt;65,536&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Even with network latency and compute overhead slowing each iteration to 100ms, you hit 100 executions in ~7 seconds. With faster execution (10ms per iteration), you hit 100 in under a second.&lt;/p&gt;

&lt;p&gt;Meanwhile, the highest legitimate trigger volume we've seen across our platform is ~80 executions per minute per trigger — and that's a busy e-commerce workspace during a flash sale.&lt;/p&gt;

&lt;p&gt;The gap is 10x-100x. Your rate limit has a lot of room.&lt;/p&gt;

&lt;h2&gt;
  
  
  What About Burst Traffic?
&lt;/h2&gt;

&lt;p&gt;The natural objection: "What about a bulk import? A user imports 500 records at once, and each fires a trigger."&lt;/p&gt;

&lt;p&gt;This is a valid concern but a different problem:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Bulk imports via API&lt;/strong&gt; publish a single aggregate event (&lt;code&gt;records_bulk_created&lt;/code&gt;), not 500 individual events. Event-driven triggers don't match on the aggregate event, so they don't fire at all.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Batch operations from compute functions&lt;/strong&gt; do publish individual events. But even 500 trigger executions from a batch operation is a one-time burst, not a sustained loop. If your rate limit window is 60 seconds, the burst registers once. A loop registers continuously.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;If batch-triggered functions need to fire triggers&lt;/strong&gt;, the rate limit should be configurable per-trigger. Default 100/60s works for 99% of cases. The 1% that needs more can raise it.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Implementing the Test
&lt;/h2&gt;

&lt;p&gt;The simplest implementation is a Redis counter with a TTL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;isWithinRateLimit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;triggerId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`trigger_rate:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;triggerId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;incr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;expire&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Six lines. The &lt;code&gt;INCR&lt;/code&gt; is atomic (no race conditions across instances), the &lt;code&gt;EXPIRE&lt;/code&gt; handles cleanup, and the threshold separates linear from exponential with a 10x margin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beyond Rate Limiting
&lt;/h2&gt;

&lt;p&gt;Rate limiting is the safety net, not the whole solution. For a complete defense:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Block obvious loops at configuration time.&lt;/strong&gt; When a user creates a trigger on &lt;code&gt;record_created&lt;/code&gt; for collection X, and the function calls &lt;code&gt;api.createRecord('X', ...)&lt;/code&gt;, reject it with a clear error. This is prevention, not detection.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Track causality at runtime.&lt;/strong&gt; Propagate a &lt;code&gt;sourceTriggerId&lt;/code&gt; through event chains so you can identify self-loops without waiting for the rate limit to trip. The user gets a "recursive loop detected" message instead of a vague "rate limit exceeded."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Rate limit as the catch-all.&lt;/strong&gt; For cross-trigger chains (A→B→A) and exotic patterns that bypass the first two layers.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We wrote a detailed post about implementing all three layers: &lt;a href="https://medium.com/@olowu.marydan/how-we-stopped-recursive-trigger-loops-from-melting-our-compute-fleet-498a4cb3e5d0" rel="noopener noreferrer"&gt;How We Stopped Recursive Trigger Loops From Melting Our Compute Fleet&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Takeaway
&lt;/h2&gt;

&lt;p&gt;If your platform has event-driven triggers, ask yourself: can a trigger's output become its own input? If yes, you need loop protection. And the simplest, most reliable loop protection is a rate limit set in the gap between linear user-driven traffic and exponential recursive behavior.&lt;/p&gt;

&lt;p&gt;That gap is enormous. Use it.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Building event-driven infrastructure? We'd love to hear about your trigger architecture challenges. Reach out on [Twitter/X] @centraliio or drop a comment.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>eventdrivenarchitecture</category>
      <category>recursionprevention</category>
      <category>platformengineering</category>
      <category>ratelimiting</category>
    </item>
  </channel>
</rss>
