High Scalability app- Photos based and videos

Background - My app is related to Chef where people will post pics and videos. These numbers would be huge.

Tech stack - RoR, nginx, Postgresql, AWS.

My question :

  1. Since there would be lot of files, what would be the suggestion. Should I use s3 to store the images. Have CDN implemented?
  2. I would be tagging the files so that they would be searched on those tags. What is the best way to store the tags?
  3. Load Balancing?

I was looking at how FB is storing the images and videos. Not sure if I have to do it because mine is a small app.

P.S - I have already done the MVP with basic s3 setup but there are performance issues.

I was wondering to use another DB since images and videos are unstructured. (Correct me if I am wrong) I am posting this because I have an actual working problem.

1 answer

  • answered 2018-01-17 11:17 Aditya

    This is a vast question, and answers may vary depending on different opinions and experiences. But On the lines that you are thinking, AWS S3 is a good option to manage files, especially media. You can also search through s3, and associate meta information with files which you might want to call tags. To Scale it more for reads, you can also setup elastic search or opensearch server to index the image distributions in s3. The best way is indeed indexing, whatever tools or platforms you use. But Using indexing cant be achieved always, due to project constraints including costs. Infact you might not even want CDN because S3 is itelf geographically distributed in wider regions and you can leverage that.


    Yes, you index the stored images information. You can set up elastic search server whose index will always be updated. If you are not keen on investing in elasticsearch, you can setup a simple database of your choice without worrying future's future's issues. May be you can setup NoSQL (DynamoDB AWS). On every store in s3, create a trigger to update the DynamoDB with its information storing tags and other meta information. You can retrieve that information and display image from s3 URI stored in that DynamoDB map.