Best solution to host images and videos

by PennyWise   Last Updated August 25, 2019 13:04 PM

I have developed an application where users can post messages. Let's compare it to Facebook for a minute: a user can add a new message and then it appears in the feed of their followers. Now want to introduce the possibility to add photos and videos to these messages, with a maximum of 5 media items per post.

I currently host my server backend on a DigitalOcean droplet and the database on a separate droplet. Very easy setup for this. However, now I am thinking about introducing these photos and videos as well.

My application currently compresses video in JPEG format to 100 - 200 kB per image (let's go with 200 kB) and video is compressed to 3 - 4 MB per 15 second video (MP4 H.264).

I am now on DigitalOcean Spaces, which offers me 250 GB storage and 1 TB transfer for $5 a month. Additional storage is billed at $0.02 per GB and excess transfer is billed at $0.01 per GB.

Let's say I have a 1,000 users who each post 10 videos and 10 images per week. That would be 40 MB for video and just 2 MB for the images. So 42 MB for storage per user x 1,000 equals 42 GB for 1,000 users. Considering each user has 50 followers, each file would be downloaded 50 times (and then cached - I know the file could be downloaded later on again, but for sake of easiness let's not take that into account), so this 42 GB would consume 2.1 TB in monthly transfer.

That would cost me the regular $5, which would be sufficient for storage and 1 TB of transfer, but then an additional 1.1 TB would cost me an extra $11. That's $16 monthly for this setup.

Is that a fair price, or are there other options I should consider? I have been looking around at Amazon AWS, Firebase and other well-known providers, but it all seems to sort of turn out the same at the end of the day.

I am concerned a little when this scales - it would increase cost of course, but if I view a user's profile and watch all images/videos like I can do on Facebook/Instagram/Twitter, the cost of bandwidth would increase a lot. Also, month after month storage will increase so af

Related Questions

Updated November 24, 2016 08:01 AM

Updated August 26, 2018 06:04 AM

Updated September 28, 2016 09:01 AM

Updated April 25, 2016 08:01 AM

Updated August 26, 2017 02:04 AM