DEV Community

ADEKOLA Abdwahab
ADEKOLA Abdwahab

Posted on

1

ORM: Prisma or Sequelize?

You are considering which ORM to use for your project, as someone who has used both Prisma and Sequelize, I will advise you go for Prisma.

It has everything you need now and might need in the future.

This article would be a growing one, as I would be updating it with more points with time.

  1. Migrations are dumb on Sequelize.

When you make changes to a DB model while working in a different environment, migrations help you to keep track of the changes and apply these changes when you deploy/merge to another environment. This ensures that, for example, a column you just added to dev environment would be added automatically to staging environment if your PR was merged.

With Prisma you just have to issue a few command line commands to update your migration files. The commands may not be more than two. Here are the commands I use on my current project:

npx prisma generate  

npx nx run backend:migrate-dev or npx prisma migrate dev
Enter fullscreen mode Exit fullscreen mode

That is all.

But with Sequelize, it is like you are writing the migration files your self. Sequelize does not pick and create the migration file from the model (and changes to it), this make it error prone and stressful.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (2)

Collapse
 
romeopeter profile image
Romeo Agbor Peter • Edited

This article has a great start but tells the reader there's more to it. It'll be great if you complete it 🔥

Collapse
 
bchen profile image
Brian

umm...did you read the docs?

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more