rails / solid_queue

Database-backed Active Job backend
MIT License
1.95k stars 130 forks source link

Clarify impact of two processes on SQLite #378

Closed northeastprince closed 1 month ago

northeastprince commented 1 month ago

It's been recommended because of write contention to have Solid Queue on a separate database, but web processes would be making writes to queue jobs anyway. If that's the case, it would just slightly increase query times because of the wait for a lock, and in most cases wouldn't really matter. Is this accurate or am I missing something?

rosa commented 1 month ago

If you have different databases, you can have a request enqueuing a job and another request writing to the main app DB (not jobs), at the same time. If both are in the same DB, your regular app writers will have to wait for job writes and vice versa. Is that clearer?

northeastprince commented 1 month ago

Definitely - for my app/infra it'd simplify things to keep everything in one database but the previous discussions (and the fact that it's the default) made it seem like it was a problem or something other than just the standard load that would decide when you're at the limit of vertically scaling SQLite anyway.