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.

đź‘‹ While you are here

Reinvent your career. Join DEV.

It takes one minute and is worth it for your career.

Get started

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?

Billboard image

Try REST API Generation for Snowflake

DevOps for Private APIs. Automate the building, securing, and documenting of internal/private REST APIs with built-in enterprise security on bare-metal, VMs, or containers.

  • Auto-generated live APIs mapped from Snowflake database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

đź‘‹ Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay