Closed Prinzhorn closed 2 years ago
I totally agree with your comment, that buckets are rather used to organize than to scale but then please add this to your PR because otherwise nobody knows why they should use buckets at all
because otherwise nobody knows why they should use buckets at all
I think the first section explains what a bucket is quite well and links to the GridFSBucket docs
This example shows how to handle (store, serve, remove) uploaded files via GridFS. The Javascript Mongo driver (the one that Meteor uses under the hood) allows to define so called "Buckets".
The Buckets are basically named collections for storing the file's metadata and chunkdata. This allows to horizontally scale your files the same way you do with your document collections.
As far as I understand the following statement is incorrect and does not make sense:
The number of buckets has nothing to do with scaling per se. If you store images you need an image bucket. If you store documents as well you can have a second bucket for documents. This is just the way files are organized (e.g. S3 also calls the highest level a bucket, which has keys of files). Or you could have a bucket per user or domain I guess. That's just the way files are organized. Even if you throw every file in a single bucket scaling via sharding is unaffected.
Or am I missing something? I'm just getting started with Meteor-Files and found this part of the GridFS docs confusing.