avatar

database transactions: you guessed it, it's WASM again

i barely need to say anything past the opening title: to run arbitrary transactions to a database server, whether they be atomic or not, instead of a DSL like SQL, we should use WASM programs that would have the ability to read, lock, mutate, etc. pieces of data arbitrarily inside, for example, a key-value store.

this allows a single server to run transactions one after the other, without letting different clients become desynchronized, but also without having to understand the data being stored — that can all be up to clients.

for example, maybe a value somewhere represents a list, and two clients send at the same time a WASM transaction that will insert an element into that list. the two WASM program calls can run in sequence on the server, resulting in the correct list with both values added, without requiring the server to "understand" that the value is a list (as would be the case in SQL) nor having desynchronization issues (which would be the case if clients were to fetch the list, modify it, and then send the new value back).


RSS feed available here; new posts are also linked on my twitter.
CC_ -1 License Unless otherwise specified on individual pages, all posts on this website are licensed under the CC_-1 license.
This site lives at https://carado.moe and /ipns/k51qzi5uqu5di8qtoflxvwoza3hm88f5osoogsv4ulmhurge2etp9d37gb6qe9.