# Ash Framework - a declarative, resource-oriented application development framework for Elixir

**URL:** <https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119>\
**Category:** Announcing\
**Tags:** ash, ash-news\
**Created:** [October 17, 2022, 9:35pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119 "2022-10-17T21:35:39Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![zachdaniel](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/32/31980_2.png) [@zachdaniel](https://forum.elixirforum.com/u/zachdaniel)\
**Post date:** [October 17, 2022, 9:35pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/1 "2022-10-17T21:35:39Z")

</div>

![ash-logo-side_50](https://forum.elixirforum.com/uploads/default/original/3X/b/8/b89d34b948b8c7af8493bc83e5a0607db3543cc3.jpeg)

 ![CleanShot 2022-10-17 at 16.30.42@2x](https://forum.elixirforum.com/uploads/default/original/3X/f/5/f5c03cff5dcfa7c9c7d4b05039e1266125f6bd7b.jpeg)

# Ash Framework

## What is Ash?

Ash Framework is a declarative, resource-oriented application development framework for Elixir. A resource can model anything, like a database table, an external API, or even custom code. Ash provides a rich, and extensive set of tools for interacting with and building on top of these resources. By modeling your application as a set of resources, other tools know exactly how to use them, allowing extensions like `AshGraphql` and `AshJsonApi` to provide top tier APIs with minimal configuration. With filtering/sorting/pagination/calculations/aggregations, pub/sub, policy authorization, rich introspection, and _much_ more built-in, and a comprehensive suite of tools to allow you to build your own extensions, the possibilities are endless.

For those familiar with Phoenix, you can think of Ash as a declarative application modeling layer designed to replace your Phoenix contexts.

## Ash Framework 2.0

Ash Framework 2.0 has been released! This begins the official stable release cycle (although it was already quite stable). Thanks to everyone in the community who helped make this possible, from the contributors, the curious, to those already using Ash in prod. I’m eternally grateful for all of your support.

Additionally, I’d like to thank Alembic, who have brought me on to work on Ash full time. Alembic is building complex software with small teams in record time by leveraging tools like Ash Framework and Phoenix LiveView.

Along with the 2.0 release of core, the `AshPostgres`, `AshPhoenix` and `AshArchival` packages have had 1.0 version released as well. `AshGraphql` is next up, and should be released in the next few weeks. Feel free to dive in to it before then, though :).

## Is Ash an alternative to X?

Ash is not meant to be an alternative to Phoenix, Ecto, or Absinthe. Ash uses Ecto under the hood, `AshGraphql` uses Absinthe. Phoenix is absolutely the recommended way to build web interfaces on top of your Ash application (there is a whole package dedicated to it, `AshPhoenix`). Ash is not meant to be the only way that you ever interact with your data, so it is almost a certainty that you will need to use `Ecto` in some cases. For instance, Ash does not currently support bulk actions or atomic updates. For this reason, you can implement custom actions for things that can be encapsulated in your resource, and you have all of Elixir at your disposal to implement custom behavior outside of your resources, with a wide array of escape hatches in between.

## Extensions

### Extensions in 1.0+

- `AshPostgres` - Back a resource with postgres. Rich querying capabilities, supporting aggregates, calculations, and fragments. Comes with a migration generator to get you up and running in record time!
- `AshPhoenix` - Helpers to integrate Ash Resources with Phoenix. Tools like `AshPhoenix.Form` allow you to build forms over your resources, and manage complex nested related data with one data structure.
- `AshArchival` - A tiny but powerful extension. Get archival (A.K.A soft deletion) with one line of code.

### Extensions \<1.0

- `AshGraphql` - Create a GraphQL from your resources with only a few lines of code. Backed by the excellent Absinthe library. It comes with its own fully implemented dataloader, and automatically derives all the types, fields, and mutations automatically. Getting a relay compatible GraphQL API is as easy as setting the `relay?` toggle.

- `AshJsonApi` - Create a JSON:API spec compliant API in minutes.
- `AshAdmin` - A rich admin UI automatically derived from your resource definitions.
- `AshCsv` - Back your resource with a CSV file.
- `Spark` - The core declarative DSL library that backs Ash and its extensions.

### Unreleased Extensions

- `AshPaperTrail` - Creates and manages a versions table for a resource, and writes all changes to that version resource. With one line of code.
- `AshJsonApiWrapper` - Back your resource with an external API using finch and configuration to describe how your resource maps to the response from the external service.

### Your Own Extensions

All of the extensions above are created with a set of tools that are free to use to create your own extensions. They can all be used as a basis point, or as inspiration. Many users have created their own extensions for various reasons. An extension can both add to the resource’s DSL and programatically restructure the resource. For example, `AshArchival` adds an attribute, modifies every destroy action, and adds a “base filter” to the resource. This allows for extremely powerful extensions.

## Links

- New and improved docs: [https://ash-hq.org](https://ash-hq.org)!
- Office hours/Q&A release livestream: [https://www.youtube.com/watch?v=BchANMO1f8s](https://www.youtube.com/watch?v=BchANMO1f8s)
- Official discord Server: [Ash Framework](https://discord.gg/D7FNG2q)
- Sponsors Dashboard: [zachdaniel (Zach Daniel) · GitHub](https://github.com/sponsors/zachdaniel/)
- Ash Framework Twitter: [Ash Framework | ashframework.bsky.social (@AshFramework) / X](https://twitter.com/AshFramework)
- Source: [Ash Framework · GitHub](https://github.com/ash-project)
- Roadmap: [Ash Framework Roadmap · GitHub](https://github.com/orgs/ash-project/projects/3)
- Alembic: [https://alembic.com.au/](https://alembic.com.au/)

Expect to see a lot more content before long, like tutorial and short, topical videos.

## Elixir Forum

Up until now, I haven’t posted much here, and have primarily engaged with the community via twitter and discord. However, if there are users here on the forums who are interested, I’m more than happy to answer questions here. For now, I’ll be subscribed to the #ash tag, so if you use that, I’ll be notified.

## Where to start?

Ash is quite broad, and covers a considerable amount of ground. My suggestion is to follow the tutorials for a kicking off point. There are getting started guides for each individual package as well that, combined, will get you up and running from scratch.

😎 Happy hacking! 😎

---

<div class="post-metadata">

**Author:** ![jimsynz](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jimsynz/32/39319_2.png) [@jimsynz](https://forum.elixirforum.com/u/jimsynz)\
**Post date:** [October 17, 2022, 10:05pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/2 "2022-10-17T22:05:11Z")

</div>

Congratulations @zachdaniel. Lots of hard work paying off.

---

<div class="post-metadata">

**Author:** ![dimitarvp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/32/38664_2.png) [@dimitarvp](https://forum.elixirforum.com/u/dimitarvp)\
**Post date:** [October 17, 2022, 10:16pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/3 "2022-10-17T22:16:34Z")

</div>

I have meant to check on Ash many times but this post finally made me take it seriously.

Really good description, and I am intrigued. Definitely will play with it in the next few months.

Thanks for the intro and announcement. It’s well done.

---

<div class="post-metadata">

**Author:** ![juhalehtonen](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/juhalehtonen/32/21791_2.png) [@juhalehtonen](https://forum.elixirforum.com/u/juhalehtonen)\
**Post date:** [October 18, 2022, 6:22am UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/4 "2022-10-18T06:22:58Z")

</div>

Huge congratulations on the release! 👏

I’ve been using Ash on my hobby project(s) for a while now, and now that a stable release is out, I’m definitely going to look into seeing how Ash could be applied in work context as well!

What I also really like about Ash is how powerful (yet straightforward to grasp) the concept of Resources is, and all the power that comes from deriving things out of those resources thanks to the consistent interface between them. The first time I set up `ash_json_api` for my project, I was just blown away by how much I got out of it – and how little boilerplate I had to write.

In general, the more I’ve used Ash, the more I’ve gotten out of it. Everything fits together really nicely, and I’m yet to encounter a situation where I would need to fight the “Ash way” of doing things. At the same time, it’s also nice to know that I can do what I want if I choose to, and I can adopt Ash gradually instead of in an all-or-nothing way.

---

<div class="post-metadata">

**Author:** ![braindeaf](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/braindeaf/32/13906_2.png) [@braindeaf](https://forum.elixirforum.com/u/braindeaf)\
**Post date:** [October 18, 2022, 8:51am UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/5 "2022-10-18T08:51:00Z")

</div>

Looking forward to trying this. As a newcomer to Elixir /Phoenix I’m struggling to reconcile great performance with really untidy Contexts with a while host of functions strewn everywhere.

---

<div class="post-metadata">

**Author:** ![anil28](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/b2d939/32.png) [@anil28](https://forum.elixirforum.com/u/anil28)\
**Post date:** [October 18, 2022, 11:26am UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/6 "2022-10-18T11:26:49Z")

</div>

Expecting a real world example tutorial from someone soon. (video or article or ebook).

---

<div class="post-metadata">

**Author:** ![zachdaniel](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/32/31980_2.png) [@zachdaniel](https://forum.elixirforum.com/u/zachdaniel)\
**Post date:** [October 18, 2022, 7:04pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/7 "2022-10-18T19:04:54Z")

</div>

Absolutely @anil28! There are a couple things on the roadmap that I’d like to tackle before I do, but soon I’ll be making a “make a twitter clone” style video along the lines of what @chrismccord did for Phoenix.

---

<div class="post-metadata">

**Author:** ![bread](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bread/32/28166_2.png) [@bread](https://forum.elixirforum.com/u/bread)\
**Post date:** [October 19, 2022, 3:48pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/8 "2022-10-19T15:48:58Z")

</div>

Congrats on the release! I’m constantly blown away with the quality of work and support the Ash community has put into this project. It’s gotten to the point that I can’t imagine starting a new Elixir project that doesn’t use Ash, being able to prototype an idea with ETS and switch it over to Postgres with just a few lines of code is really a game changer for me.

---

<div class="post-metadata">

**Author:** ![Benjamin-Philip](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benjamin-philip/32/34651_2.png) [@Benjamin-Philip](https://forum.elixirforum.com/u/Benjamin-Philip)\
**Post date:** [October 19, 2022, 6:05pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/9 "2022-10-19T18:05:18Z")

</div>

It would be very interesting to have an extension to generate an OpenAPI spec, as well as one for API Blueprint. Has there been any talk of writing one?

OpenAPI generation is a nice “gimmick” python’s fastapi has. While it hasn’t been very useful to me in hobby projects, it might help with larger and more complex projects. Also it’s nice “eye candy” that should attract interest nevertheless.

---

<div class="post-metadata">

**Author:** ![zachdaniel](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/32/31980_2.png) [@zachdaniel](https://forum.elixirforum.com/u/zachdaniel)\
**Post date:** [October 19, 2022, 6:16pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/10 "2022-10-19T18:16:37Z")

</div>

Totally agree 🙂 `AshGraphql` already tackles that via exposing a GraphQL schema. However, `AshJsonApi` currently exposes a JSON “hyper schema”, which could be quite easily translated to an open api spec 🙂 Just takes an enterprising soul!

---

<div class="post-metadata">

**Author:** ![AndyL](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/andyl/32/3659_2.png) [@AndyL](https://forum.elixirforum.com/u/AndyL)\
**Post date:** [November 1, 2022, 7:12pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/11 "2022-11-01T19:12:30Z")

</div>

I listened to the [podcast](https://forum.elixirforum.com/t/podcast-thinkingelixir-123-ash-framework-models-resources/51480) this morning then followed the [Getting Started](https://ash-hq.org/docs/guides/ash/2.4.1/tutorials/get-started.md) tutorial.

Wow! Kudos @zachdaniel !!

My first impression: potentially a big improvement over Phoenix Contexts. For me the Ash conceptual model is very good - `resources`, `data layers`, `actions`, etc. I’ll start testing on a small app this week.

Before I jump in with both feet, I’m interested to understand the potential downsides. I wonder about the learning curve - Ash seems huge. I wonder about performance & maintainability. I wonder if there are ways to inject custom code when the limits of the framework are reached. I wonder about unseen barriers and glitches.

Experienced users: what are the potential gotchas, and what is the best fit for Ash??

---

<div class="post-metadata">

**Author:** ![zachdaniel](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/32/31980_2.png) [@zachdaniel](https://forum.elixirforum.com/u/zachdaniel)\
**Post date:** [November 1, 2022, 7:31pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/12 "2022-11-01T19:31:39Z")

</div>

I’ll try to leave most of the talking to other Ash users who see your message 🙂 With that said, there are tons of escape hatches at various levels, from adding functional hooks to changes, to making actions `manual` and taking over their execution. One thing we’re actively working on(because it can be problematic) is making errors more understandable. More often than I would like, errors are lacking important context that would make debugging much easier. I don’t think this is a problem with the pattern, just something that requires some elbow grease on our end 🙂 See: [improvement: add error context to error creation / normalisation by rellen · Pull Request #440 · ash-project/ash · GitHub](https://github.com/ash-project/ash/pull/440)

In terms of performance, Ash generally leans into other tools to provide performance/stability guarantees, i.e AshPostgres ultimately runs your queries with Ecto. AshJsonApi is built with Plug, and AshGraphql uses Absinthe and Dataloader. I’d be lying if I said there was no additional overhead on top of those tools when using Ash, but similar to the error situation above, that isn’t _intrinsic_ to what we’re doing, just optimizations waiting to be made 🙂

Check out AshHq if you haven’t already, its all implemented with Ash, from an extension that runs full text search with postgres, to the newly added (yesterday) `AshBlog` data layer that stores files in the priv directory. Lots of goodies in that codebase.

Site: [https://ash-hq.org](https://ash-hq.org)

Source: [GitHub - ash-project/ash\_hq: The Ash Framework homepage and documentation site. · GitHub](https://github.com/ash-project/ash_hq)

---

<div class="post-metadata">

**Author:** ![AstonJ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/astonj/32/15_2.png) [@AstonJ](https://forum.elixirforum.com/u/AstonJ)\
**Post date:** [November 2, 2022, 6:07pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/13 "2022-11-02T18:07:01Z")

</div>

Nice to see the Elixir landscape expanding with frameworks like Ash - and it’s great to see it can be used alongside Phoenix 😃

> [@zachdaniel](#):
>
> Office hours/Q&A release livestream: [Ash Framework 2.0 Office Hours - YouTube](https://www.youtube.com/watch?v=BchANMO1f8s)

Great that you’re not averse to YouTubing, I was going to suggest making a tutorial video, glad you’re on it:

> [@zachdaniel](#):
>
> soon I’ll be making a “make a twitter clone” style video

I find videos are really good for introducing people to tech like frameworks :023:

Also great to see Alembic taking you on to work on Ash! For those who are not aware Alembic have been using Elixir for quite some time and they are very active in the Elixir space in Australia - they help organise Elixir Camp and Elixir Girls :003:

_Good luck with Ash, Zach - please keep us posted!_

---

<div class="post-metadata">

**Author:** ![sergio](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sergio/32/26966_2.png) [@sergio](https://forum.elixirforum.com/u/sergio)\
**Post date:** [November 2, 2022, 6:21pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/14 "2022-11-02T18:21:23Z")

</div>

What a terrific achievement man, this looks incredibly well made! Terrific work!

---

<div class="post-metadata">

**Author:** ![quda](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/quda/32/33107_2.png) [@quda](https://forum.elixirforum.com/u/quda)\
**Post date:** [November 2, 2022, 7:14pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/15 "2022-11-02T19:14:25Z")

</div>

> [@zachdaniel](#):
>
> Phoenix is absolutely the recommended way to build web interfaces on top of your Ash application

Therefore, not clear to me why should I choose Ash over Phoenix 🤔  
Otherwise, congrats for the achievement! The website looks promising.

---

<div class="post-metadata">

**Author:** ![gdub01](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/gdub01/32/3939_2.png) [@gdub01](https://forum.elixirforum.com/u/gdub01)\
**Post date:** [November 2, 2022, 7:40pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/16 "2022-11-02T19:40:03Z")

</div>

I’ve just spent most of the morning looking at Ash.

It looks amazing.. and I’m pretty interested in that auth resource you were mentioning on YouTube now =)

`Therefore, not clear to me why should I choose Ash over Phoenix`

It’s not Ash _or_ Phoenix, but rather Ash handles defining things like permissions/filters/datalayers around resources. There’s no concept of web-related things particularly, although there are exertions you can use to plug into things like Phoenix.

Phoenix does all the things Phoenix will still do.. but then Ash comes along to give all these cool ways of defining flows, policies, attributes, etc. that you can call from anywhere - like a Phoenix controller or a Phoenix Liveview.

So it seems the ash framework provides a consistent way to define resources, change them, and read them at a separate layer from web.

It may replace/augment/overlap the idea of ‘contexts’ in Phoenix… but that would be it I think.

I’ve wanted an opinionated way of doing those filters/policies/etc. for a while so I don’t make spaghetti inadvertently =)

Looks awesome.

---

<div class="post-metadata">

**Author:** ![Nefcairon](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nefcairon/32/31921_2.png) [@Nefcairon](https://forum.elixirforum.com/u/Nefcairon)\
**Post date:** [January 29, 2023, 12:16pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/18 "2023-01-29T12:16:38Z")

</div>

I am currently watching [https://www.youtube.com/watch?v=pwxShYmJgkk](https://www.youtube.com/watch?v=pwxShYmJgkk) und Ash reminds me of Hobo for Ruby/Rails - does anyone remember that? I think Ash could be the next game changer for Phoenix after LiveView and Surface.

Are there any tutorials available where you create a extremely minimal web application? I think I learn best when following somebody incremently implementing feature after feature. Edit: Found [Get Started — ash v3.29.3](https://ash-hq.org/docs/guides/ash/latest/tutorials/get-started)

---

<div class="post-metadata">

**Author:** ![darraghenright](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/darraghenright/32/6418_2.png) [@darraghenright](https://forum.elixirforum.com/u/darraghenright)\
**Post date:** [February 25, 2024, 1:32pm UTC](https://forum.elixirforum.com/t/ash-framework-a-declarative-resource-oriented-application-development-framework-for-elixir/51119/19 "2024-02-25T13:32:53Z")

</div>

The Ash interactive Livebook tutorial a fantastic example of what a great, hands-on tutorial experience can aspire to. I am very impressed on several levels!
