You might’ve used MongoDB

It’s schemaless properties make it ideal to for bootstraping a project fast.

But as your app grows, this property makes it very easy for data to get curropted

What is schemaless?

Different rows can have different schema (keys/types)

notion image

Problems?

  1. Can lead to inconsistent database
  2. Can cause runtime errors
  3. Is too flexible for an app that needs strictness

Upsides?

  1. Can move very fast
  2. Can change schema very easily

💡

You might think that mongoose does add strictness to the codebase because we used to define a schema there. That strictness is present at the Node.js level, not at the DB level. You can still put in erroneous data in the database that doesn’t follow that schema.