I would go :
1. count records
2. make copy
3. insert
4. ensure records = records + 1
5 if records != records +1 or file can be grepped, stat, filesize, then assume is corrupted and rollback to copy
Use `look` to get `O(log(n))` lookups (writes are still slow, but you could use a multi-level chain I guess). `join` does not use binary search even though it could have.