5 ms·
Does StorX have any special handling of concurrent writes, or would the user need to take care of that?
by arunix 6mo ago
Does StorX have any special handling of concurrent writes, or would the user need to take care of that?
- aaviator42 6mo agoWe use SQLite IMMEDIATE transactions, which lock files for writes for a few milliseconds while commiting data to the file. This is not a problem in practice until you reach more than dozens of concurrent writers. StorX configures a default busy timeout of 1.5s, but it can be configured as per your needs. You can also get a lot more out of it by being smart about how you spread your data over DB files (eg: one file per user instead of one for multiple/all users), and also by considering when you call openFile() and closeFile() (eg: keep write transactions short, don't leave a file handler open while running long calculations).