← Back to articles

PostgreSQL or MySQL for Business: What to Choose for a New Project

PostgreSQL and MySQL are the two most popular relational databases for web projects. The choice is made at the start of development and affects hosting cost, ease of hiring developers, analytics capabilities, and migration complexity 2-3 years later. For a business owner this is not a "technical detail" but a decision on the level of "Excel or CRM": a mistake in the spec costs more than an hour of discussion with the contractor before signing the contract.

  • MySQL - the standard for WordPress, PHP hosting, and typical online stores
  • PostgreSQL - often chosen for Django, SaaS, complex analytics, and strict data rules
  • Both - SQL databases: orders, customers, and products live in linked tables
  • Main criterion - not "what is trendier" but project stack, hosting budget, and growth plans
  • Switching DB later - possible, but costs $3,000 - $30,000+ and 2-8 weeks of work
  • Risk - choosing PostgreSQL "for the future" for a simple landing page or MySQL for a complex platform

PostgreSQL and MySQL in Plain Language

MySQL and PostgreSQL are server programs that store business data in tables: customers, orders, products, invoices, logs. The site and CRM do not write data into HTML files - they send commands in SQL, and the database returns rows and numbers.

Both systems:

  • support millions of records when configured properly;
  • support backups as .sql files;
  • work with PHP, Python, Node.js, and any modern framework;
  • require separate hosting or a VPS - not "a folder on FTP".

MySQL historically dominates shared hosting and CMS: WordPress, OpenCart, Bitrix, Laravel out of the box often ship with MySQL. For more on where orders and users are stored, see MySQL in plain language.

PostgreSQL is more often deployed on VPS and cloud, and is the default recommendation for Django/Python and many SaaS architectures. Strengths include strict data integrity, JSON, geodata, full-text search, and complex reports.

Criterion MySQL PostgreSQL
Typical stack WordPress, PHP, Bitrix, OpenCart Django, FastAPI, Ruby on Rails, enterprise
Hosting Available on almost any plan from $3/mo Often VPS/cloud from $10-20/mo
Developer entry barrier Lower, more specialists on the market Higher, but enough for the Python stack
Data integrity More flexible, faster on simple schemas Stricter: fewer "silent" errors
JSON and flexible fields Yes (since version 8) Stronger out of the box
Analytics and reports Good for typical tasks Better for complex JOINs and window functions
License Open source (Oracle) / MariaDB Open source (PostgreSQL License)

When to Choose MySQL

MySQL is a sensible default if the project does not go beyond typical web scope:

WordPress, WooCommerce, Bitrix, OpenCart

CMS and shop engines are built for MySQL. Hosting with one-click "Install WordPress" almost always means MySQL or MariaDB (compatible fork). Switching to PostgreSQL "because it is trendy" adds risk without benefit.

Limited infrastructure budget

On shared hosting MySQL is included in the plan. PostgreSQL often requires a VPS, managed DB, or cloud instance - an extra $10-50/mo and sometimes a separate line in the estimate.

PHP team and contractor

PHP developers and agencies massively work with MySQL. Fewer surprises when changing contractors, easier to find support locally.

Simple data schema

A catalog up to 50,000 SKUs, orders, users, blog, forms - MySQL handles this for years. The bottleneck is more often code, cache, and hosting, not the DB choice.

Signals "MySQL is enough":

  • site on PHP and WordPress;
  • no requirements for complex in-database analytics;
  • hosting budget up to $30-50/mo;
  • team does not plan migration to Django within a year.

When to Choose PostgreSQL

PostgreSQL makes sense when data is the core of the product, not "storage for a CMS":

Custom platform on Python/Django

Django officially recommends PostgreSQL. ORM, migrations, full-text search, JSONField, PostGIS for maps - all of this works better with PostgreSQL. Django runs on MySQL too, but some features are trimmed or need workarounds.

Complex business logic and strict rules

Multiple warehouses, multi-currency, complex discounts, approval flows, audit log of "who changed the amount" - PostgreSQL enforces integrity more strictly. Fewer cases of "order without line items" or "two managers overwrote the same cell".

Analytics, reports, BI inside the DB

If leadership wants answers like "margin by region including returns over 18 months" without weekly Excel exports - PostgreSQL is more convenient for complex SQL, window functions, and materialized views.

JSON, integrations, event log

SaaS, API-first products, event logging, flexible product attributes - PostgreSQL handles semi-structured data better. MySQL has caught up in part, but the ecosystem and docs for JSON tasks are richer with PostgreSQL.

Scaling plans and multiple services

Microservices, a separate analytics service, read-only replicas for reports - PostgreSQL is more often chosen in growth architectures. That does not mean "Kubernetes on day one", but there is more headroom.

Signals "PostgreSQL is needed":

  • development on Django, FastAPI, Rails with custom logic;
  • e-commerce or B2B portal without a ready-made CMS;
  • requirements for audit trail, roles, complex relations;
  • product planned to live 5+ years with growing features.

Comparison by Business Scenario

Scenario Recommendation Why
Corporate site on WordPress MySQL / MariaDB CMS standard, cheap hosting
Online store on OpenCart / Bitrix MySQL Compatibility, contractors, plugins
SaaS MVP on Django PostgreSQL Stack, JSON, migrations, scale
Marketplace with custom logic PostgreSQL Complex relations, transactions, reports
Landing + CRM via Zapier CRM database, not your choice Site may not need its own DB
Migration from WP to Python PostgreSQL Logical step with stack change
Startup "validate idea in 2 weeks" MySQL on cheap VPS or PostgreSQL on managed DB Speed matters more than MySQL vs PG debate

Rule for executives: ask the contractor "which stack do you recommend and why", not "what is better on the internet". Answers "MySQL because WordPress" and "PostgreSQL because Django" are both fine if tied to your project.

Hosting, Cost, and Operations

MySQL

  • Shared hosting - often $3-15/mo with phpMyAdmin and auto-backup;
  • VPS - MySQL is free, you pay for the server $5-40/mo;
  • Managed MySQL (AWS RDS, DigitalOcean) - from $15/mo, less hassle with updates.

PostgreSQL

  • Shared hosting - rare; look for "PostgreSQL hosting" or VPS;
  • VPS + self-hosted - $10-40/mo, needs admin or DevOps support;
  • Managed PostgreSQL - from $15-25/mo, convenient for production without your own DBA.
Cost item MySQL (typical) PostgreSQL (typical)
Hosting at start $0-15/mo (included) $15-40/mo
Backups In hosting panel Configure explicitly or use managed
Support Any PHP freelancer More often Python/backend specialist
Migration on growth To PostgreSQL: $5,000-20,000 To MySQL less often, but possible

Hidden costs - not the license (both open source), but team time: wrong indexes, no backups, one password for all projects. Equally dangerous for MySQL and PostgreSQL.

What to Ask the Contractor Before Start

  1. Which framework and CMS? WordPress → MySQL. Django → PostgreSQL. Mismatch is a red flag.
  2. Where will the DB live? Shared, VPS, managed cloud - and who runs backups.
  3. Data migration plan - if you already have Excel or an old DB, how they will transfer it.
  4. DB version - MySQL 8+ or MariaDB 10.6+, PostgreSQL 15+; not 5.7 "because the host has it".
  5. Can we change DB in 2 years? - "yes, but expensive" is more honest than "you will never need it".

Record the choice in the technical specification in one line: "DBMS: PostgreSQL 16 on managed DigitalOcean" or "MySQL 8, WordPress 6.x compatible". That prevents disputes at acceptance.

Summary: A Practical Decision Flow

WordPress / PHP / ready CMS     →  MySQL (or MariaDB)
Django / FastAPI / custom SaaS  →  PostgreSQL
Unknown stack, budget <$20/mo   →  MySQL on proven hosting
Complex data, long-lived product →  PostgreSQL

MySQL is the right choice for a typical site and store on popular CMS: cheaper, simpler, more hosts and contractors. PostgreSQL is for products where the database is part of competitive advantage: custom logic, analytics, strict rules, Python stack.

Do not choose PostgreSQL "for the future" for a WordPress blog - you overpay for infrastructure and complicate support. Do not choose MySQL "because it is cheaper" for SaaS on Django - you get limits and technical debt from sprint one.

Discuss the choice before signing a 6-month development contract. Changing DBMS after launch is not a disaster, but it is always a separate project with risk to data and SEO.

Frequently Asked Questions

Can we migrate from MySQL to PostgreSQL later?

Yes, but it is a migration. Export schema and data, fix field types, tests, downtime overnight or on a weekend. Budget $3,000 - $30,000+ and 2-8 weeks depending on volume. If you are sure about moving to Django within a year - it is smarter to plan PostgreSQL upfront than pay twice for migration.

What do WordPress and Laravel use by default?

WordPress - MySQL or MariaDB; other options on typical hosting are rare. Laravel officially supports MySQL, PostgreSQL, SQLite, and SQL Server - the team chooses. For Laravel on cheap shared hosting MySQL is more common; for API and SaaS on VPS - increasingly PostgreSQL.

Is PostgreSQL required for complex analytics?

No, but more convenient. Complex reports can be built on MySQL, exported to BI (Metabase, Power BI), or handled in Python with pandas. PostgreSQL wins when heavy analytics lives in the same DB as transactions, or when you need advanced SQL without a separate warehouse.

How much does PostgreSQL vs MySQL hosting cost?

MySQL on shared - often $0-15/mo (included). PostgreSQL on managed - usually $15-40/mo at start. The difference of $100-300/year is small compared to development cost, but noticeable for a "business card" site. For a product with revenue the difference is negligible; for a WordPress MVP - MySQL is more economical.

What if the team only knows MySQL?

For WordPress and PHP - not a problem. For Django/SaaS - find a team with PostgreSQL experience or budget for training and managed hosting with monitoring. Running PostgreSQL "blind" without backups and without understanding migrations is riskier than a deliberate MySQL on a mature stack. What matters is an honest skills assessment, not the DBMS name on a resume.

Contacts