Here are a list of advantages/disadvantages of both solutions.
1. Hierarchical structure (configurable tree)
Advantages
- configurable structure; splits node only when required
-
less memory consumption
- better structure control
Disadvantages
- mapping between hashed ID and persistence path needs to
be stored
- possibility of assync. situations between the existing storage
persistence and stored mapping (in case of some external factors alters the
persistence storage)
- implementation effort
2. Hierarchical structure (deterministically calculation)
Advantages
- deterministically calculation -> no mapping needs to be
stored (hashed ID - stored path)
- less implementation effort (almost
done)
Disadvantages
- less control of the hierarchic structure
- nodes gets
split depending on the matching coincidence between the first string part of the
hashed IDs that is used by the deterministically calculation
- memory
consumption and faster risk of OutOfMemory occurrence (the file system APIs
creates listeners for all these sub-folders in order to provide cache (refresh)
functionality, so for single record there will be 5 listeners (4 sub-folders + 1
record) created and memory consumption increases significantly).
Best Regards,
Marius