-
-
Notifications
You must be signed in to change notification settings - Fork 874
Description
While cool in many ways, the tree based RidBag feature can be a pain to deal with for languages that enforce or encourage asynchronous APIs for IO (e.g. node.js). It's painful because if I want to offer a consistent API between embedded RidBags and tree based RidBags, I have to make the embedded API async even though I already have the data. This means that I cannot, for example, reliably JSON.stringify() a record containing a bag.
For the most common cases, I also think that the default bonsai tree threshold is too low. At 80 items and after base64 encoding, the tree weighs in at little more than 1Kb, this is not a lot of data, and from the clients point of view it's going to be more efficient to lazily decode that blob than to fetch it remotely from the server. This will hold true even with 10,000 records in the bag.
It would be awesome if it was possible to selectively increase the threshold for the tree based RidBag feature or skip it entirely for certain clients or queries. I think it's really useful only for very huge data sets.