1,641 karma · joined March 19, 2014
I blog (very infrequently) at https://www.mikewilson.dev if you want to get a hold of me!
Anybody have any guides or guidance on making the migration? I feel comfortable managing the VPS, but not sure what else I'd need to take on by moving to a dedicated server. I imagine hardware monitoring would be one, but what else?
Edit to add, Ash is built on top of Ecto. The escape hatches are there, and easily accessed if needed. Ash.Query is very powerful and I haven’t needed any escape hatches on a small to medium sized project so far.
While I’m not “vibe” coding, it is nice to be able to ask human language questions and have the LLM query the database to answer questions. Or while working on a feature, I can ask it to delete all the test records I created, etc. I can do that in a repl myself, but it’s sometimes a nice shortcut.
Note, this only runs in dev, so it’s not querying my production database or anything.
Basically, they can be a way to expose additional data or tools to the LLM.
As an example, I wanted to add support for adding tags to a resource, and support filtering for the resource by the tag, and I wanted to be able to do this filtering both through Elixir functions as well as GraphQL.
Can I do this with Ecto? Absolutely, but I'd have to build it all myself.
With Ash, I created a `Tag` and `Tagging` resource, adding a `many_to_many` block on my resource, marked it as public. Then I added the `AshGraphql.Resource` extension to my `Tag` resource, marked it as filterable and I was done.
Now I can filter and sort by tags, filter by where tags _don't_ exist and more. I didn't have to do anything other than model my domain, and Ash took care of the rest for me. Not only that, but it probably did a lot of things for me that I probably wouldn't have thought of, such as supporting multi-tenancy, policies and more.
It really is a lovely tool, I can't say enough good things about it.
Does it have a learning curve? Absolutely! Is it worth overcoming it? Again, absolutely!
If I didn't need native functionality, I'd probably just use the recently released `phoenix_vite`: https://github.com/LostKobrakai/phoenix_vite
I think it helped that at the time I was trying to build some pretty advanced filtering functionality using Ecto and was having a pretty tough time. While searching for solutions I saw a few mentions of Ash and that it could solve the problem out of the box.
After a few days of experiments, I found that it was able to do the filtering I wanted out of the box and was even more functional than what I was trying to build.
For reference, I was trying to add some tagging functionality to a resource and I wanted to be able to filter by that tag, including multiple tags. Can I do that in Ecto? Of course, but Ash provided that out of the box after modeling the resource.
I wish Elixir had more mindshare beside just LiveView and "real time" type functionality. Even building a GraphQL/JSON endpoint without real-time requirements, the functional nature (no side effects), pattern matching and ruby inspired syntax makes writing plain old JSON controllers a joy.
While Elixir might not have a package for every use case under the sun, the low level primitives are there.
What I'd really want is a way to easily hide it, which I did quite frequently with Copilot as its own pane.
Going from Qeynos to Freeport, or crossing the ocean on a boat felt absolutely epic and dangerous. It was wonderful, but not something I would want to play today now that I have real life obligations.
Maybe it's just me, but I found the Ash (and ecosystem) codebase a lot more approachable than something like Rails.
The first few weeks on the project were tough, and the documentation challenges are certainly there, but they get better day by day.
After getting comfortable and accepting the "Ash" way, I've found my productivity to skyrocket when using Ash to build an Absinthe GraphQL api. Previously I'd have to build the context layer, then the resolvers, etc.
Now with Ash, I write my action, declare my query/mutation/subscription and get all the rest for free. I can't see myself going back to writing Elixir apps without Ash.
Keep in mind that Ash doesn't really replace Phoenix or LiveView (or Ecto), but it's built on top of it. You can still use Phoenix and LiveView the same way you are today, and just rely on Ash to build your context for you and how you interact with your resources. So I'd say it "replaces" Ecto in that sense (though it's all Ecto under the hood).
For me, I'm building a native app with a GraphQL backend and it has been an amazing productivity increase. With Ash, GraphQL on the backend and React and gql.tada (https://gql-tada.0no.co/) on the front-end providing a fully typed experience, I feel even more productive than using LiveView.
As a quick example - I have an existing derived GraphQL endpoint with a query for getting a resource, and I can have basic filters and sorting out of the box from Ash (i.e. filter by status, sort by name, filter by date greater than X, etc.)
Recently, I needed to build a feature to support adding a tag to a resource. I modeled the relationships (join models, etc.), made the necessary additions to my create/update actions and without _any_ changes to my GraphQL setup, I was able to support filtering my resource by tag (or tags) basically for free.
Can I build that in Ecto directly within my Phoenix context? Of course, but I didn't need to - Ash derived that functionality for me, and built that in, with all of the necessary preloading through dataloader and all of that for me, so the queries are optimized.
Ash is a huge mindset shift, and I think it'd be tough to incorporate it into an existing project, but if you're able to start a new project from scratch, I really recommend you give it an honest try. Especially if you think you might need to have additional data channels (i.e. LiveView and GraphQL or Json API).
I know the Ash team is aware of the documentation challenge, and they are working on it. I feel like the book is an answer to that, and hopefully a lot of the greatness of the book is able to make its way back to the docs.
However, Elixir and Phoenix is more than just LiveView! There’s also an Inertia plugin for Phoenix, and Ecto as an “ORM” is fantastic.
I've actually found a bit of a resurgence in productivity with React on the front-end and Elixir/Absinthe/Ash Framework on the backend. With GraphQL I get fully typed queries, and Ash Framework on the Elixir side helps a ton with removing the boiler plate of code required for GraphQL, since Ash (mostly) generates the schema for me. A bit of a learning curve with Ash, but now that it's clicked, I feel more productive than I did with just Ecto/Contexts/LiveView.
https://www.ash-hq.org - there's a recent PragProg book on it that really helped it click for me.
If you hydrate on the client, you need to run the same exact code on the server and again on the client - however, that means you now might need to bring in a big syntax highlighting library to the client.
With RSC all of that is done server side, so you don't need to ship the syntax highlighting library.
I don’t really have that with a traditional SPA, since the view is “dead”. Of course, interactions might be slow, but I can at least still browse the data already on the screen.
One video or demo in particular that had some functionality I'd love to see in LiveView (or demo on how to do it) is Optimistic UI and Optimistic Add and Drag and Drop (the last three videos in the playlist).
1. https://www.youtube.com/playlist?list=PLXoynULbYuED9b2k5LS44...
Magna-tiles have been a big hit for both from about 2yo and on. Lots of knockoffs on Amazon, but we haven't had any issues with the 2 sets we purchased.
For books I really connected with "Hunt Gather Parent".
Aside from that, I'd say top thing is patience and sometimes just being quiet and not interfering when they're playing.