Hacker News new | ask | show | jobs
by charcircuit 394 days ago
Files are often authored once and read / used many times. When authoring a file performance is less important and there is plenty of file space available. Indices are for the performance for using the file which is more important than the performance for authoring it.
1 comments

If storage and concern aren't a concern when writing, then you probably shouldn't be doing workarounds to include the index in the file itself. Follow the dbm approach and separate both into two different files.

Which is what dbm, bdb, Windows search indexes, IBM datasets, and so many, many other standards will do.

Separate files isn't always the answer. It can be more awkward to need to download both and always keep them together compared to when it's a single file.