Developing node.js. What is the advantage of not using Sequelize (ORM) when using DB?

Asked 2 years ago, Updated 2 years ago, 157 views

Developing node.js. I have two years of experience in mssql.

Initially, the db part was developed using the mysql module.

But I found out that it's called Sequelize.js, so I've been using it.

It was a little difficult because it wasn't handled by a query, but I used it.

But the deeper the development, the more curious I was about using and not using Sequelize.js. I wonder what kind of methods you pursue in practice, and what are the advantages and disadvantages of each.

I'm looking for advice from experienced seniors!

sequelize.js node.js mysql mariadb orm

2022-09-22 21:15

1 Answers

There are many likes and dislikes among developers.

There are a lot of people who hate ORM and there are a lot of people who are enthusiastic about it.

This is due to the modeling differences (object relationships <-> RDB) and performance degradation caused by the use of ORM called impedance mismatch.

Because ORM is designed to avoid vendor (mysql, oracle, pgsql) dependencies, it is implemented in a common parent form rather than an optimal query for each vendor.

Of course, a very well-designed ORM tool can get away with this a lot.

I tend to recommend using it, but because simple CRUD operations produce very repetitive codes (only table names or column names) there are many overlaps, which can lead to difficulties in refectoring or user mistakes.

Regardless of the Sequelize issue, all framework/library usage has a common problem.

Advantages

Disadvantages


2022-09-22 21:15

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.