Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.1.2
-
None
Description
Currently when use oak with mongo mk for blobs storage we can easily end up with all different chunks of a binary streams scattered across the shards.
Now this is not ideal since it generates a large number of scattered gather queries over the shards for each individual files.
To allow better locality I propose the addition of another field called _anchor
This anchor field will be generated by the inverse order of the current timestamp of beginning of the storage of the file:
//Milliseconds Second Minute HH SimpleDateFormat sdf = new SimpleDateFormat("SSSssmmHH"); //store the parsed integer of this value for more storage efficiency String a = asdf.format(new Date()); int _anchor = Integer.parseInt(asdf.format(new Date()));
This new _anchor field should be part of the shard key which also requires to be indexed along side with _id
Pull request is on the making!
N.