threefoldtech / 0-db

Fast write ahead persistent redis protocol key-value store
Apache License 2.0
39 stars 10 forks source link

libzdb: data: avoid fragmentation of data files #158

Closed maxux closed 10 months ago

maxux commented 10 months ago

Main idea of zdb was initially to be efficient on HDD, current implementation was doing always-append but per namespace, which means random write to different namespace at the same time would eventually produce fragmentation.

New implementation ensure data are (lazily) pre-allocated using fallocate by reserving blocks when creating data file.