Running transactions concurrently
Depending on whether your application requires isolation between reads and writes, within the database, you may need to explicitly run multiple transactions at the same time. Sequelize offers two methods for running transactions concurrently: recursively chaining transactions (Sequelize’s native method) or integrating your application with a third-party module called CLS.
Note
SQLite does not support running multiple transactions concurrently.
Running transactions concurrently with Sequelize
We can run transactions concurrently with Sequelize concurrently by chaining two transaction methods together, which would look similar to this:
sequelize.transaction((tx1) => { return sequelize.transaction((tx2) => {
Now, we can run multiple queries simultaneously while using different transactions, as follows:
return Promise.all([ ...