DEV Community

Robert Sfarzo
Robert Sfarzo

Posted on

Rails Active Storage

App feature
You want your users to upload and store large objects like media and document files.

Challenge
Many of our Rails deployments have, and should have, persistent storage for the server application code. While we can have public folders, we really do not want to store large files there. Why? It doesn't scale. When we scale up our server to accommodate surges in requests, we would waste a lot of time and space copying over a huge public folder. And, syncing would be a challenge for create, update, and delete operations.

Recall
To save information in relational databases, we tie our Active Records to database systems like PostgreSQL. Databases are designed to be well-synchronized. But, we don't put huge data objects in the database, and usually we store a link to some persistent storage locations.

Active Storage
I stumbled into this topic today when saw a cool post about how to utilize Active Storage for AWS S3.

And that led me to Active Storage in general for attaching cloud files (Google, Azure, AWS, etc.) to our Active Records. Cool!

Top comments (0)