<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Paganel</title>
    <subtitle>Copies your tables between systems, and tells you row by row if a copy ever stops matching.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://paganel-dev.github.io/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://paganel-dev.github.io"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-10-21T00:00:00+00:00</updated>
    <id>https://paganel-dev.github.io/atom.xml</id>
    <entry xml:lang="en">
        <title>Paganel: migrations with a receipt</title>
        <published>2026-10-21T00:00:00+00:00</published>
        <updated>2026-10-21T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://paganel-dev.github.io/blog/migrations-with-a-receipt/"/>
        <id>https://paganel-dev.github.io/blog/migrations-with-a-receipt/</id>
        
        <content type="html" xml:base="https://paganel-dev.github.io/blog/migrations-with-a-receipt/">&lt;p&gt;Paganel is a single-binary tool that moves data and schema between systems,
then proves the destination still matches what it wrote, down to the row.
It&#39;s open source (AGPL) and written in Rust.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://paganel-dev.github.io/blog/migrations-with-a-receipt/demo.gif&quot; alt=&quot;Terminal recording: pag verify reports both tables matching, one row in the actor table is edited by hand with psql, and a second pag verify reports a mismatch pointing at actor_id=5 as the changed row.&quot; /&gt;&lt;/p&gt;
&lt;h2 id=&quot;where-it-came-from&quot;&gt;Where it came from&lt;a class=&quot;zola-anchor&quot; href=&quot;#where-it-came-from&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Paganel comes from an old work problem: I had a large schema migration with
lots of transformations and several environments to check. One of the main
requirements was to validate whether the data had moved correctly, and I was
not allowed to use any SaaS tools because it was forbidden for data to leave
our network. Since I couldn&#39;t find any air-gapped tool that could do both the
transformation and the verification (basic row counts aren&#39;t enough for
transformed data), I had to write custom scripts for the entire process.&lt;/p&gt;
&lt;p&gt;Ever since then, the idea of automating complex migrations has stuck in my
head, which led me to start building Paganel a year and a half ago.&lt;/p&gt;
&lt;h2 id=&quot;one-file-per-migration&quot;&gt;One file per migration&lt;a class=&quot;zola-anchor&quot; href=&quot;#one-file-per-migration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In Paganel, a migration is just a single declarative file. You specify where
the data comes from and where it&#39;s going, and the rest goes in the same file:
joins, filters, computed fields, and validation rules.&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#4C4F69, #CDD6F4); background-color: light-dark(#EFF1F5, #1E1E2E);&quot; &gt;&lt;code data-lang=&quot;hcl&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#DF8E1D, #F9E2AF);font-style: italic;&quot;&gt;connection&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt; &amp;quot;source&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  driver&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;mysql&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  url&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt;    =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#D20F39, #F38BA8);font-style: italic;&quot;&gt; env&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;MYSQL_URL&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#DF8E1D, #F9E2AF);font-style: italic;&quot;&gt;connection&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt; &amp;quot;dest&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  driver&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;postgres&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  url&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt;    =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#D20F39, #F38BA8);font-style: italic;&quot;&gt; env&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;POSTGRES_URL&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#DF8E1D, #F9E2AF);font-style: italic;&quot;&gt;pipeline&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt; &amp;quot;customers&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#DF8E1D, #F9E2AF);font-style: italic;&quot;&gt;  from&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt; {&lt;/span&gt;&lt;span&gt; connection&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt; =&lt;/span&gt;&lt;span&gt; connection&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt;.&lt;/span&gt;&lt;span&gt;source&lt;/span&gt;&lt;span&gt; table&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;customers&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#DF8E1D, #F9E2AF);font-style: italic;&quot;&gt;  to&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;   {&lt;/span&gt;&lt;span&gt; connection&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt; =&lt;/span&gt;&lt;span&gt; connection&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt;.&lt;/span&gt;&lt;span&gt;dest&lt;/span&gt;&lt;span&gt;   table&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;customers&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt; mode&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#DF8E1D, #F9E2AF);font-style: italic;&quot;&gt;  where&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt; &amp;quot;active&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    customers&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt;.&lt;/span&gt;&lt;span&gt;deleted_at&lt;/span&gt;&lt;span&gt; is &lt;/span&gt;&lt;span style=&quot;color: light-dark(#D20F39, #F38BA8);&quot;&gt;null&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#DF8E1D, #F9E2AF);font-style: italic;&quot;&gt;  select&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    id&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt;    =&lt;/span&gt;&lt;span&gt; customers&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt;.&lt;/span&gt;&lt;span&gt;id&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    name&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt;  =&lt;/span&gt;&lt;span&gt; customers&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt;.&lt;/span&gt;&lt;span&gt;name&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    email&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#D20F39, #F38BA8);font-style: italic;&quot;&gt; lower&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#D20F39, #F38BA8);font-style: italic;&quot;&gt;trim&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;(&lt;/span&gt;&lt;span&gt;customers&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt;.&lt;/span&gt;&lt;span&gt;email&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Save it as &lt;code&gt;customers.ppl&lt;/code&gt; and run:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#4C4F69, #CDD6F4); background-color: light-dark(#EFF1F5, #1E1E2E);&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;pag&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; plan&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;   -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; customers.ppl&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);font-style: italic;&quot;&gt;              #&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);font-style: italic;&quot;&gt; schema, DDL, estimates, sample rows&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;pag&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; apply&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;  -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; customers.ppl&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;-integrity&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);font-style: italic;&quot;&gt;  #&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);font-style: italic;&quot;&gt; migrate and write the receipt&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;pag&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; verify&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; customers.ppl&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);font-style: italic;&quot;&gt;              #&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);font-style: italic;&quot;&gt; check the destination against the receipt&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you are missing a specific source, sink, transform, or filter, you can
easily extend Paganel by writing your own WASM plugin in Rust or JS. These
execute inside a strict sandbox, so they don&#39;t have any filesystem or network
access unless you allow it in the migration config.&lt;/p&gt;
&lt;p&gt;I also wanted to make large migrations simple, so before running a real
migration, you can run &lt;code&gt;pag plan&lt;/code&gt; to review the output schema, the DDL, and
the time and memory estimates. You can also use the plan to see a sample of
real rows. They get processed through the whole pipeline, which gives you
absolute clarity on what will actually be inserted.&lt;/p&gt;
&lt;h2 id=&quot;the-receipt&quot;&gt;The receipt&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-receipt&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;One of the biggest challenges isn&#39;t just doing the migration, but verifying
that everything actually moved correctly. For that, there is the
&lt;code&gt;--integrity&lt;/code&gt; flag. Pass it, and Paganel hashes the rows on the fly as they
migrate, storing those hashes on disk, keyed by primary key. After the run,
it uses them to spit out a 32-byte root hash for the table. Together with the
row hashes, this gives you a complete &quot;migration receipt.&quot;&lt;/p&gt;
&lt;p&gt;Minutes or weeks later, you can run &lt;code&gt;pag verify&lt;/code&gt;, and it re-reads the
destination, recomputes the hashes and compares them with the receipt,
without connecting to the source. When the root doesn&#39;t match, you know
something changed, and then verify goes through the row hashes and tells you
which rows it was.&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#4C4F69, #CDD6F4); background-color: light-dark(#EFF1F5, #1E1E2E);&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; pag&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; apply&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;  -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; examples/configs/merkle.ppl&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; .env&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;-integrity&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; pag&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; verify&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; examples/configs/merkle.ppl&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; .env&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;✓&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; migrate_actor/actor&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; match&lt;/span&gt;&lt;span&gt; (200&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; rows,&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; root&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; 2424b83ccd0a9852426c011ad58bd8af43696f295b03ed15c77dfdd9115b3553,&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; 21ms&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);font-style: italic;&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);font-style: italic;&quot;&gt; hand-edit one row on the destination, then verify again&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; psql&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span&gt;$&lt;/span&gt;&lt;span&gt;DEST_URL&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;UPDATE actor SET last_name = &amp;#39;TAMPERED&amp;#39; WHERE actor_id = 5&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; pag&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; verify&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; examples/configs/merkle.ppl&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; .env&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;✗&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; migrate_actor/actor&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; MISMATCH&lt;/span&gt;&lt;span&gt; (0&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; missing,&lt;/span&gt;&lt;span style=&quot;color: light-dark(#FE640B, #FAB387);&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; changed,&lt;/span&gt;&lt;span style=&quot;color: light-dark(#FE640B, #FAB387);&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; extra&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt; 200&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; rows&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; expected,&lt;/span&gt;&lt;span style=&quot;color: light-dark(#FE640B, #FAB387);&quot;&gt; 200&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; found&lt;/span&gt;&lt;span style=&quot;color: light-dark(#7C7F93, #9399B2);&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt; 19ms&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;  expected&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; root&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; 2424b83ccd0a9852426c011ad58bd8af43696f295b03ed15c77dfdd9115b3553&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;  actual&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;   root&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; 014c68b47d327dd3779c68b06476294d9e8db65d70d339f06d2b4003d1dc240a&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  actor_id&lt;/span&gt;&lt;span style=&quot;color: light-dark(#179299, #94E2D5);&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; changed:&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; expected&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; e0e4fb52b84373ee&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; actual&lt;/span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; 193e5586b0ed90af&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It exits non-zero on a mismatch, so you can run it in cron or CI.&lt;/p&gt;
&lt;p&gt;It tells you that the destination still contains what Paganel wrote, but it
can&#39;t tell you whether the transformation itself was correct.&lt;/p&gt;
&lt;h2 id=&quot;speed&quot;&gt;Speed&lt;a class=&quot;zola-anchor&quot; href=&quot;#speed&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Another huge factor is migration speed. I created a small benchmark to
measure Paganel&#39;s speed and tested it on a 100M-row migration from MySQL to
PostgreSQL (with the databases on separate servers). With the default config,
which is a single stream, I got about 390k rows a second. Splitting the table
into four parallel streams got it to almost 940k. The number of streams is
configurable for tables with an integer primary key. Enabling the
&lt;code&gt;--integrity&lt;/code&gt; flag does add some overhead, dropping those numbers to 340k
and 670k, respectively.&lt;/p&gt;
&lt;h2 id=&quot;rough-edges&quot;&gt;Rough edges&lt;a class=&quot;zola-anchor&quot; href=&quot;#rough-edges&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Paganel is still pre-v1.0, so there are some rough edges to be aware of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No CDC yet:&lt;/strong&gt; Currently, it only handles batch processing. Continuous
sync with verification is the ultimate goal, but nailing the batch engine
comes first.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Limited sources:&lt;/strong&gt; Right now, Paganel natively supports MySQL,
PostgreSQL and CSV.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;API changes:&lt;/strong&gt; The project is under heavy development, meaning the
config syntax might change slightly from release to release.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One-man team:&lt;/strong&gt; I&#39;m developing this solo. You will likely run into edge
cases I haven&#39;t caught yet.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Platform testing:&lt;/strong&gt; The full integration suite and all my own manual
testing run on Linux. macOS and Windows get pre-built binaries too, and
every release runs a real migration and verify on each of them, but that&#39;s
much less coverage than Linux gets.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;what-s-next&quot;&gt;What&#39;s next&lt;a class=&quot;zola-anchor&quot; href=&quot;#what-s-next&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A receipt checks a copy once. The next step is checking it again and again,
because copies drift after they&#39;re made. Here&#39;s what I&#39;m working on, none
of it released yet:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Drift checks:&lt;/strong&gt; re-run verify on a schedule and send a daily report of
what stopped matching.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Comparing two live databases:&lt;/strong&gt; point Paganel at a source and a
destination it didn&#39;t copy, read-only on both sides, and get the rows
that differ.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Repair:&lt;/strong&gt; re-copy only the rows that differ, then verify again.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After that, Postgres CDC, so the copy stays in sync continuously and is
checked the same way.&lt;/p&gt;
&lt;h2 id=&quot;try-it&quot;&gt;Try it&lt;a class=&quot;zola-anchor&quot; href=&quot;#try-it&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The quickstart in the README spins up some sample databases in Docker for
you: &lt;a rel=&quot;external&quot; href=&quot;https://github.com/stanstork/paganel&quot;&gt;https://github.com/stanstork/paganel&lt;/a&gt;&lt;/p&gt;
</content>
        
    </entry>
</feed>
