Originally, the SQLite database connection lock was held throughout the entirety of each REST call. As things scaled, this led to inconsistent performance if another large query was running.
This approach is still used in critical sections of the code that need to guarantee atomicity. However, it would be better to let the database handle this via a transaction: https://docs.diesel.rs/2.0.x/diesel/connection/trait.Connection.html#method.transaction
Originally, the SQLite database connection lock was held throughout the entirety of each REST call. As things scaled, this led to inconsistent performance if another large query was running.
This approach is still used in critical sections of the code that need to guarantee atomicity. However, it would be better to let the database handle this via a transaction: https://docs.diesel.rs/2.0.x/diesel/connection/trait.Connection.html#method.transaction