apps/docs/content/guides/storage/buckets/fundamentals.mdx
Buckets allow you to keep your files organized and determines the Access Model for your assets. Upload restrictions like max file size and allowed content types are also defined at the bucket level.
There are 2 access models for buckets, public and private buckets.
When a bucket is set to Private all operations are subject to access control via RLS policies. This also applies when downloading assets. Buckets are private by default.
The only ways to download assets within a private bucket is to:
storage.objects table will use this user to determine if they have access.createSignedUrl method that can be accessed for a limited time.When a bucket is designated as 'Public,' it effectively bypasses access controls for both retrieving and serving files within the bucket. This means that anyone who possesses the asset URL can readily access the file.
Access control is still enforced for other types of operations including uploading, deleting, moving, and copying.
Public buckets are more performant than private buckets since they are cached differently.