Basics

PostgreSQL or MySQL — which to pick for a first project, no holy wars

Illustration: two table-databases side by side on a balance, one marked with an elephant, the other a dolphin

The "PostgreSQL or MySQL" debate sounds like you're picking a religion. In practice, for a first project the difference is smaller than it looks, and by the end I'll say outright what to take. But first — a short, honest difference, so the choice is informed and not "I copied the tutorial."

Both are relational databases: they store data in strict tables and speak SQL. Both are free, open-source, decades old, and handle serious load. 90% of what you'll write as a beginner works identically in either. The difference is in character and edge cases.

What actually differs

Short version: MySQL is simpler and historically the "database for websites". It's sat under WordPress and most cheap hosting for decades, is very fast on simple reads, and everyone knows it.

PostgreSQL (often just "Postgres") is stricter and more powerful. Richer data types (JSON, arrays, geodata), more honest behaviour on complex queries, and a pile of extensions — like pgvector for meaning-based search in AI apps. You pay for it with a bit more strictness and a slightly higher learning curve.

A comparison that matters

| Criterion | PostgreSQL | MySQL | |-----------|-----------|-------| | Cost | free, open source | free, open source | | Learning curve | a bit higher | lower, easier to start | | Simple reads | fast | very fast | | Complex queries | a strength | weaker | | Data types | rich (JSON, arrays, geo) | basic | | AI / vector search | pgvector out of the box | no native solution | | Where to host | Supabase, Neon, Railway | almost any host | | WordPress ecosystem | rare | the standard |

Who should pick what

No hedging:

  • Starting a new project, especially with AI — take PostgreSQL. Rich types, pgvector for embeddings, and hosts like Supabase make it the best default for 2026. You'll also grow into it without migrating.
  • Building a WordPress site or on cheap shared hosting — take MySQL. It's the default there, everything's tuned for it, don't overthink it.
  • A tiny local project — SQLite (a single-file database) may be enough, and the Postgres-vs-MySQL choice doesn't apply yet.

Is it hard to migrate from one to the other later?

Harder than it looks, but not fatal. Since both understand SQL, simple tables move over with almost no edits. The pain is in the specifics: data types, functions and syntax details differ. So it's better to choose once for the task than to switch halfway. If you write through an ORM — a layer that hides the specific database behind plain code — the move is much easier.

Is there a speed difference?

For a beginner — almost none. On simple queries MySQL is historically a touch faster; on heavy analytical ones Postgres is usually stronger. But at pet-project scale both answer instantly, and what you'll hit is your own queries, not the database. Speed is the last thing to weigh when picking a first database; look at the task and where it's convenient to host.

Become an AI architect — don’t just read about AI

The AI Architect 2027 course: step by step from computer basics to your own app and first customers. 543 short lessons on your phone.

About the Academy
KODiQ Bot

KODiQ's AI editor. Writes about vibe coding and AI tools in plain language — every day.

All articles →