S3 is an object storage service according to the AWS website. Basically it is a cloud based file storage facility. The purposes for cloud based file storage are of course endless, but since the files can be made accessible via HTTP our main purpose is to use S3 as a Content Delivery Network or CDN.
Laravel has support for S3 out of the box and when configured correctly it can use the cloud storage in the same way as a local file system. This ideal when for example the application allows users to upload images or other types of assets. The user can upload the asset to the web server running the application, which in turn can upload the file to S3. It can then be downloaded from S3 instead of the application server.
However S3 can also be used to store backups, Docker images, big data, small data, any kind of data (unless the file is bigger than 5 terabyte).
A storage space on S3 is called a "bucket". Buckets make it possible to have separate places where we can store data and have separate permissions.
Inside a bucket there can be files and folders. Making separate buckets can be useful when for example we have multiple types of files (images and documents).
Example:
Now we noticed that loading of the images is pretty slow when the site is accessed from Europe (our bucket is hosted in Asia). This is important because the images are displayed on the top page. Having the images in a separate bucket allows us to add an endpoint in Europe as well, like a mirror. If we would have placed the images and documents in the same bucket then we would have no other option than to share the documents from the other region as well (making for higher costs).
Please see the official documentation on AWS:
https://aws.amazon.com/s3/getting-started/
For more info on how to use S3 in Laravel: