Unpopular Opinion: Database were designed for 1980-90 mechanics, the only thing that never innovates is DB. It still use BTree/LSM tree that were optimized for spinning disc. Inefficiency is masked by hardware innovation and speed (Moores Law).
There's plenty of innovation in DB storage tech, but the hardware interface itself is still page-based. It turns out that btrees are still efficient for this work. At least until the hardware vendors deign to give us an interface to SSD that looks more like RAM. Reading over https://www.cs.cit.tum.de/dis/research/leanstore/ and associated papers and follow up work is recommended. In the meantime with RAM prices sky r…
What Does a Database for SSDs Look Like?
91–100 of 127 posts
Re: What Does a Database for SSDs Look Like?
#92Earlier quoted context omitted.
I just tested the mediocre enterprise nvme I have sitting on my desk (micron 7400 pro), it does over 30000 fsyncs per second (over a thunderbolt adapter to my laptop, even)
If you tested this on macos, be careful. The fsync on it lies.
Re: What Does a Database for SSDs Look Like?
#93Earlier quoted context omitted.
There's plenty of innovation in DB storage tech, but the hardware interface itself is still page-based. It turns out that btrees are still efficient for this work. At least until the hardware vendors deign to give us an interface to SSD that looks more like RAM. Reading over https://www.cs.cit.tum.de/dis/research/leanstore/ and associated papers and follow up work is recommended. In the meantime with RAM prices sky r…
Btrees are not optimal for SSD, and the only reason we still use them is legacy constraints of page-oriented storage and POSIX block interfaces.We pay a lot of unnecessary write amplification, metadata churn, and small random writes because we’re still force-fitting tree structures into a block device abstraction.
Re: What Does a Database for SSDs Look Like?
#94Earlier quoted context omitted.
I just tested the mediocre enterprise nvme I have sitting on my desk (micron 7400 pro), it does over 30000 fsyncs per second (over a thunderbolt adapter to my laptop, even)
If you tested this on macos, be careful. The fsync on it lies.
Re: What Does a Database for SSDs Look Like?
#95Earlier quoted context omitted.
> Skipping flushing the local disk seems rather silly to me It is. Coordinated failures shouldn't be a surprise these days. It's kind of sad to here that from an AWS engineer. Same data pattern fills the buffers and crashes multiple servers, while they were all "hoping" that others fsynced the data, but it turns out they all filled up and crashed. That's just one case there are others.
Durability always has an asterisk i.e. guaranteed up to N number of devices failing. Once that N is set, your durability is out the moment those N devices all fail together. Whether that N counts local disks or remote servers.
Re: What Does a Database for SSDs Look Like?
#96> WALs, and related low-level logging details, are critical for database systems that care deeply about durability on a single system. But the modern database isn’t like that: it doesn’t depend on commit-to-disk on a single system for its durability story. Commit-to-disk on a single system is both unnecessary (because we can replicate across storage on multiple systems) and inadequate (because we don’t want to lose w…
The biggest lie we’ve been told is that databases require global consistency and a global clock. Traditional databases are still operating with Newtonian assumptions about absolute time, while the real world moves according to Einstein’s relativistic theory, where time is local and relative. You dont need global order, you dont need global clock.
Arbitrating differences in relative ordering across different observer clocks is what N-temporal databases are about. In databases we usually call the basic 2-temporal case “bitemporal”. The trivial 1-temporal case (which is a quasi-global clock) is what we call “time-series”.
The complexity is that N-temporality turns time into a true N-dimensional data type. These have different behavior than the N-dimensional spatial data types that everyone is familiar with, so you can’t use e.g. quadtrees as you would in the 2-spatial case and expect it to perform well.
There are no algorithms in literature for indexing N-temporal types at scale. It is a known open problem. That’s why we don’t do it in databases except at trivial scales where you can just brute-force the problem. (The theory problem is really interesting but once you start poking at it you quickly see why no one has made any progress on it. It hurts the brain just to think about it.)
Re: What Does a Database for SSDs Look Like?
#97Earlier quoted context omitted.
Committing to NVMe drive properly is really costly. I'm talking using O_DIRECT | OSYNC or fsync here. Can be in the order of whole milliseconds, easily. And it is much worse if you are using cloud systems.
I just tested the mediocre enterprise nvme I have sitting on my desk (micron 7400 pro), it does over 30000 fsyncs per second (over a thunderbolt adapter to my laptop, even)
It is great as long as your actual workload fits, but misleading if a microbenchmark doesn't inform you of the knee in the curve where you exhaust the buffer and start observing the storage controller as it retires things from this buffer zone to the other long-term storage areas. There can also be far more variance in this state as it includes not just slower storage layers, but more bookkeeping or even garbage-collection functions.
Re: What Does a Database for SSDs Look Like?
#98Earlier quoted context omitted.
bcachefs's btree still beats the pants off of the entire rocksdb lineage :)
Rocksdb / myrocks is heavily used by Meta at extremely massive scale. For sake of comparison, what's the largest real-world production deployment of bcachefs?
Re: What Does a Database for SSDs Look Like?
#99Earlier quoted context omitted.
Because it is in addition to your writes, not instead of them. That's what “ahead” points to.
Look up how "checkpointing" works in Postgres.
Postgres allows a group commit to try to combine multiple transactions to avoid the multiple fsyncs, but it adds delay and is off by default. And even so, it reduces fsyncs, not writes.
Re: What Does a Database for SSDs Look Like?
#100A tangent: > Companies are global, businesses are 24/7 Only a few companies are global, so only a few of them should optimize for those kind of workload. However maybe every startup in SV must aim to becoming global, so probably that's what most of them must optimize for, even the ones that eventually fail to get traction. 24/7 is different because even the customers of local companies, even B2B ones, mighty feel lik…
> Only a few companies are global, so only a few of them should optimize for those kind of workload A massive number of companies have global customers , regardless of where the company itself has employees. For example my b2b business is relatively tiny, yet my customer base spans four continents. Or six continents if you count free users!