(no title)
hlship | 2 years ago
I could imagine using two files, one containing the actual b-tree, the second containing the offset to the latest root note; the second file gets overwritten only after a successful write is verifiably written to disk.
Datomic's (https://www.datomic.com/) architecture is similar to this, but uses many write-once "segments" (which could be files in EFS or S3, or rows in DynamoDB or other stores).
ww520|2 years ago
hyc_symas|2 years ago
twoodfin|2 years ago
For an in-memory database, a CAS is adequate. Persistent stores ultimately need some kind of file-level locking.
If you look at the Apache Iceberg spec, you get a good idea of how this works: The only “mutability” in that universe is the root table pointer in the catalog.