I plan to use SQLite and Peewee (ORM) for a lightweight internal web service (<20 requests per second). A web service can handle multiple simultaneous requests across multiple threads. During each request, the database will be read and written. This means that I will need to be able to read and write at the same time. It does not matter for this application if the data changes between reading and writing.
The SQLite FAQ says that concurrent reads are allowed, but simultaneous writing from multiple threads requires acquiring a file lock. My question is: Will Peewee take care of this blocking for me, or is there something I need to do in my code to make this possible?
The Peewee database object is shared between threads. I assume this means that the database connection is also shared.
I cannot find a specific Peewee answer, so I ask here.
source
share