Data Storage
Data that is stored in databases is structured and usually smaller in size. However, there may also be larger data items that need to be stored somewhere. For the photo gallery, large amounts of photographs need to be stored. With each of them being a few megabytes, having many albums worth can quickly lead to terabytes of data. When videos are added to the mix, these numbers rise even quicker.
Selection
I will focus on three ways to store such data:
Each of these methods can be provided by several software systems, but from the perspective of the application, the actual implementation is largely abstracted away.
Criteria
To come to an objective choice, I will compare the data storage options based on the criteria listed below.
Total size
Weight: 5. The storage system should be able to handle millions of items and the resulting amounts of data, which could add up several terabytes worth, or more when videos are included.
Item size
Weight: 3. Some photographs, for example panorama’s, may be rather large in size, not to mention video files. Therefore, the system should support storing files that are several gigabytes in size.
Performance
Weight: 3. The system should provide good performance in both adding files to the system and retrieving them from the system.
Accessing data
Weight: 3. The most common operation will be retrieving items from storage for the user. The service should make it easy to serve its contents.
JavaScript support
Weight: 5. The storage service should be accessible from the application and should therefore have interfaces or libraries for JavaScript (and, preferrably, TypeScript).
Scalability
Weight: 2. A data store that is able to scale can allow our application to grow to larger sizes.
Portability
Weight: 1. Being able to access the data from a different machine, or multiple machines at the same time, can be useful when the application has to transfer between servers.