I want to create an FDB instance holding holding several hundred-thousand collections of items. Each of these collections have a name, and need to be re-namable. I’d appreciate the community’s opinion on this.
1. Separate Name Index
First idea is to use a separate index for the name. The main data entries would look like this:
(app_dir, collections_dir, 1, item1) = data1
(app_dir, collections_dir, 1, item2) = data2
...
Then the index would look like this:
(app_dir, names_dir, collection_name) = 1
2. Collection Directories
The second idea is to use directories for each collection which are inherently re-namable:
(app_dir, collections_dir, collection1_dir, item1) = data1
(app_dir, collections_dir, collection1_dir, item2) = data2
...
I’m leaning towards the first plan because I don’t know of a way to stream a list of subdirectory names. One of the things I need to be able to do is list all collection names. Because several hundred thousand names may fail to be read in a single transaction, I wanted the ability to perform a long multi-transaction range-read on the contents of the collections_dir
. The directory API doesn’t currently provide this, correct?