Need advice about which tool to choose?Ask the StackShare community!
Sequelize vs TypeORM: What are the differences?
Here are some differences between the two that might help you make a decision:
Query building: Sequelize and TypeORM use distinct approaches to interact with databases. Sequelize follows the query builder approach, which involves chaining methods to form queries. On the other hand, TypeORM uses the data mapper approach, where you work with entities and use methods such as
saveto interact with the database.
Relationships: TypeORM has better support for complex relationships, such as many-to-many relationships, while Sequelize requires more manual configuration to set up such relationships.
Active development: TypeORM is a newer library and has a more active development community than Sequelize.
Database support: Sequelize is compatible with a variety of databases such as MySQL, PostgreSQL, SQLite, and MSSQL. On the other hand, TypeORM has the capability to work with MySQL, PostgreSQL, SQLite, Oracle, SQL Server, CockroachDB, and MongoDB.
Overall, if you prefer a data mapper approach and want better support for complex relationships, TypeORM might be a better fit for your project. If you prefer a query builder approach and need to support a wider range of databases, Sequelize might be a better fit.
Pros of Sequelize
- Good ORM for node.js40
- Easy setup30
- Support MySQL & MariaDB, PostgreSQL, MSSQL, Sqlite19
- Open source14
- Promise Based11
- Recommend for mongoose users4
- Atrocious documentation, buggy, issues closed by bots3
Pros of TypeORM
- Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Ser10
- Easy setup9
- Works in NodeJS, Browser, Ionic, Cordova and Electron p7
- Promise Based7
- Cons of TypeORM6
- Support MySQL & MariaDB, PostgreSQL, MSSQL, Sqlite6
- Support MongoDB1
Sign up to add or upvote prosMake informed product decisions
Cons of Sequelize
- Docs are awful30
- Relations can be confusing9
Cons of TypeORM
- Completely abandoned by its creator5
- Too complex for what it does3
- Not proper/real type safety1
- Cannot use query on any relation1