I'm guess but it probably depends on who's being choked here. If it's the caller, then it may be the overhead of individual deletions for each record when using the record APIs. If other users are being choked, it may refer to locking.
Naively, I would expect SQLite to be able to delete tens-of-thousands (or even hundreds) of records per seconds, since it's simply appending deletions to the WAL.
I wouldn't be surprised if that's the performance issue. It seems to be used as in memory cache for all (?) collections and uses a mutex to access them, even on reads.
Most (properly set up) databases are pretty good keeping things cached and with a local socket the latency is low. With this setup I'd be very careful to do my own general purpose caching. The solution here is likely very sub optimal.
I've just started with go a few weeks ago, so take my info with a grain of salt.
Pocketbase uses a mutex for all the data reads and writes. That means that every write will block any readers for the write duration. If you do a lot of writes this will become quite inefficient quickly. You need some kinds of locking to write data, but if badly implemented it will pretty much roll back all concurrency advantages, you pile up goroutines that just wait to do something.
A good database does go very sophisticated steps to minimize locking, essentially you should expect from a modern database that most reads are lock free. Still it helps to understand how they coordinate locking and concurrency to optimize your applications. I.e. usually you design reads to be ultra fast and do writes in healthy bulk sizes which is also still fast but will net out to have minimum lock time. Slow reads should be done read only replicas or at times there isn't any load. So sqlite isn't slow/bad at all, if you use it correct, like any other decent database.
Below the sqlite WAL mode is explained. It is magnitudes more sophisticated then what pocketbase does. Pocketbase literally negates all that by their own locking strategy. It would likely be more efficient if the just remove their cache layer and fine tune sqlite for their use case.
Also if you require a very high amount of writes, that is realtime writes, as opposed to writes that can be delayed, you pretty much enter tough terrain. You need to make very deliberate choices and pay a lot of attention to system design depending on your requirements. So if something falls over from a high amount of writes, it because it's hard.
(Similar disclaimer: I'm not an expert on PocketBase implementation details)
I don't think the referenced `Store` is used in the SQLite access path and PocketBase uses SQLite in WAL mode. Besides, in cases where the `Store` is used, it uses a read/write lock to allow for concurrent reads.
I thought the same but from another perspective, it's better to explain things in a language you dominate and let others translate it to theirs, which might be a good or bad translation; than translate it yourself to a language you don't dominate and the others always get a bad translation. At least in the first case new people can come with better translations.
This is all assuming translation tools always translate things wrong, which they do when it comes to programming terms.
One doesn't exclude the other. You can use machine translation and clearly marking it as such, and then let people override them if there is the necessary contribution activity.
Good actuarials can pull this off. They just charge enough that they can invest some of your upfront payment and use the interest to pay the staff to support you. We know how often hard drives fail, so you just ensure that you have enough interest to replace them when that happens.
If you are the only one paying upfront this is impossible as your harddrives might fail early, but if there are 1000 people willing to pay upfront we can easially handle that.
Note that I would not be surprised if this was just a Ponzi. That we know how to do this doesn't mean we are.
The answer is: they don't. It operates similar to a ponzi where they need a certain amount of new "investors" each year to sustain their scheme.
Obviously, collapse is inevitable on a long enough timeline for any company, but this scheme in particular is very vulnerable to a couple slow years in terms of sales.
reply