Replies: 1 comment
-
Hi, and thanks for taking time to comment. I converted this into a discussion. Good points! What's the use case, though? Admittedly I didn't give yet much toughts about performances, much can be done but the relevant points are:
The point is: if you absolutely know what you're doing and how the web service parts interacts with the embedded db part, you could manage to do things reliably; but if you "see" only the web part and use it as you would expect to be able to use it, treating the rest as a black box, I feel these things are required. This said, I am asking what is the use case because it may be possible to do something towards a few cases. Your workaround is very clever and should be effective; "batch" inserts are already present if you don't need to span beyond a single request; maybe a sort of "CSV import" mode could be put in place. Or an "expert" mode that relaxes the per-db lock and/or allows WAL2 and/or remove the check for BEGIN/COMMIT/ROLLBACK, if you feel you know what you're doing. But yes, if you have many inserts in many requests, you may find that the bottleneck is the web server or the lock, not the sqlite stuff. So first let's frame the problem at hand. Thanks!
PS: for sake of completeness, since I just wrote it on Discord and it's maybe relevant: performances were not a key point so far; the sqlite layer is a transpilation to Go and it's not the most performant, but allows to cross-compile to many platforms. I benchmarked native sqlite solutions in Rust and Java, but they were (strangely) slower than this, so for now Go it is. In the future it will be interesting to understand what can be done, and this discussion is a great starting point. |
Beta Was this translation helpful? Give feedback.
-
Sharing a few strategies here. Can be converted to a discussion at your discretion.
You can then:
Perform JOIN, etc.
Multiple databases enable you to multiply your throughput.
Share your strategies!
Beta Was this translation helpful? Give feedback.
All reactions