Active Storage in production: lessons learned and in-depth look at how it works

26-Jul-2023 491
1. IntroductionIn my company, we lucked out that Rails 5.2 (and Active Storage) was released just before we needed to implement user uploads. This means that we have been using it in production for over 5 years, across 3 different hosts (Heroku, AWS, and GCP) and 3 different storage providers (S3, GCS, and R2).Our primary use case is image galleries, either of products we sell, or user-uploaded images on their wedding/birthday/baby shower websites. This means that we rely heavily on image transformations, which Active Storage makes trivial to generate.While we love Active Storage (which I’ll call AST from now on), there are certain design decisions in AST that one should be aware of, as they have an impact on the overall performance of the app, and not just the pages that use AST.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle