I'm looking for a way to work with a huge amount (~10^9) of files (all sizes) in .NET using unspecified file system (NTFS, BTRFS...).
What I have done up to now is to store them in evenly in a folder-tree so that no folder has any more than a couple of thousand files in it. The fs can handle it but there are other problems with this approach. Whenever I need to scan through the files in .NET or do other file operations on them, for instance move to another disc or delete them etc, it takes forever...
I have made some tests combining the files into a few really large files and then index them from a separate hashtable-file, and this shows much promise. Scanning through the "virtual files" is now extremely fast compared to before. But my new problem now is concurrency. I want to be able to read and write (including delete) transactionally to these virtual files as if they were normal files on disc (preferably lock-free). I could continue work on my own "VFS" for this, but something tells me there's already existing options that fits this usecase?