For data that changes quickly, such as product catalogs, shopping carts, user lists, or order data, it is worth using a DBMS, and they need disks to work, that is, standard block storage, in particular HIgh-IOPS SSD or NVMe with high response speed. They have enough performance to provide the necessary speed of processing calls and user data, which means that your customers will be able to place orders and view products quickly.
However, in addition to this, online stores need to store a large amount of media content: images in product cards, video reviews, and so on. These files can be stored on the hard drives of conventional servers, but this is expensive: you have to buy a lot of disk space, especially if you need to store media files.
Also, you need to organize simultaneous access to the media files of the online store for many users. If you place them in classic disk storage, then the content may take a long time to load on the site due to the technical limitations of conventional storage systems.
If there are few files and requests, there are usually no problems, and there are enough disks. But if the store is large and has a lot of content, you can try an alternative – S3 cloud storage. They are arranged differently than classic discs:
- Millions of users can communicate with one file simultaneously, and the download speed does not drop from this.
- For large amounts of data, storage is much cheaper than traditional disks. For example, storing 1 TB of data on disks will cost about 11,600 ₽/month, and S3 storage will cost about 1,750 ₽/month.
- The storage automatically expands almost indefinitely, along with the volume of files. The situation that you do not have enough space for new data will never arise.
- S3 storage has high fault tolerance; data is distributed across different availability zones. Due to this, a high SLA for data storage of 99.9999% is achieved.
- The files will not be on your site but in a different place. The object storage service itself will process calls to them. Thanks to this, the load on your server will be lower and even heavy videos will not slow down its loading.
Content is accessed via a regular HTTPS link: you only need to embed a link to the site page, and the object from the storage will be loaded automatically when the user views the page. However, he cannot change anything in your file and does not see other files.
To better understand how this works, think about any online movie theater – most of them, like Netflix, store data in object storage. And there you go to the site, click on the video and immediately start watching – in this case, you get into the S3 storage, but you do not have access to modify the video or view other files in it.
S3 storage is characterized by high performance, but a load limit varies on specific projects. That is, depending on how the data in the application is organized and the number of requests, you can hit the service performance ceiling. In this case, you need to revise the data structure and rewrite the application or connect a content delivery network (CDN) to the storage, which will be cheaper and more accessible.
With the help of CDN technology, the media files of your online store will be loaded quickly even by users who are far from the servers – somewhere in Vladivostok or the USA. The content is duplicated on intermediate nodes – servers located in different cities and countries; they work on fast disks and are close to the main communication channels. For example, for a resident of Vladivostok, the site will be loaded from a server in Primorsky Krai.