Sequelize orm vs Loopback orm

rus1 picture rus1 · Apr 10, 2015 · Viewed 8.5k times · Source

I'm creating rest api backed by PostgreSQL. I like Strongloop Loopback framework, it streamlines api development. But how its built-in orm compared to sequelize? What advanced features has sequelize as dedicated sql orm, which are missing in loopback? Maybe it's better to stay with sequelize, and use some other rest api helpers than monolitic loopback framework?

Answer

Wojtek picture Wojtek · Apr 12, 2015

Kind of an opinion question, don't know if it really belongs here. I don't see much of a difference in the ORM implementation myself, as far as the RDMBS piece goes anyway (nosql is another story). I also really can't speak for the Postgres implementation specifically as I unfortunately need to use it with MSSQL. Does squelize let you work with Hstore or json though? Think those things you will find missing in loopback as it generalized the API across all connectors. Its a trade-off. You query your RDMBS the same way as you would Mongo, lets say. That said, strongloop appears to have made a product here geared for the enterprise so I would wager that the support should be pretty good.

On a side note, I don't really know if calling loopback a monolithic framework is accurate. To me, at least, a monolithic frame work would be something like Rails that paints you in a corner as to the architecture and is really geared more for server rendered content (vs Fat-client SPAs). Loopback automatically generates a swagger compliant Rest API for you, though its up to you to configure which routes/verbs are accessible and the ACL controls. While certain implementation of the pieces are "baked in" its hardly monolithic. You are going to end up creating all these routes in any other framework if you are going with a Restful architecture. You can still create custom end points in loopback as you see fit. One really nice thing with Loopback is that you can reverse-engineer model definitions from existing/legacy sets in RDBMS. There is also a definition sync option (i haven't actually explored yet). Check out this talk, it does well show the logic to why loopback is.