Migrate to a direct database interface. #8

Closed
opened 5 years ago by sander · 1 comments
sander commented 5 years ago
Owner

Experimentation with SQLite has yielded that when I increased the amount of entries in the database, song queries now take up to 60 seconds to complete. That is unacceptably slow, especially since the database will only grow more.

However, executing the same query directly in SQLite yielded much faster results.

Some Google research has shown that Sequelize is the bottleneck here, because it is de-duplicating results on the client side. Workarounds offered are not possible in this project because of nested sub-queries. More info:
https://github.com/sequelize/sequelize/issues/4868

This is not the only problem with sequelize: this project is also haunted by a problem with offsets and limits in the query handler.

Based on this experience it would be better to have a more direct database interface so that we have more control over these things.

For example: Knex.js (http://knexjs.org/), which allows abstraction from SQL dialects but without creating a relational model on top.

Experimentation with SQLite has yielded that when I increased the amount of entries in the database, song queries now take up to 60 seconds to complete. That is unacceptably slow, especially since the database will only grow more. However, executing the same query directly in SQLite yielded much faster results. Some Google research has shown that Sequelize is the bottleneck here, because it is de-duplicating results on the client side. Workarounds offered are not possible in this project because of nested sub-queries. More info: https://github.com/sequelize/sequelize/issues/4868 This is not the only problem with sequelize: this project is also haunted by a problem with offsets and limits in the query handler. Based on this experience it would be better to have a more direct database interface so that we have more control over these things. For example: Knex.js (http://knexjs.org/), which allows abstraction from SQL dialects but without creating a relational model on top.
sander added this to the Core project 5 years ago
sander added a new dependency 5 years ago
sander added a new dependency 5 years ago
Poster
Owner

Work has been merged.

Work has been merged.
sander closed this issue 5 years ago
sander removed this from the Core project 5 years ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Blocks Depends on
Reference: sander/MuDBase#8
Loading…
There is no content yet.