veliovgroup / Meteor-Files

🚀 Upload files via DDP or HTTP to ☄️ Meteor server FS, AWS, GridFS, DropBox or Google Drive. Fast, secure and robust.
https://packosphere.com/ostrio/files
BSD 3-Clause "New" or "Revised" License
1.11k stars 167 forks source link

Update GridFS docs #814

Closed Prinzhorn closed 2 years ago

Prinzhorn commented 3 years ago

As far as I understand the following statement is incorrect and does not make sense:

In a larger app we will need lots of buckets in order to horizontally scale.

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.

jankapunkt commented 3 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

Prinzhorn commented 3 years ago

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.