# Avatar Offloading to S3

**URL:** <https://meta.discourse.org/t/avatar-offloading-to-s3/46406>\
**Category:** Feature\
**Created:** [24 Giugno 2016, 3:44pm UTC](https://meta.discourse.org/t/avatar-offloading-to-s3/46406 "2016-06-24T15:44:06Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jongnam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jongnam/32/52330_2.png) [@jongnam](https://meta.discourse.org/u/jongnam)\
**Post date:** [24 Giugno 2016, 3:44pm UTC](https://meta.discourse.org/t/avatar-offloading-to-s3/46406/1 "2016-06-24T15:44:06Z")

</div>

I use AWS for hosting a Discsourse along with S3 as image store and CloudFront as CDN. Images are uploaded to S3 bucket, and the users accessed it via CloudFront edges for faster transfer.

Meanwhile, in April 2016, S3 released a feature called Amazon S3 Transfer Acceleration, which is simply to provide CloudFront enabled S3 endpoint by clicking the checkbox on bucket option.

> **[AWS Storage Update – Amazon S3 Transfer Acceleration + Larger Snowballs in...](https://aws.amazon.com/blogs/aws/aws-storage-update-amazon-s3-transfer-acceleration-larger-snowballs-in-more-regions/)**
>
> Several AWS teams are focused on simplifying and accelerating the process of moving on-premises data to the cloud. We started out with the very basic PUT operation and multipart upload in the early days. Along the way we gave you the ability to send...

> **[Transfer files into Amazon S3 up to 300% faster - AWS](https://aws.amazon.com/about-aws/whats-new/2016/04/transfer-files-into-amazon-s3-up-to-300-percent-faster/)**
>
> Discover more about what's new at AWS with Transfer files into Amazon S3 up to 300% faster

After a few testing, I decided to move S3 from Tokyo region to Seoul region for better latency (my users are based in Korea) and to use S3 acceleration. I was able to use S3 on Seoul and its S3 acceleration endpoint as a CDN url; and finally I did rebake posts via rake posts command. The post images were well migrated to new S3 location, but turned out the users’ avatar image was hosted on web server and all of them are be broken. (That is okay for now as I asked users to upload avatar again)

**The question is, how can I offload the avatar images to S3?**

- I run it on EC2 instances with auto scaling group, which runs 1 server at midnight and runs 4 servers at daytime. If the avatar images be uploaded to/served from S3, I do not need to worry about image loss. If it is be served from EC2 host, a user may upload the avatar to one of 4 EC2 instance, but chances are it may not be served from other EC2 because they don’t have it.)
- The S3 transfer accelerator is served via ClodFront CDN edges which provides faster speed. so I can leverage CDN for avatar images without configuring CDN by my own.
- S3 data is redundantly stored across multiple facilities and is designed for durability of 99.999999999% of objects. In other words, I rather trust S3 for my data durability over hosting them on my EC2 instances which is managed by me who I do not trust at all.

---

_[View the full topic](https://meta.discourse.org/t/avatar-offloading-to-s3/46406)._
