DB size limiting mechanism

I’m going to share my MongoDB instance with other users and I wanted to know if there are any built-in database size limiting mechanisms other than the capped colletions?

I’m afraid of people who will try to overload my resources. And I would prefer to use ready-made solutions from MongoDB to prevent them from doing so, or possibly to block such a user but I found nothing.

If a similar topic exists, I apologize for spam, I searched over a dozen topics, but I did not find the answers that interest me.


Hi @Marek_Winiarski and welcome in the MongoDB Community :muscle: !

To my knowledge, there is no such thing. Capped collection are the right solution to limit the size of a collection. You could also use TTL indexes but that’s not really limiting the actual size of the collection.

You could run separate mongod instances into docker containers and limit the disk size of each instance… But that’s really all I can think of right now.

You could also obtain a similar result by partitioning the disk in X partitions and run X mongod but then they would all share the same RAM and you would have an issue there too potentially. At least with docker you could assign a limited amont of ressources to each container and thus user.

I’m not really solving your issue here but at least it’s something you could explore.
I hope this helps :smiley:.