3 ms·
I'm used to KV systems being really simple shallow systems. WASI-keyvalue for example is quite simple, stopping at providing an increment capability. https://gi
by jauntywundrkind 3y ago
I'm used to KV systems being really simple shallow systems. WASI-keyvalue for example is quite simple, stopping at providing an increment capability. https://github.com/WebAssembly/wasi-keyvalue/blob/main/wit/atomic.wit https://github.com/WebAssembly/wasi-keyvalue/blob/main/wit/a...
I knew Deno KV was built on FoundationDB, expected this would be a neat but simple systems architecture rundown. But... Turns out Deni really went super deep in building a KV, by adding atomics!
> To maximize performance and concurrency for atomic operations, we built the Deno KV Transaction Layer that manages the global order of atomic operations. For each transaction that is received by this Transaction Layer:
I thought it was particularly creative how a .get returns not just the value, but some reference to what the get was. So when the atomic change comes, they can check the get. This was a neat way to let some sets use previous data safely, I thought.
Does anyone else have any other examples of thicker kv APIs? It feels like we're nearing a cap'n'proto level of promise pipelining, as we extend kv this way; I though Denos dodge was extremely expertly picked to limit how complex references to existing operations would need to be.