Need advice about which tool to choose?Ask the StackShare community!
Mongoose vs Sequelize: What are the differences?
What is Mongoose? MongoDB object modeling designed to work in an asynchronous environment. Let's face it, writing MongoDB validation, casting and business logic boilerplate is a drag. That's why we wrote Mongoose. Mongoose provides a straight-forward, schema-based solution to modeling your application data and includes built-in type casting, validation, query building, business logic hooks and more, out of the box.
What is Sequelize? Easy-to-use multi sql dialect ORM for Node.js & io.js. Sequelize is a promise-based ORM for Node.js and io.js. It supports the dialects PostgreSQL, MySQL, MariaDB, SQLite and MSSQL and features solid transaction support, relations, read replication and more.
Mongoose belongs to "Object Document Mapper (ODM)" category of the tech stack, while Sequelize can be primarily classified under "Object Relational Mapper (ORM)".
"Well documented" is the top reason why over 14 developers like Mongoose, while over 17 developers mention "Good ORM for node.js" as the leading cause for choosing Sequelize.
Mongoose and Sequelize are both open source tools. Sequelize with 18.9K GitHub stars and 2.99K forks on GitHub appears to be more popular than Mongoose with 18.8K GitHub stars and 2.62K GitHub forks.
According to the StackShare community, Mongoose has a broader approval, being mentioned in 85 company stacks & 88 developers stacks; compared to Sequelize, which is listed in 38 company stacks and 33 developer stacks.
Pros of Mongoose
- Several bad ideas mixed together17
- Well documented17
- JSON10
- Actually terrible documentation8
- Recommended and used by Valve. See steamworks docs2
- Can be used with passportjs for oauth1
- Yeah1
Pros of Sequelize
- Good ORM for node.js42
- Easy setup31
- Support MySQL & MariaDB, PostgreSQL, MSSQL, Sqlite20
- Open source14
- Free13
- Promise Based11
- Recommend for mongoose users4
- Atrocious documentation, buggy, issues closed by bots3
- Typescript3
Sign up to add or upvote prosMake informed product decisions
Cons of Mongoose
- Model middleware/hooks are not user friendly3
Cons of Sequelize
- Docs are awful30
- Relations can be confusing9