3 ms·
Fwiw many databases have update be delete+create because you've already invented those primitives so why do something else?
by hobs 3y ago
Fwiw many databases have update be delete+create because you've already invented those primitives so why do something else?
- rbanffy 3y agoThis is useful for transactional operations where you want to preserve the previous state until the transaction completes. If you don't need transactions, or you don't need point-in-time queries, then updating in place would save time.
- refset 3y agoExcept updating in place is almost never what is actually happens outside of RAM - there are usually various layers of Copy on Write happening anyway. So unless your database (or the high-churn subset) cleanly fits in RAM I would generally expect that the significance of any time saved is debatable. Denying yourself the possibility of adding transactions later down the line is a huge risk in most situations.
- rbanffy 3y agoIn any case, update in place will mean at least half as many CoW operations. Many databases have (or, at least, had) the ability to manage block storage directly without the need for a filesystem. If transactions can be supported only for some operations while others can be transactionless, you can speed up the operations that won't need them.
- refset 3y agoDirect block storage is good, but note that SSDs are essentially just doing CoW internally too.
- refset 3y agoIt's perhaps also worth a mention that embracing the internal characteristics of SSD throughout the software stack looks like the inevitable direction we're headed (short of another major breakthrough in storage tech) - e.g. see "A Survey on the Integration of NAND Flash Storage in the Design of File Systems and the Host Storage Software Stack" https://arxiv.org/pdf/2307.11866.pdf https://arxiv.org/pdf/2307.11866.pdf
- hinkley 3y agoIn a multi version database you have little choice in the matter. You’re going to CoW anyway.
- h1fra 3y agoYep not complaining about the implementation, just it's not the mental model you have when you begin using Databases. It took me many years to understand this bit.