MongoDB vs PostgreSQL
Two sides of the database decision: managed database and run it yourself. When each fits, what it costs, who moves from one to the other, and what makers who chose it say.
Which fits you
- Document-shaped data and teams already fluent in Mongo.
Use it whenYour team already knows Mongo, or your records vary so much in shape that a fixed schema gets in the way.
Trade-offNo joins or schema by default, so relational data and migrations take discipline you'd get for free in Postgres.
- You already run your own server and want a flat monthly cost
Use it whenYou already run a server, or want extensions and settings a managed provider doesn't offer.
Trade-offBackups, upgrades, failover and connection pooling are yours to set up and watch.
At a glance
| Used by | 131 makers' products · 148 open-source projects | 74 makers' products · 542 open-source projects |
|---|---|---|
| Cost at default usagedatabase size 8 GB, data transfer 50 GB, document or row reads 10 million reads, document or row writes 2 million writes | $58/mo Atlas Dedicated M10 | — |
| Moved to it on GitHubpull requests since Oct 2024 | 23 from PostgreSQL | 46 from MongoDB |
| Downloads | 14.5M/wk−45% vs npm | 45.1M/wk+18% vs npm |
| Pricing | Free Atlas tier; paid clusters by size. · paid from $0.011/hour | Free and open source under the PostgreSQL License; you pay only for the server or managed service that runs it. |
| Free tier | Yes | Yes |
| Open source | No · self-hostable | Yes · self-hostable |
| Incidents, 90 daysfrom its status page | 19 (7 major) | no public status feed |
Who moves from one to the other
Public pull requests on GitHub since Oct 2024 whose title says "MongoDB to PostgreSQL" or the reverse — real code changes, by developers in general rather than makers only.
- feat: migrate NestJS persistence from Prisma/Postgres to MongoDB (Mongoose)Diatech226/Bikiengasite · 2026-09-30
- transparency-service: Postgres to MongoDB Atlasaimozart/entropa-public · 2026-09-28
- Switch backend storage from Postgres to MongoDB.Debarun1205/valmont-financial-group · 2026-09-25
- Change the db from postgres back to mongodbBOL-DEV/zentry-backend · 2026-09-16
- Codewithbasu postgres to mongodbCodeWithBasu/Life-RPG · 2026-09-13
- feat: migrate Prisma/Postgres backend to MongoDB (Prisma 6, ObjectId)Diatech226/Maryme-backend · 2026-09-06
- feat(db): migrate primary data store from Postgres to MongoDBByte-Quill/user-management-system · 2026-08-06
- Move hq from Postgres to MongoDBzoworkhq/zoblocks · 2026-08-06
- Move logs from Postgres to MongoDBMuhammetAli2828/Ops_center · 2026-07-21
- Migrate chocolate-store from Postgres to MongoDBaninamu/chocolate-store · 2026-07-13
- refactor(db)!: migrate Payload CMS from MongoDB to Postgresm6-o4/payload-template-pg · 2026-09-25
- Migrate contact form storage from MongoDB to Supabase PostgresGreenbergEnterprise/greenberg-enterprisegroup-website · 2026-09-15
- Migrate persistence from MongoDB to Supabase Postgres (SQLAlchemy async)naheedroomy/valorantsl-new · 2026-08-14
- feat(db): move the data layer from MongoDB to Postgres with pgvectorjohnbekele/infracanvas · 2026-08-09
- Migrate ROI calculator from MongoDB Atlas to Neon PostgresAONIQQ/fastrackwebsite · 2026-08-06
- fix: rewire merchant read path from MongoDB to Postgres, delete Merch…Syed-web-coder/expense-project · 2026-07-27
- Migrate backend from MongoDB to Supabase Postgressatishkengam2017-ops/InvoiceAI · 2026-07-24
- feat: migrate database from MongoDB to Supabase Postgresfdrive422/React-Admin-Dashboard · 2026-07-14
- Migrate storage from MongoDB to Postgres, hosting from Render to Vercelprashanth-ds-ml/workhub-office-time-tracker · 2026-07-13
- migrate ConnectionRequest feature from MongoDB to Postgres (Drizzle)Dikshant441/merge_me · 2026-07-08
What makers say
Makers on using it for database, from Product Hunt and Starter Story interviews, each linked to the source. Products with a page of their own and fuller notes first.
Shoutout to MongoDB for providing a powerful, flexible database solution that scales with our needs. Your platform helps us manage and analyze vast amounts of data seamlessly!
…nd technology infrastructure: Amazon Web Services (AWS) , Google Analytics , Qovery , and MongoDB Email Marketing: Sendgrid Social Media: Buffer for automation and Canva for design Freela…
…>Salesforce , Hubspot , HeyMantle Customer Support: Intercom Insights: MixPanel Database: MongoDB Hosting: AWS Internal Communications: Slack Creative Design: Figma + Canva Video recordin…
Postgres is rock-solid. It handles complex data relationships gracefully and gives us the querying power we need as we scale. For relational data, it’s hands down the best choice for us.
We picked PostgreSQL over MongoDB and dedicated vector databases because one proven database handles our relational data, JSON and agent memory, with no extra stores to run.
Postgres is so nice to work with. pg_dump was a lifesaver when we had to move database providers. Extensions like pgvector make it the best database for building AI apps.
Loved and watch-outs
Themes that recur in makers' words and Hacker News comments, each linked to what it summarises.
- The flexible document model lets fast-changing products evolve their data without rigid migrations. PHPH 2PH 3HN
- Atlas starts on a free tier and handles scaling, backups and monitoring, so there is little database to manage. PHPH 2PH 3PH 4
- Atlas Vector Search keeps embeddings next to regular documents, so RAG and agent data combine vector and structured queries. PHHN
- Its history of unsafe defaults and lost writes left a lasting reputation that still keeps many developers away. HNHN 2HN 3HN 4
- Anything beyond simple reads and writes is hard, and aggregation pipelines feel primitive next to SQL, which costs more over time. HNHN 2
- Indexes are kept in memory, so larger datasets demand a lot of server RAM. HN
- It is rock-solid, keeps data consistent with strong transactions, and handles complex relational queries well. PHPH 2PH 3PH 4
- With pgvector, embeddings live next to relational data, so AI features need no separate vector database. PHPH 2PH 3PH 4
- Extensions and features like PostGIS, JSON support and advanced indexing cover geospatial and semi-structured data too. PHPH 2PH 3
- Built-in full-text search lacks corpus-wide relevance ranking like BM25 and can need very large indexes. HNHN 2
- It has no loose index scan, so SELECT DISTINCT over large tables needs manual workarounds. HNHN 2
- Timestamp versus timestamptz and AT TIME ZONE behavior are easy to get wrong, with edge-case bugs around daylight saving. HNHN 2HN 3

