Skip to content
AKRAmit Kumar Raikwar
All posts
Engineering4 min read

MongoDB by default, Postgres when I have to

I reach for MongoDB first on most projects. This is the honest version of why, including the cases where that choice has cost me.

DatabasesMongoDBPostgreSQL

Most of what I ship runs on MongoDB. Edgvance, Recuvix, NovaEdge Academy, the news pipeline. When someone asks why, the answer people expect is something about scale. That is not it.

It is that in the first six weeks of a product the shape of the data is still moving. A course document grows a field. An order picks up a status nobody planned for. With a document store I change the code and move on. With a relational schema I write a migration, and at that stage of a project I will write twenty of them.

Where that stops being true

It stops being true the moment correctness across several tables matters more than speed of change. Money is the clearest case. If a transfer has to leave one balance and arrive in another, or neither, a document store makes me build that guarantee by hand, and hand-built transactional logic is exactly the code I do not want to be responsible for.

The same applies to anything where the references run deep. Permissions that cascade. Invoices with line items that must sum. Reporting that joins five ways and has to be right. Postgres is built for that and I am not going to out-engineer it in application code.

The question is not which database is better. It is whether the hard part of this product is the shape of the data changing or the relationships between the data holding.

Where I let it run too long

On one project I kept an order model in MongoDB well past the point where it should have moved. Order state, payment state and inventory all had to agree, and keeping them in agreement turned into a growing pile of defensive code and idempotency checks. It works and it is replay-safe now. It also took longer than a schema and a transaction would have.

I do not regret starting where I started. I regret not noticing the signal, which was clear enough in hindsight: I was writing code whose only job was to protect invariants a database will protect for you.

How I decide now

Two questions, before the first line of the model.

Does anything in here have to be correct across more than one record at once? If yes, Postgres, even for the MVP, because retrofitting that guarantee is the expensive version.

Is the schema going to hold still for the next month? If no, MongoDB, and revisit it when it does.

That is most of it. The rest is noise people argue about online, and the argument is usually between two people building different things.

Frequently asked questions

When should I choose MongoDB over PostgreSQL?
Choose MongoDB when building early-stage MVPs with rapidly evolving document schemas or catalog structures. Choose PostgreSQL when your data requires ACID transactions across deeply relational tables.
Is MongoDB suitable for production applications at scale?
Yes. Proper indexing, document sizing, and replica set configuration allow MongoDB to power large production applications efficiently.

Written by Amit Kumar Raikwar, full-stack engineer & product designer in Indore, India. If you want something built, start here.

Working on something?

Let's build it together.

I take projects from an empty Figma file to a live product. Fixed scope, weekly demos, code you own.