Sequelize orm vs Loopback orm

I am creating a rest api supported by PostgreSQL. I like the Strongloop Loopback framework, it simplifies api development. But how is its built-in ohm compared to the sequel? What advanced features are exaggerated as dedicated sql orm that are missing in loopback? Perhaps it is better to stay with the sequel and use some other api helpers for relaxation than a monolithic loop structure?

+7
loopbackjs strongloop
source share
3 answers

The kind of question about opinion, I don’t know if it is really here. I don’t see much difference in the implementation of ORM on my own, as part of RDMBS goes anyway (nosql is another story). I also really can not talk about the implementation of Postgres, because, unfortunately, I need to use it with MSSQL. If you want to work with Hstore or json? Think about these things that you will find in the loop as it generalized the API for all connectors. This is a compromise. Say you request RDMBS in the same way as Mongo, say. However, strongloop seems to have created a product designed for the enterprise, so I would say that the support should be pretty good.

On the side of the note, I really don't know if the loopback call is a monolithic structure accurate. For me, at least a monolithic framework would be something like Rails, which draws you in a corner on the architecture and is really more focused on server-side content (vs Fat-client SPA). Loopback automatically creates a Swagger Rest API compatible for you, although you can configure which routes / verbs are available and ACL controls. Although a certain realization of the plays is β€œbaked” in its hardly monolithic form. You are going to create all these routes in any other framework if you go with Restful architecture. You can still create custom endpoints in the loopback as you see fit. One good thing with Loopback is that you can redesign model definitions from existing / legacy sets in an RDBMS. There is also an option to synchronize definitions (I have not studied it yet). Check out this conversation , it shows the logic well why loopback is.

+2
source share

It should be noted that Loopback does NOT guarantee referential integrity, since it does not enforce the use of foreign keys at the database level. see https://github.com/strongloop/loopback-connector-mysql/issues/135

+1
source share

This is kind of a late answer, but for future references: Loopback is more than ORM, it is ORM + Express. You can use the Loopback ORM lib (loopback-datasource-juggler) separately, but the api of this is not as intuitive as Sequelize. On the other hand, for me, one of the main differences was that Loopback can update existing database tables without destroying the data in it if you change your model later. With Sequelize you need to process it manually, it only creates a table the first time it starts. To update an existing table, you need to drop it and then recreate it. And I hope you do not forget to back up the data in the table. Or change the structure of the table manually.

The reason Loopback easily handles this, unlike Sequelize, does not provide database-level data integrity, as mentioned above @ gurg-hackpof.

+1
source share

All Articles