in reply to Design flat files database
In the system that I recently (re-)designed, I allocated 1,000 elements at each level of the hierarchy (which replaced a monstrous blob-table), except the first, which contains 10. I did this rather arbitrarily, and mainly so that a manual directory-listing would not be inconveniently long. Most modern file systems are pretty smart, with B-tree index structures and a recently-used files/directories cache. I think that the major consideration here should simply be, what do you find convenient to handle should you ever be working with these structures yourself, i.e. apart from the software.
In my directory table, I stored the reference number (from which the file-location is calculated on-the-fly in case the topology changes someday), and I also stored an SHA1 signature of the file’s content and its length in bytes. If the application finds a mismatch, it throws an error.