Uh yeah, so it took <1 day to do it. The second day, I added recovery. A node can go offline, as long as there is a quorum the cluster will chug along, when it comes back online then it can recover from its peers.
A lot of what I did was above my level of coding, clearly I used alchemy to do this. It's not a joke. I implemented all of Redis' data structures and can send commands to do exactly what Redis does to this database. The recovery mechanism is just one of those things that made sense.
I have more features I want to add to this DB, but it's insane how fast it got working. There's some ideas at https://reubenbond.github.io/posts/caspaxos That I want to see could help with some of the challenging parts, but as far as I can see it most of the challenges so far are done with.
Microsoft Orleans is the only database I know of that has gotten CASPaxos working, but I'm sure it was complicated as shit trying to make it all work and manage so it didn't gain traction there.
CASPaxos is just the consensus/replication part of the database, RockDB is the storage layer, custom solution to do recovery, the public API is inspired by Redis, but is not REDIS compatible, but that certainly can be done. Again, it only supports data structure functions. I don't care for streams and all the other non essentials.
Again I'm shocked how fast this was done and how fast the db is. Like literally usable and everything. I'm still adding integration tests to test how the database functions in general. Will have to add performance/benchmark measuring as well.
It's really unbelievable. I've wanted to do something with CASPaxos since 2021, it's been a while. I had a project that implemented it, but didn't go anywhere because it required a lot of work, a lot of show stopping work that has been thought about in light years now.
Imagine that, distributed locks on a Linearizable, wait free, high contention, highly available database in RUST 🦀 BABY!
Heck yeah I am going to have dedicated commands for locks!
I guess I won't be using etcD, CockroachDB and whatever else now!
SS addresses the challenge of providing rich, data‑structure‑oriented APIs with the strong, linearizable consistency guarantees required by modern distributed applications. It is designed for environments where stale reads or single‑leader bottlenecks are unacceptable, yet developer productivity and performance must remain high.