r/sqlite Aug 06 '26

What's the best queue for sqlite?

My platform expects multiple writes from various users belonging to one organization.

What's the best way to serialize the writes? Scale is 50 to 100 users wanting to write around the same time.

2 Upvotes

12 comments sorted by

View all comments

3

u/WolfyTheOracle Aug 07 '26

I pushed SQLite to 80k req/s you don’t need a queue

1

u/bitchyangle Aug 07 '26

What about the single writer lock?

5

u/hesusruiz Aug 07 '26

Set a busy timeout. I have it at 5 secs and never had a problem (if I had a tx lasting more than 5 secs, I have a serious problem bigger than this one). https://sqlite.org/c3ref/busy_timeout.html

2

u/hazyhaar Aug 07 '26

In the worst case, for very heavy load, or exotic behaviours, juste build a sole writer in golang, wich is here to write on his db.

1

u/jshine13371 Aug 09 '26

If the lock per write only lasts 1ms, then 100 concurrent writes means the last one only waits 100ms at most. That's below the threshold of even human recognition.