Ash and our journey to it!
Author: Manh Vu
Published: 2025-07-25

Intro

We’re a startup with all our system with Elixir (except mobile app).

Our journey

We start build our MVP with Elixir from craft with our knowledge. We have a good background about Erlang but still have a lot of things for us. We will talk about some rounds we faced with.

First round, we start with almost built-in library of Elixir & Erlang (we came from Erlang world). Still fast for us when compare time to develop with other tech stack like Node or Go (Go cannot match with Elixir for build a realtime & reactor system except performance!). In this time, we use Ets for memcache (we have built a cache library based on Ets) and Mnesia for storage (or things that need transaction). Yep, it’s nature with dynamic type and we free of mind to work with that. It is fast lane for us, PoC is done so quick! In this time, we put all apps in an umbrella project.

Second round, we decouple our system for better development phase & can get ready for scale in the future. Yes, dynamic type + cluster (built-in) help us a lot! No other things like Elixir and it ecosystem, we can decouple our system in a week! (benefit from distributed system) Now we have dynamic cluster on K8s, nice job!

Third round, we start using Ecto + Postgres for better performance & other benefits like code generation, form, validate,… We still happy with Phoenix/Ecto but we see a problem that is we need to write boilerplate code for query and our Apis. We don’t use regular Api like Rest Api because it not match with our realtime system and overload for header, security check,…

Fourth round, we want to try a new thing to reduce time to develop and think about Domain Driven Design system. We changed our system several times and see a problem, we need to reduce change business logic and presentation layer. We have a look with Ash framework and try it. It’s so amazing thing for us. Ash framework uses declarative for code generation. From my view, that way help us to reduce time for write & test our code. Ash is extensible that is important thing for us. Ash and LiveView are nice things we found when work with Elixir ecosystem!

Benefits of us when work with Ash

Ash framework has a lot of other benefits but in here we only talk things we used and got benefits.

The first, we can easy to move from this persist storage system to other. In Ecto we can do that but only with SQL type, in Ash we can build our storage to any type of storage system. Currently, we using Postgres but in the near future we need to move to other things like Cassandra, ClickHouse,… when work with Ash we don’t need to rework too much!

The second, we don’t use regular api like Rest api then we need to add a layer for converting from this type of data to other type, with Ash we can easy to create and extension for our api and reduce boilerplate code and have us easy to trace any issue if our system have.

The third, with Ash, we keep our system around DDD style for expert domain can understand & talk with dev.

Downside of Ash

Yes, Ash have a downside for us!

Need to learn (new style for us but not much because we have worked with Ecto before).

Error that raised by Ash also is a thing that made us to think because it is raised by macro then we need time to understand this (actually, Ash has Spark library and it raise error quite good).

Run slow than normal when we work directly with Ecto.

We will come back and talk more about Ash. Thank you for reading!