{"id":102,"date":"2026-10-29T04:30:46","date_gmt":"2026-10-29T04:30:46","guid":{"rendered":"https:\/\/mfarrasmajid.id\/?p=102"},"modified":"2026-10-29T04:31:42","modified_gmt":"2026-10-29T04:31:42","slug":"mysql-or-postgresql-does-it-matter-to-choose-which","status":"publish","type":"post","link":"https:\/\/mfarrasmajid.id\/?p=102","title":{"rendered":"MySQL or PostgreSQL, Does It Matter to Choose Which?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">When we develop a program, or an app, it is important to keep our data on some place. If you learn basic web app programming from Youtube or from other learning platform, you will be guided to choose MySQL as a starter database. MySQL is beginner friendly, easy to use, and versatile when it comes to intermediate level query. But there is other SQL version, which is PostgreSQL. So what is the difference between those two?<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/mfarrasmajid.id\/wp-content\/uploads\/2026\/10\/MySQL-vs-PostgreSQL_-Database-Showdown-1024x576.png\" alt=\"\" class=\"wp-image-103\" srcset=\"https:\/\/mfarrasmajid.id\/wp-content\/uploads\/2026\/10\/MySQL-vs-PostgreSQL_-Database-Showdown-1024x576.png 1024w, https:\/\/mfarrasmajid.id\/wp-content\/uploads\/2026\/10\/MySQL-vs-PostgreSQL_-Database-Showdown-300x169.png 300w, https:\/\/mfarrasmajid.id\/wp-content\/uploads\/2026\/10\/MySQL-vs-PostgreSQL_-Database-Showdown-768x432.png 768w, https:\/\/mfarrasmajid.id\/wp-content\/uploads\/2026\/10\/MySQL-vs-PostgreSQL_-Database-Showdown-1536x864.png 1536w, https:\/\/mfarrasmajid.id\/wp-content\/uploads\/2026\/10\/MySQL-vs-PostgreSQL_-Database-Showdown.png 1672w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">What is SQL?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">SQL is Structured Query Language. It is a programming language of which we can use to manage MySQL and PostgreSQL. MySQL and PostgreSQL is a database management system. Those two are the places we can store the database, and SQL is the language we can use to access them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The learning curve of SQL is quite lean. The core concept of the query is simple. But when it comes to complexes database which have tons of tables, it is quite challenging to optimize the syntax of the query. SQL language is quite a lot to explore, but we can grasp the core of SQL quite easy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, the <code>JOIN<\/code> syntax. There are many kind of <code>JOIN<\/code> syntax like <code>INNER JOIN<\/code> or <code>OUTER JOIN<\/code> which have different purposes, but the concept is the same, to join the columns of the tables. Same as <code>INSERT<\/code>, <code>UPDATE<\/code>, and <code>DELETE<\/code>, quite explanatory each of those syntax for the SQL.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/dev.to\/mfarrasmajid\/mysql-or-postgresql-does-it-matter-to-choose-which-1731#about-mysql-and-postgresql\"><\/a>About MySQL and PostgreSQL<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">MySQL is commonly used with web application, mostly with PHP and Javascript. Web applications store their user data, config data, and application data within MySQL. In PHP, they have mysqli extension which for some PHP installation is enabled by default. It is the interface for the web application to execute SQL Query to MySQL databases. The query which executed then returns output to the web application or changes data in the database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But when you familiar with enterprise application like ERP or HRIS, you will heard PostgreSQL much more often. PostgreSQL is a database, just like MySQL. They have quite similar query syntax on <code>INSERT<\/code>, <code>UPDATE<\/code>, or <code>DELETE<\/code>, but on some cases like incremental key, upsert, or concatenate, they have different syntax. PostgreSQL much optimized for bigger application for which they have optimized for larger databases and more complex queries.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/dev.to\/mfarrasmajid\/mysql-or-postgresql-does-it-matter-to-choose-which-1731#so-thats-it-more-optimized\"><\/a>So That&#8217;s It? More optimized?<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"196\" src=\"https:\/\/mfarrasmajid.id\/wp-content\/uploads\/2026\/10\/1_Yh7AM09GPXxYLxjdyLyEkA.png\" alt=\"\" class=\"wp-image-104\" srcset=\"https:\/\/mfarrasmajid.id\/wp-content\/uploads\/2026\/10\/1_Yh7AM09GPXxYLxjdyLyEkA.png 400w, https:\/\/mfarrasmajid.id\/wp-content\/uploads\/2026\/10\/1_Yh7AM09GPXxYLxjdyLyEkA-300x147.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Well, yes basically. PostgreSQL is more optimized to larger and complex databases.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The truth of deciding of which database to choose is based on what exactly the specifications do you need?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you only need database for simple web application for about 100 users which not concurrently using, it is better to use MySQL. The installation is simple and will fulfill your app&#8217;s need. MySQL interface on some programming language mostly pre-installed so it won&#8217;t be too much of a hassle to install your database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But if you need a more heavy load transaction and computation, most likely because your app used by a lot of concurrent users and maybe you will be using pgvector to use LLMs, you will need PostgreSQL. It is more optimized for larger <code>JOIN<\/code>s for much more relational tables and even can be setup as Vector Database for your LLMs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The more we know the capacity of those two database system, the better our app will perform.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When we develop a program, or an app, it is important to keep our data on some place. If you learn basic web app programming from Youtube or from other learning platform, you will be guided to choose MySQL as a starter database. MySQL is beginner friendly, easy to use, and versatile when it comes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":103,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-102","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-webdev"],"_links":{"self":[{"href":"https:\/\/mfarrasmajid.id\/index.php?rest_route=\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mfarrasmajid.id\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mfarrasmajid.id\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mfarrasmajid.id\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mfarrasmajid.id\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=102"}],"version-history":[{"count":1,"href":"https:\/\/mfarrasmajid.id\/index.php?rest_route=\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":105,"href":"https:\/\/mfarrasmajid.id\/index.php?rest_route=\/wp\/v2\/posts\/102\/revisions\/105"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mfarrasmajid.id\/index.php?rest_route=\/wp\/v2\/media\/103"}],"wp:attachment":[{"href":"https:\/\/mfarrasmajid.id\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mfarrasmajid.id\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mfarrasmajid.id\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}