Anything like Rails ActiveStorage coming to Phoenix?

I’m currently building an over-engineered file management solution for micro-service architectures…slowly. I’ll post about it when I think it’s beat into better shape.

If you don’t like how Arc works you could build your own with ExAws.S3, pre-signed urls and a files table with belongs_to associations to your other records in Phoenix. That’s most of what Active Storage is doing anyway. You might also look at https://bitbucket.org/pentacent/belt as another option to Arc.

My concerns are with how a file-management solution would to fit the multi/micro-service architectures - there’s more to think about with those requirements in mind. On one end you need to define a behavior all the adapters should implement, and doing so generically with varying API’s between major storage services (Google, Azure, AWS, Digital Ocean). Right now I’m building it as a set of OTP applications using Ecto and Postgres for persistence and queries with a separate core application for handling commands, monitoring uploads, and fetching pre-signed urls (Phoenix for web layer only).

The set of features for Storage Service integration that makes sense in Ruby/Rails doesn’t make perfect sense in Elixir/Phoenix. From what I’ve looked into Active Storage, it’s largely built with the assumption that you only need to associate files to Active Record. Active Record is CRUD, and in the world of Elixir, CRUD is just one option. Most file management problems I’ve worked with also require a file to be attached to multiple records/ids across separate applications and platforms. I want to be able to manage files in one place, but re-use and associate a file to any service that needs upload capability; there’d need to be some kind of tagging and event-messaging integration that’s flexible enough to work with different kinds of micro-service architectures.

Anyway, just thinking out loud - sorry for the long response. :sweat_smile:

2 Likes