<?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: Pierre POMES</title>
    <description>The latest articles on DEV Community by Pierre POMES (@ppomes).</description>
    <link>https://dev.to/ppomes</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%2F3758491%2Fc1ac2dcd-6666-4a37-a6aa-fe3ce9ff468f.jpeg</url>
      <title>DEV Community: Pierre POMES</title>
      <link>https://dev.to/ppomes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ppomes"/>
    <language>en</language>
    <item>
      <title>myanon — how I anonymize 200GB of MySQL nightly for GDPR-safe dev</title>
      <dc:creator>Pierre POMES</dc:creator>
      <pubDate>Wed, 11 Feb 2026 13:33:44 +0000</pubDate>
      <link>https://dev.to/ppomes/myanon-how-i-anonymize-200gb-of-mysql-nightly-for-gdpr-safe-dev-2foi</link>
      <guid>https://dev.to/ppomes/myanon-how-i-anonymize-200gb-of-mysql-nightly-for-gdpr-safe-dev-2foi</guid>
      <description>&lt;p&gt;I've been managing MySQL infrastructure for over 15 years. One problem that never had a clean solution: getting production data to developers safely.&lt;/p&gt;

&lt;p&gt;With large databases, the usual approach — dump, load, then anonymize — takes forever. I needed something that anonymizes on-the-fly, during the dump itself.&lt;/p&gt;

&lt;p&gt;Every night, I transfer around 200GB of production databases. By morning, developers have fresh, realistic data to work with — fully anonymized, GDPR-safe. One command, no intermediate files.&lt;/p&gt;

&lt;h2&gt;
  
  
  The workflow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mysqldump mydb &lt;span class="se"&gt;\&lt;/span&gt;
  | &lt;span class="nb"&gt;tee&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;(&lt;/span&gt;myanon &lt;span class="nt"&gt;-f&lt;/span&gt; myanon.conf | &lt;span class="nb"&gt;gzip&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; mydb_anon.sql.gz&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  | gpg &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; me@domain.com &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; mydb.sql.gz.gpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Real backup goes to GPG, anonymized version goes to gzip. Two outputs, one pass, no temp files.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Streaming&lt;/strong&gt;: anonymizes on-the-fly&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast, low memory&lt;/strong&gt;: tables not in config pass straight through — no unnecessary parsing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single binary&lt;/strong&gt;: written in C, easy to deploy — also available as a Docker image&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;secret = 'your_hmac_secret'

tables = {
  `users` = {
    `name`  = texthash 8
    `email` = emailhash 'example.com' 20
    `phone` = fixednull
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Deterministic hashing&lt;/strong&gt;: same input → same output. Foreign keys just work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Built-in features&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hash names, emails, integers&lt;/li&gt;
&lt;li&gt;Set fields to NULL or fixed values&lt;/li&gt;
&lt;li&gt;Anonymize inside JSON columns&lt;/li&gt;
&lt;li&gt;Truncate entire tables&lt;/li&gt;
&lt;li&gt;And more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Extensible&lt;/strong&gt;: need realistic names? Plug in Python functions (e.g., Faker).&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Website&lt;/strong&gt;: &lt;a href="https://myanon.io" rel="noopener noreferrer"&gt;https://myanon.io&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/ppomes/myanon" rel="noopener noreferrer"&gt;https://github.com/ppomes/myanon&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker&lt;/strong&gt;: &lt;code&gt;docker pull ppomes/myanon&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ubuntu PPA&lt;/strong&gt;: &lt;a href="https://launchpad.net/%7Epierrepomes/+archive/ubuntu/myanon" rel="noopener noreferrer"&gt;https://launchpad.net/~pierrepomes/+archive/ubuntu/myanon&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feedback welcome — open an issue if you hit an edge case.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;How do you get production data to developers safely?&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mysql</category>
      <category>opensource</category>
      <category>database</category>
      <category>security</category>
    </item>
  </channel>
</rss>
