Postgres vs MySQL for Business Applications

Most Postgres vs MySQL advice ignores migrations, backups, JSONB, and cost at 50 lakh rows. Here's what actually bites mid-project.

Maysan Engineering Team · · 5 min read

Xin

The database decision gets made in week one, usually in an hour, usually by whoever argues hardest. The bill arrives much later: a lock that stalls the portal during a price update, a report that takes forty seconds, a migration that half-applies at 2am. If you are a CTO or founder signing off on a B2B portal, dashboard or internal tool, these are the Postgres vs MySQL trade-offs that only surface once the project is already underway.

Postgres vs MySQL for business applications: the short answer

For most Indian B2B applications, Postgres is the better default, and MySQL is the better choice when your team already runs it well or the workload is simple and read-heavy.

Both engines handle GST invoices, UPI webhook logs, multi-tenant portals and 50 lakh row tables without drama. The differences that actually change how you work are narrower than the internet suggests: transaction handling around schema changes, how each one indexes JSON, extensions, and the operational habits of whoever is on call at 11pm. None of those appear in a benchmark chart, and all of them show up by month three. So pick on operational fit and team fluency, not on a speed comparison you found on a forum.

Transactional DDL is the trade-off nobody mentions until month 14

Postgres runs schema changes inside a transaction, so a failed migration rolls back cleanly; MySQL commits each DDL statement on its own, so a failed migration can leave production half-changed.

Picture a migration that renames a column, backfills it and adds an index across 30 tables. On MySQL, if table 17 fails, you have 16 tables migrated, 14 not, and no rollback button. On Postgres you wrap the whole thing in a transaction and roll back to where you started. That single difference is why teams that change schema every week tend to drift towards Postgres.

It is not one-sided. MySQL 8 adds columns almost instantly with the INSTANT algorithm, and tools like gh-ost and pt-online-schema-change handle large tables well. Postgres still takes a brief exclusive lock for some ALTER TABLE operations, which hurts on a hot table. The real question is how often your schema changes, and what a half-applied migration would cost you at 9am on a Monday.

JSON columns look identical on day one and different at two lakh rows

Both engines store JSON, but Postgres indexes inside the document with GIN while MySQL needs a generated column and an index before the same filter is fast.

Say you build a client portal where each tenant adds custom fields, stored in one JSON column. At two lakh rows, someone wants to filter by GSTIN held inside that JSON. On Postgres you add a GIN index and the query drops to milliseconds, with no need to know the field names in advance. On MySQL you declare a generated column for gstin, index it, and it is fast too. But you had to know the field name, which quietly breaks the promise that customers can add any field they like.

  • Postgres: index the whole document, slower writes if you churn JSON heavily.
  • MySQL: index declared fields, fast, but the schema must be predicted upfront.
  • Both: the moment a JSON field becomes a join key or a report filter everyone uses, move it into a real column.

Backups and point-in-time recovery decide the 3am question

Both databases can restore to an arbitrary minute, but whether you actually can depends on your hosting, not your engine.

Postgres does this with WAL archiving, MySQL with the binary log. Managed services give you point-in-time recovery inside a retention window, typically 7 to 35 days, and that setting is easy to leave switched off on staging and then forget in production. Self-hosted, you own the archive, which means someone has to verify a restore rather than just verify the job runs. A realistic failure: an ERP sync writes 4,000 bad invoices at 11pm, and you need the state from 10:45pm, not last night's dump. Test the restore before you need it. The baseline we use for self-hosted boxes is in managed server setup.

Cost, hiring and lock-in pick more projects than benchmarks do

At Indian SMB scale, the deciding factor is almost always team fluency and the monthly managed bill, not query throughput.

A comparable managed instance on the major clouds lands within roughly 15 to 20 percent between the two engines, which is rarely enough to settle anything. Developer time settles it. A team that has run MySQL for eight years ships faster on MySQL, full stop, and moving them to Postgres costs you two months of unfamiliarity. The one genuine asymmetry worth knowing: Postgres extensions such as pg_trgm for fuzzy search, PostGIS for location and pgvector for embeddings can remove a separate service from your architecture, and that saving is real money every month. If you are weighing managed versus self-hosted for either engine, price both through cloud services at your actual size before committing.

Where to start

If the project is greenfield and nobody has a strong operational preference, default to Postgres. If your team already runs MySQL in production, stay there and put the effort into migrations, backups and indexing instead of a rewrite nobody asked for. Maysan Labs builds B2B platforms and internal tools on both engines, and we are happy to sanity-check the choice with you before you commit to one.

Buying software or a website?

Twelve questions to ask any vendor before you sign: price, your data, fit for an Indian business and support.

Get the free checklist

Written by Maysan Engineering Team at Maysan Labs, a software studio in Gurgaon, India. Follow us on LinkedIn