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.
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.
Work has been merged.