pillaiindu

pillaiindu

Anything like Rails ActiveStorage coming to Phoenix?

Showing Posts 1 to 10

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Hey @pillaiindu can you expand on this question to talk about what ActiveStorage does and what about its approach would make sense to translate to Elixir?

kokolegorille

kokolegorille

it is a file upload system, new in Rails 5.2, similar to Arc Ecto.

It also allows to switch platform easily, like switching from local, to aws, to google cloud IIRC.

Did You have a look at Arc Ecto @pillaiindu ?

MrDoops

MrDoops

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 Bitbucket 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:

yordisprieto

yordisprieto

While I totally agree with you about differences between stacks and Active Record and everything you said,

we need to understand the root of these questions.

It is not technical the root of these questions most of the time coming from Rails/Ruby folks. Many of them, included me, don’t know how exact technical details of the things we use.

When people ask these questions they care about connivence, saving time, no having to think about X problem but simple use something that solves it.

Is that good?! Depends, all depends.

Arc and those solutions are no up to Active Storage level yet and so far from my research.

brightball

brightball

The biggest perk of ActiveStorage (when I looked at it) was that it focused on uploading images and then doing transformations on request rather needing to know all of them on initial upload.

This is similar to the approach that you would take using imgix and IMO is the ideal way to handle image transformations.

Combine ARC with an imgix account and you’ll get a better experience than active storage (for images).

ibarch

ibarch

With all respect to Arc author, I think the package is outdated and poorly maintained.
Other solutions are either low-level (Plug.Upload, ex_aws_s3) or immature (belt, bow, upload, etc).
File handling is such a frequent requirement and crucial part of many apps.
Maybe ecto/phoenix/absinthe core team could help the community with one well-designed package?

cnck1387

cnck1387

I’ve been using arc. I haven’t deployed my app yet, but the functionality is there to:

  • Upload a file
  • White list specific file types
  • Ensure uploads aren’t over a specific size (with Plug.Upload)
  • Use imagemagick to create different sized images and save-as a specific file type

So far it’s been working pretty well with local storage, but at the same time I wouldn’t mind seeing something more official. It looks like arc / arc_ecto is in maintenance mode and issues are quickly stacking up.

wmnnd

wmnnd

Why do you think, Belt is immature? Have you had any problems with it so far? It works fine in production for me :slight_smile:
(Disclosure: I’m the author of Belt)

jeremyjh

jeremyjh

So its true the Arc maintainer is looking for help for a long time without much success. But most of the open issues are feature or support requests, not actually problems. We’re using arc_ecto in production without issues and did find it very convenient and easy to use. What are the actual problems people have had while trying to use it?

dimitarvp

dimitarvp

Without specific complaints this is very nonconstructive thing to say.

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 91898 914
New
AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4616 55835 594
New
byu
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project. My initial shotgu...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
matt-savvy
Is there a word for the ~> symbol used in Version strings? Do you also just call it a Squiggle Arrow™ ?!
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews