<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Mysql on Özkan Pakdil Software Engineer</title>
    <link>https://ozkanpakdil.github.io/tags/mysql/</link>
    <description>Recent content in Mysql on Özkan Pakdil Software Engineer</description>
    <image>
      <title>Özkan Pakdil Software Engineer</title>
      <url>https://ozkanpakdil.github.io/images/papermod-cover.png</url>
      <link>https://ozkanpakdil.github.io/images/papermod-cover.png</link>
    </image>
    <generator>Hugo -- 0.148.2</generator>
    <language>en</language>
    <copyright>Özkan Pakdil</copyright>
    <lastBuildDate>Fri, 18 Sep 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://ozkanpakdil.github.io/tags/mysql/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>From MySQL to PostgreSQL: a much lighter server</title>
      <link>https://ozkanpakdil.github.io/posts/my_collections/2026/2026-09-18-mysql-to-postgresql-migration/</link>
      <pubDate>Fri, 18 Sep 2026 00:00:00 +0000</pubDate>
      <guid>https://ozkanpakdil.github.io/posts/my_collections/2026/2026-09-18-mysql-to-postgresql-migration/</guid>
      <description>&lt;p&gt;I recently migrated &lt;a href=&#34;https://www.mpazari.com&#34;&gt;mpazari.com&lt;/a&gt;, a Turkish motorcycle classifieds site, from MySQL 8 to PostgreSQL 12.&lt;/p&gt;
&lt;p&gt;The application is a Spring Boot 4 / Java 25 GraalVM native image using hand-written SQL. The migration involved moving the existing database, adapting the MySQL-specific queries, and testing the application against a real production snapshot.&lt;/p&gt;
&lt;p&gt;The migration was completed with approximately &lt;strong&gt;three minutes of downtime&lt;/strong&gt;. The main steps were:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create the PostgreSQL schema.&lt;/li&gt;
&lt;li&gt;Copy the MySQL data into PostgreSQL.&lt;/li&gt;
&lt;li&gt;Update the application queries for PostgreSQL.&lt;/li&gt;
&lt;li&gt;Run the test suite and verify the row counts.&lt;/li&gt;
&lt;li&gt;Stop the application, perform the final copy, switch the JDBC URL, and restart it.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;PostgreSQL&amp;rsquo;s stricter typing exposed a few old data and SQL issues that MySQL had silently accepted. The test suite helped find and fix those issues before the production cutover.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I recently migrated <a href="https://www.mpazari.com">mpazari.com</a>, a Turkish motorcycle classifieds site, from MySQL 8 to PostgreSQL 12.</p>
<p>The application is a Spring Boot 4 / Java 25 GraalVM native image using hand-written SQL. The migration involved moving the existing database, adapting the MySQL-specific queries, and testing the application against a real production snapshot.</p>
<p>The migration was completed with approximately <strong>three minutes of downtime</strong>. The main steps were:</p>
<ol>
<li>Create the PostgreSQL schema.</li>
<li>Copy the MySQL data into PostgreSQL.</li>
<li>Update the application queries for PostgreSQL.</li>
<li>Run the test suite and verify the row counts.</li>
<li>Stop the application, perform the final copy, switch the JDBC URL, and restart it.</li>
</ol>
<p>PostgreSQL&rsquo;s stricter typing exposed a few old data and SQL issues that MySQL had silently accepted. The test suite helped find and fix those issues before the production cutover.</p>
<h2 id="the-unexpected-result">The unexpected result</h2>
<p>The most interesting result was the server load.</p>
<p>With MySQL, <code>top</code> commonly showed a load average of around <strong>1.5</strong>. After switching to PostgreSQL, the same server and application workload usually showed a load average around <strong>0.3-0.5</strong>.</p>
<p>That is a significant improvement. The server feels much lighter, even though the database, application, indexes, and hardware are essentially the same.</p>
<p>This is not a formal benchmark. I did not run a controlled performance test or collect latency percentiles before and after the migration. It is simply a real production observation from the server while handling the same site traffic.</p>
<p>The database is relatively small, at about 131 MB, and both databases had the same application workload and indexes. So I cannot claim that PostgreSQL is universally faster than MySQL. For this particular application, however, PostgreSQL uses noticeably less server capacity.</p>
<h2 id="conclusion">Conclusion</h2>
<p>The migration reduced downtime and produced a much calmer server:</p>
<ul>
<li>MySQL: approximately <strong>1.5 load average</strong></li>
<li>PostgreSQL: approximately <strong>0.3-0.5 load average</strong></li>
</ul>
<p>The biggest lesson is simple: even when two databases support the same application, their behavior under a real workload can be surprisingly different.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
