Skip to content

First-party "Bucket" support #38

@Turnerj

Description

@Turnerj

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.

MongoFramework could have custom attributes to handle the pre-allocation of arrays (which is beneficial even without the idea of "buckets").

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions