top | item 37777642

(no title)

Daeraxa | 2 years ago

I've been using a file based database at work for years. Data is stored in 1024 byte "blocks" with each file containing 1000 blocks. Each block refers to a single record and the data is delimited by the positions within those 1024 bytes (e.g. date/time created might be at position 38 in the block and run for 14 bytes so we reference it by its "token" of 380014). Each file will be the first 4 characters of the 8 character long primary IDs of each block. E.g. file 1020.dat would contain records 10200000 -> 10209999. We then have all kinds of other files used for indexing and data locations that are built by tools over those files as well as overflow data files when those 1024 bytes just weren't enough.

I should point out this is a legacy system and for very good reasons we moved to an actual database a long time ago.

discuss

order

xyheme|2 years ago

Why not use one JSON file as one record of data, and use pathname as primary ID?

Daeraxa|2 years ago

Because it predates JSON by over a decade?