Some things discussed on Matrix:
- Improve the queries generally to remove n+1 queries
- Look into introducing transactions
- Avoid creating a new DB connection for each query
Some more involved improvements were suggested like using Postgres or Redis instead of SQLite.