4 ms·
K/V stores don't provide ACID properties themselves, but you could bolt them on pretty easily. For instance: Atomicity: save a journal of the pre and post val
by lsb 17y ago
K/V stores don't provide ACID properties themselves, but you could bolt them on pretty easily. For instance:
Atomicity: save a journal of the pre and post values of any rows, and on commit take all of your staged changes and write them and then delete the journal. If you're ever going to hit the DB again and you see a journal file that wasn't cleaned up, roll back to whatever pre values there are.
Isolation: use a semaphore to cause the start of a writing transaction to block all reads and writes, use a semaphore to cause the start of a reading transaction to block all writes, and escalate from reading transaction to writing transaction when necessary.
- silentbicycle 17y agoTransactions are actually incredibly tricky to get right, particularly in a portable manner. Not exactly the sort of thing one can implement in a weekend. For example: http://sqlite.org/atomiccommit.html http://sqlite.org/atomiccommit.html Also, it will slow down the database a bit (particularly if added to the db as an afterthought!), which seems to really irritate people who would rather have potentially corrupt information as soon as possible rather than automatic guarantees of internal consistency.
- nettdata 17y agoAnd let's not even start talking about consistent reads.