Many Tiny Objects

Suppose a use case would lead to creation of hundreds of thousands of objects having so few as two fields, with some of the fields pointing to other tiny objects. Of course a naive implementation would just map each of these objects to a single MongoDB “document” (I had rather say “record”), and use the MongoDB _id field as the form of reference from object to object. I suspect this would run like molasses in January. Has anyone built and tested an application that groups tiny objects into records? Then how does referencing between them work, and caching?

I would start by looking at https://docs.mongodb.com/manual/core/data-model-design/.

I think the bucket pattern at https://www.mongodb.com/blog/post/building-with-patterns-the-bucket-pattern might be applicable for your use-case.

1 Like