Subset Pattern vs Bucket Pattern

Is Subset Pattern similar to Bucket Pattern?
Because when you use Subset Pattern is because you need to split the collection because the document
is very big, and when you use Bucket you can have the same reason, for example, a lot of values from sensors, so the solution is to create new collections to store these values? Then it is very similar. What are the differences?


In the Bucket pattern we’re grouping all the data into logical groups within the same collection.
In the Subset pattern we’re splitting the data into two collections; 1) most used/accessed/relevant and 2) others.


Thanks, It is clear now.
I have other question related with Subset Pattern: if we divide the model in for example two (or more) collections, is MongoDB engine working different (internally I mean) with collections that are used more often than others? Or the benefit is only reduces the size of the documents so is a very good way to reduce memory and resources needed? Thanks

Correct! It keeps the working set small so that it fits in memory, it becomes quicker to retrieve and the returned documents is relevant/focussed.

1 Like