-
-
Notifications
You must be signed in to change notification settings - Fork 35
Description
As referenced in a few places it can be helpful to store documents in buckets.
Note: This is NOT referring to $bucket support, but the idea of storing the data in buckets.
Buckets are a great combination of having lots of little documents stored in arrays across a number of larger documents.
Interacting with this data structure though can be a little cumbersome. It makes reading and writing data require a few extra steps to get the data, models need to be updated to handle it and if not implemented properly can have write performance issues.
The write performance issues relate to a bucket that has constant writes/pushes of items to the internal array which may require additional IO to move the bucket around in memory or on disk. To avoid this, it is best to pre-allocate the array of data with blank items.
What would be even better though is if there was first-party support for just working with buckets. Maybe new APIs on a MongoDbSet (or even a new class) which simplifies all the aspects of buckets.
What that change might look like is still in the process of being identified.