1,122 karma · joined June 14, 2016
We do, now. We're looking to move away from RocksDB to https://github.com/cockroachdb/pebble/.
In case you didn't know, a row [idA, valA, valB, valC] is not stored as [idA: [valA, valB, valC]]. It's more [id/colA: valA, id/colB: valB, id/colC: valC] (modulo caveats around what we call column families[0], where you can have it be more like option (a) if you want). My explanation here is pretty bad, but [1][2] go into more details.
[0]: https://www.cockroachlabs.com/docs/stable/column-families.ht...
[1]: https://www.cockroachlabs.com/blog/sql-in-cockroachdb-mappin...
[2]: https://github.com/cockroachdb/cockroach/blob/master/docs/te...
Care to elaborate here? As someone working at that layer of the system, our RocksDB usage is but a blip in any execution trace (as it should be, any network overhead you have given it's a distributed system would dominate single-node key-value perf). That aside, plenty of RDBMS systems are designed such that they sit atop internal key-value stores. See MySQL+InnoDB[0], or MySQL+RocksDB[1] used at facebook.
[1]: https://en.wikipedia.org/wiki/InnoDB
[0]: https://myrocks.io/
Have you taken a look at [0]? (All caveats around running an insecure cluster apply)
[0]: https://www.cockroachlabs.com/docs/stable/deploy-cockroachdb...
As for your performance analysis, do share your results and methodology. We published an in-depth, reproducible comparison with YugaByte here [1] in addition to publishing our TPCC-100k numbers[2]. If you're seeing performance that doesn't line up with the above, let us know.
[0]: https://www.cockroachlabs.com/blog/consistency-model/
[1]: https://www.cockroachlabs.com/blog/unpacking-competitive-ben...
The storage layer was not rewritten in C, it's just RocksDB. There's ongoing work to use a custom built LSM store instead: https://github.com/cockroachdb/pebble
[1]: https://www.cockroachlabs.com/blog/how-we-built-a-vectorized...
[1]: https://github.com/cockroachdb/cockroach/blob/master/pkg/sto...
Yep.
> Would that scanning, analogous to RAID "resilvering" subject to write-intent ranges to limit the keyspace regions scanned, usefully improve read latencies later?
I think it's just a better design to have it done on demand. The keyspace is large and failures are rare, and when one of these zombie intents are happened upon, the very first reader addressing it resolves it for all subsequent readers. A global scan would improve read latencies later, but not by much and not for many readers.
Left over intents are also visible for an ongoing txn, before those intents are resolved. But there's no added latency in the read path, I've commented elsewhere in the thread to explain how.
> After coordinator failure events, the new coordinator starts to clean up left-over intents asynchronously (nothing specific is waiting for it to finish).
The cleanup happens by readers on demand, there's no separate global coordinator scanning the keyspace and resolving old write intents.
Actually, welp, I believe this is closer to the truth in implementation. But consider how read performance compares before and after introduction of Parallel Commits. Before, when readers happen over extant 2PC "prepare" phase markers, they would still have to wait for txn resolution (on the coordinator node of the other txn, or on the node the intent was seen). They simply continue doing the same in Parallel Commits, there's no extra latency added to the read path (except when there is failure, but even then as soon as the earlier txn is recovered, future readers no longer get stuck).