We are planning on building a Node.js service. Here's our evaluation of the current ORM landscape:
Last updated: May 2 2016
- Objection.js
- http://vincit.github.io/objection.js/#introduction
- Bad: API is Promise based and bulky. This means people can forget to have an error handler due to not being error first
- Good: Uses JSON schema for validation; this means content should be relatively reusable between server/browser
- Good: Has nice syntax for relationships
- Good: Built on knex.js which seems to be canonical SQL driver
- Neutral: Recommends using Knex.js' migration tool for migrations
- Good: Well maintained
- http://isitmaintained.com/project/Vincit/objection.js
- Resolution time: 1 day, Open issues: 13%
- http://isitmaintained.com/project/Vincit/objection.js
- Sails
- https://github.com/balderdashy/sails
- Not looking for an opinionated MVC, skipping for now
- Waterline, ORM from Sails
- https://github.com/balderdashy/waterline
- Bad: Response time takes a while
- But might be well supported since Sails?
- http://isitmaintained.com/project/balderdashy/waterline
- Resolution time: 10 days, Open issues: 2%
- sequelize
- https://github.com/sequelize/sequelize
- Good: Syntax is clean and straightforward
- Good: Seems to have everything we need (e.g. relationships, validation)
- TODO: There might be callback support via
nodeify
- Good: Well maintained
- http://isitmaintained.com/project/sequelize/sequelize
- Resolution time: 1 day, Open issues: 12%
- http://isitmaintained.com/project/sequelize/sequelize
- Bookshelf.js
- http://bookshelfjs.org/
- Good: Feels very Backbone.js-esque (e.g.
get
/set
, virtual properties (similar tobackbone-relationship
)) - Good: Supports callbacks
- Good: Authored by knex.js author
- Bad: Maintenance isn't great
- http://isitmaintained.com/project/tgriesser/bookshelf
- Resolution time: 6 days, Open issues: 28%
- http://isitmaintained.com/project/tgriesser/bookshelf
- orm2
- https://github.com/dresende/node-orm2
- Used it previously, had a terrible experience
Our likely choice is sequelize
(possibly with callback bindings via bluebird-nodeify
)
@twolfson I randomly found this extensive list. Great work. But I would like to point out that I don't agree about your bad points regarding Objection.js: After working with it quite extensively I can say that the API is extremely well designed and easy to use. I also see the fact that it goes all in with promises a sign that it is future proof, not a hinderance. It's time to say goodbye to callback hell...