How @appics can save money on their AWS storage bill | Leveraging the power of CloudFront and S3 lifecycle policies

in steemdev •  2 months ago 


image.png
Source: APPICS website

About a month ago, I came across one of @exyle's appics posts and found out he was using it on an iPhone. I knew the appics app was out for Android but didn't know there was an app available on TestFlight. I was pretty keen to try it out because I get FOMO pretty easily, and there was no way I was moving back to a non Apple device 😂

I decided to create an alt account for appics so as to not clutter my main account. The app works pretty well, but as it's quite new (compared to say Instagram). There's not much content on there that I'm interested in yet. Regardless, I will keep posting and curating so my little image portfolio grows over time.

As I'm a bit of techie, I noticed that appics is serving their images from Amazon S3. I think using object based storage in S3 is fantastic because of its 99.999999999% durability over a given year. Also, you don't have to worry about maintaining a server to host the files, patch it, keep an eye on the disk space et al. The only thing you have to concern yourself is uploading the files! To serve files from the bucket, all you have to do is enable Static website hosting in the bucket properties. Here's an example of a said bucket I host for @ausbitbank's landing page:

image.png

You'll also have to ensure that the objects are set to public read:

image.png

Then you can access it via an S3 url like one of my appics images:

https://s3.us-east-1.amazonaws.com/appics-content/b8068a9835e03fe8023ff86cca527ab7-640

That's all pretty easy right? Correct, but you must be aware of S3 pricing (although scalability is not an issue). Let's keep the numbers really simple and say appics is using 1TB of data stored in S3. This costs ~$24.10 per month in the us-east-1 region. Let's also guess that the outbound data transfer to the internet is about 1TB per month—this costs $92.07.

image.png

So it's about $114.77 USD per month just for serving image files (not including any other resources they use like web servers). This number will only get larger as they grow. I would suggest the following:

  1. Leverage the AWS CloudFront service.
    Simply create a new CloudFront distribution and set the bucket as the origin. Not only is this an instant performance boost for users around the world, it's also significantly cheaper to serve files. Of course, this would require some sort of database update because the urls will change. In any case, this small change drastically reduces costs already:

image.png

  1. Use S3 lifecycle policies
    What is the lifespan of an appics image? 7 days (just like the Steem payout window?). How often will someone view an appics image back from 3 months ago? These are all hard questions to answer but one could make some educated guesses. S3 has the ability to store objects in different tiers which reflect different prices. @appics could simply try one of the following lifecycle policies (without any change to underlying code):
  • Transition to S3 Infrequent access after 30 days
    image.png

  • Transition to S3 Intelligent tiering after 30 days
    image.png

S3 Standard-IA is the same as normal S3 storage class but you pay a little extra to retrieve the object. So it's good for images that need fast access when requested, but not necessarily accessed frequently.

S3 Intelligent-Tiering is a magic tier that determines the storage class automatically based on usage patterns. It's a relatively new offering from AWS and they charge a monitoring fee for each object. Still, it's going to save money if you are storing a large amount of data with unpredictable access patterns.

So there we have it...a brief rundown on cost savings in AWS S3. Without knowing what other AWS services they use, there's could be also more to money to save!

Yours truly,
@contrabourdon



Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

@tipu curate

Upvoted 👌 (Mana: 1/10 - need recharge?)

Thank you @miti! !SHADE 1



@miti you have received 1 SHADE from contrabourdon!
View and trade the tokens on Steem Engine.


This tip bot is powered by witness untersatz!

@tipu curate
@giphy curate 100


A huge hug from @amico! 🤗

#sbi-skip !trdo

Congratulations @amico, you successfuly trended the post shared by @contrabourdon!
@contrabourdon will receive 0.30539025 TRDO & @amico will get 0.20359350 TRDO curation in 3 Days from Post Created Date!

"Call TRDO, Your Comment Worth Something!"

To view or trade TRDO go to steem-engine.com
Join TRDO Discord Channel or Join TRDO Web Site

Upvoted 👌


Powered by witness untersatz!
Current VP: 68.62%

Thank you for supporting @CatsMakeKittens by being a part of our community @contrabourdon.

Each CATS you purchase gets you daily upvotes from me @CatScientist as our community grows so do your rewards for being a member!

Congratulations @contrabourdon! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 40000 upvotes. Your next target is to reach 45000 upvotes.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

You can upvote this notification to help all Steem users. Learn how here!

!shop
!BEER
for you

你好鸭,contrabourdon!

@eii给您叫了一份外卖!

@cherryzz 阿紫 迎着沙尘暴 开着汽车 给您送来
新鲜出炉的炸芋头片

吃饱了吗?跟我猜拳吧! 石头,剪刀,布~

如果您对我的服务满意,请不要吝啬您的点赞~
@onepagex

石头


You win!!!! 你赢了! 给你1枚SHOP币!



Hey @contrabourdon, here is a little bit of BEER from @eii for you. Enjoy it!

I found this to be quite a useful and dare I say it, exciting intro to the world of hosting on amazon!! I should get out more. :OD

There's a lot of useful stuff. You just need to be careful and it's how they bill. Thanks for dropping by 🦁

Hey @contrabourdon! Thanks for your effort to research all this and help out APPICS, we appreciate it. We were also told by some others that we could switch to a more affordable server storage like wasabi for example. We will look into the different solutions!
Thanks for sharing and see you on the APPICS App!

Congratulations @contrabourdon, your post successfully recieved 0.30539025 TRDO from below listed TRENDO callers:

@amico earned : 0.2035935 TRDO curation


To view or trade TRDO go to steem-engine.com
Join TRDO Discord Channel or Join TRDO Web Site