4 ms·
This articles talks about some of the reasons in the section "Disk-Induced Constraints".
by pkaye 5y ago
This articles talks about some of the reasons in the section "Disk-Induced Constraints".
- masklinn 5y agoYes, except for #2 those reasons apply essentially as-is to in-memory b-trees if you replace “memory” with “cache” and “disk” with “memory”.
- dragontamer 5y agoDDR4 has a burst-length of 8, meaning the smallest you can write is a block of 64 bytes (corresponding to a modern cache-line). It also should be noted that DDR4 has "rows" roughly in the 1024 byte size. A RAS command opens up a "row" (aka 1024 bytes), while a CAS command reads from a column (aka: 64-bytes). DDR4 cells can only be read once (!!!), and afterwards, the data gets mangled. To prevent the loss of data, all "reads" are first into sense-amplifiers... and these sense-amplifiers can be read infinitely. This "read into sense-amplifiers" is called a RAS command, and it transfers the entire 1024-byte row into sense amplifiers. A CAS can then read 64-byte chunks from the page at high speeds and randomly. -------- Before a new RAS command can be issued, there needs to be a few steps. 1. The "current row" of data needs to be written back to DRAM (remember, the data in the DRAM was lost when you read the data in the first place). 2. After writing the data, the sense-amplifiers must be emptied (aka: precharged), so that they're ready to receive the new data. 3. After #1 and #2, it is finally legal to issue a RAS -------- So in fact, DDR4 RAM is also a block device. Sure, RAS is much faster than a hard-drive seek, but given how much slower RAS (row address strobe) is than a CAS (column address strobe)... a lot of these disk-based discussions (such as B-trees) end up applying to DDR4 in practice. -------- The only thing that really works like classic RAM is L3 / L2 / L1 caches. Everything else in the modern world is basically a block device.