TurboKV: Insanely fast Rust key-value store

(github.com)

43 points | by rgbimbochamp 3 hours ago ago

13 comments

  • dangoodmanUT an hour ago ago

    > DbOptions::durable()

    > Appended to the WAL without a per-write sync

    So… it’s not durable? Durable doesn’t mean “survives a process restart”, it means “durably saved to persistent storage”. For example, this “durable” mode wouldn’t survive power loss.

    • stingraycharles an hour ago ago

      Yeah this should be benchmarked against other systems that have flush() disabled.

      mmap is nice but it doesn’t support durable semantics in the way that we usually mean with databases.

      if a write is acknowledged it should not be forgotten, which is not what this is.

      • rgbimbochamp an hour ago ago

        You're right, that mode provides process crash recovery, not power-loss durability. The benchmark compares it against fjall’s equivalent buffered-WAL mode.

        • a2ff6eeb0 29 minutes ago ago

          If that's your design constraint, couldn't you speed it up by getting rid of the WAL?

  • paulsutter 4 minutes ago ago

    Oops you built a database!

  • boguscoder 24 minutes ago ago

    Embedded could also mean no_std, which this is absolutely not. Still cool though

  • AtlasBarfed 15 minutes ago ago

    Aphyr or gtfo

  • nine_k 2 hours ago ago

    I suppose the insane speed is due to this:

    > TurboKV's persisted Bloom-filter format uses hardware AES.

    Also, built-in LZ4 compression.

    I would expect SIMD to be used for scans.

    • haberman an hour ago ago

      I assume this is for hashing. I've seen several hashing algorithms turn to hardware AES instructions before, but I haven't seen any evidence that this technique outperforms state-of-the-art hashes like RapidHash (https://github.com/Nicoshev/rapidhash) in either quality or speed.

    • rgbimbochamp 2 hours ago ago

      Those help but the main write speed gain is the WAL, that uses preallocated mmap segments to avoid a write(2) per durable mutation while preserving crash recovery. AES hashing mainly helps Bloom filter point lookups and LZ4 mainly helps SSTable I/O. Scans benefit indirectly, but don’t yet use a custom SIMD merge loop.

      • bestouff 41 minutes ago ago

        I said elsewhere this doesn't survive a power loss.

        • taneq 37 minutes ago ago

          While it’s important to make this explicit, at what point do we just assume a high-reliability UPS is table stakes?

          Of course, if you need SIL2 type reliability then you need to assume any given hardware component can spontaneously combust and become a total loss, at which point the data loss caused by a power cut is a rounding error.

      • dangoodmanUT an hour ago ago

        Iirc that’s how badger handles the WAL as well