posted on 2021-12-25

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).

posted on 2021-12-25

CC_ -1 License unless otherwise specified on individual pages, all posts on this website are licensed under the CC_-1 license.
unless explicitely mentioned, all content on this site was created by me; not by others nor AI.