Everything you need to know about Ash Framework

Ash Framework is the game-changing toolkit for Elixir developers. With modular, plug-and-play building blocks, Ash cuts down on development time and effort. Letting you do more with less code.

In this guide we'll explore what is Ash Framework, how it works and when to use it.

What is Ash Framework?

Ash Framework is a declarative, resource-oriented backend framework for building web applications in the Elixir programming language. It simplifies web app development by focusing on resources, which act as the core building blocks for database schemas, APIs, background jobs, and more.

Ash is designed to work seamlessly with popular tools like Phoenix, Postgres, and GraphQL. This makes it a versatile choice for modern application development.

Ash fills the gap left by the typical MVC framework - a place to define your application logic, independently of the UI, API or database concerns. Equipped with a declarative model of your application, Ash's extensions perform the mechanical work of generating infrastructure components, like database migrations or JSON APIs. This approach allows developers to build scalable systems with minimal boilerplate.

What problem does Ash solve?

Ash Framework was created to solve a fundamental problem in application development. When you build a new app, you want to focus on the valuable, business differentiating parts. However, modern web applications require an enormous amount of commoditized functionality that are essential, but not where you want to invest your time.

Ash's primary goal is to keep you focused on the high-value functionality, while minimizing time spent on standard boilerplate features. The framework accomplishes this by modeling your domain and deriving everything else.

This means that developers define the essential parts of their business system (like users, products, or orders) in a structured way. Once these core elements are declared, Ash uses resources to automatically generate all the supporting technical components needed, such as login systems, audit logging, and APIs.

This allows your team to invest more time on innovative features that differentiate your product, rather than spending time on technical necessities that don't provide a competitive advantage.

Core concepts

Resources

At the heart of Ash Framework are "Resources." A resource represents a single entity in your application—such as a database table, an API endpoint, or a background job. Resources are defined declaratively, specifying attributes, relationships, actions, and policies.

 defmodule MyApp.Post do
   use Ash.Resource,
     data_layer: AshPostgres.DataLayer

attributes do
     attribute :title, :string
     attribute :body, :string
   end

relationships do
     belongs_to :author, MyApp.Author
   end
 end

Declarative Programming

Ash embraces declarative programming principles. Instead of writing imperative code to define behavior (e.g., writing SQL queries), you describe what your application should do in terms of rules and configurations. This approach reduces complexity and makes your code easier to understand and maintain.

Why use Ash Framework?

Ash Framework offers several advantages:

  • Declarative Resource Modelling: Ash enables developers to define application structures declaratively, reducing boilerplate and automating backend tasks like schema generation, API creation, and authorisation.
  • Extensibility and Integration: Ash supports seamless integration with Elixir tools like Phoenix, Postgres, and GraphQL while offering extensibility through custom extensions for unique business needs.
  • Automation of Routine Tasks: The framework automates repetitive backend operations, allowing developers to focus on business logic and innovation rather than technical complexities.
  • Scalability and Maintainability: Ash’s declarative approach ensures consistent abstractions across your application. This reduces technical debt and makes scaling easier as your system grows.
  • Unified Abstraction Layer: By unifying data sources (e.g., databases, APIs, caches) under a single abstraction, Ash simplifies resource management and enhances maintainability.

Standout features

  • Generated APIs: Ash can generate GraphQL and JSON APIs directly from your code. Generated GraphQL schemas and OpenAPI specifications ensure your frontend teams and external integrators have everything they need to start using your APIs.
  • LLM Integration Built-in: The Ash AI extension provides a complete LLM toolbox that makes integrating AI capabilities straightforward and secure. Create prompt-backed actions with structured outputs, define tools for agentic workflows, vectorize your data for similarity search, and generate chat interfaces with a single command.
  • Best in class security: AshAuthentication provides a turn-key solution for login with multiple strategies from simple passwords to magic links and SSO. Ash's authorization and system is baked in to the core of the framework, ensuring that every action is authorized before executing. Multi-tenancy is also a first-class feature of Ash.
  • Realtime Systems: Ash has built-in functionality to notify your users when important changes happen. Watch dashboards update in realtime as the data changes.
  • Migrations made easy: Ash keeps track of the shape of your data and automatically generates the migrations needed to update your database on each deploy.
  • High Performance by default: Ash GraphQL APIs intelligently bulk load data, selecting only the information necessary, ensuring the most efficient use of your database, without any hand-tuning.

Ash Framework vs. alternatives

Ash and Phoenix: Complementary frameworks

Ash and Phoenix serve complementary roles rather than competing. Phoenix handles the web layer (HTTP, routing, templates), while Ash focuses on the application layer (business logic, data access). This separation allows each to excel in its domain:

  • Phoenix provides best-in-class real-time capabilities with channels and LiveView
  • Ash offers declarative resource definitions and robust domain modelling
  • Together, they create a comprehensive full-stack solution

Comparing across programming languages

The Elixir stack with Ash shines particularly for real-time applications, highly concurrent systems, and complex domain modelling. Its functional approach and BEAM VM advantages make it ideal for applications where reliability and scalability are paramount.

Adoption is growing

The number of applications built using Ash is growing all the time, as can be seen by the increasing number GitHub stars or the thriving community the Ash Discord channel.

Real-world applications

At Alembic, we've been building Ash apps - both big and small - for several years now. Here are some examples of what Ash can achieve.

Getting started

Setting up your first Ash project is straightforward: create a new Phoenix application, install Ash and AshPostgres using the Igniter toolkit, and start defining your resources with attributes, relationships and actions. While Ash handles the how, you can focus on the what. Check out our detailed guide on getting started with Ash Framework for a complete walkthrough with code examples.

Hiring, onboarding, and team productivity with Ash

Onboarding

Ash's declarative nature and consistent design patterns significantly lower the barrier for new developers joining a team. By eliminating much of the boilerplate that typically comes with building APIs and business logic, Ash provides a clear and structured entry point into the codebase.

Smaller teams

Reduce reliance on specialist roles — more is handled by Ash. One of Ash’s strongest advantages is its ability to enable small teams to achieve more with less.

Consistency and maintainability

Ash enforces a structured, resource-based design that naturally leads to consistent implementations across modules. This consistency means team members spend less time understanding each other's code and more time solving product problems.

Documentation and introspection

Because Ash relies heavily on DSLs, much of the system becomes self-documenting. Developers can understand an entire resource — including its actions, validations, relationships, and access policies — by reading a single file.

Team productivity gain

Ash allows engineering teams to spend less time on infrastructure and more time on business logic. It promotes declarative thinking, faster prototyping, and streamlined code reviews.

Adoption and migration strategy

Greenfield projects: Ideal for quick MVPs.

Ash is particularly well-suited for greenfield applications where speed, consistency, and maintainability are high priorities.

Scaling up: Built to support growth

Ash’s architecture is built for scalability, allowing applications to handle increased user demand or new business requirements without significant retooling.

Brownfield: Start by migrating one module or domain.

For existing Phoenix applications or legacy Elixir services, Ash can be adopted incrementally.

Co-existence: Run Ash and traditional Phoenix side by side.

Ash and traditional Phoenix/Ecto code can operate side by side within the same codebase. This hybrid approach makes it easier to experiment or pilot Ash without disrupting established systems.

Evaluate ROI through a pilot project

A successful migration starts with a small, high-impact pilot. Choose a domain where Ash’s declarative model and rapid scaffolding can demonstrate quick wins.

Technical considerations:

  • Ensure your team is comfortable with functional programming and Elixir idioms.
  • Set up clear module boundaries and dependency management to separate Ash components.
  • Validate integration with existing CI/CD, monitoring, and authentication/authorization tools.
  • Document early wins and lessons learned to support team alignment and stakeholder buy-in.

Adopting Ash doesn’t have to be an all-or-nothing move. A phased strategy focused on modularity, measurable outcomes, and team readiness can lead to successful long-term integration.

Performance, observability & DevOps

Performance

Ash leverages Elixir's lightweight concurrency model, powered by the BEAM virtual machine, to deliver exceptional performance out of the box.

Observability

Ash supports modern observability standards through integration with Elixir’s :telemetry tooling, enabling the emission of detailed performance and operational metrics.

Deployment

Ash fits seamlessly into standard Elixir deployment workflows.

CI/CD integration

Teams already using CI/CD pipelines with Elixir or Phoenix will find that Ash introduces no additional complexity.

FAQs & common misconceptions about Ash

Ash Framework resources and documentation

Ash has extensive guides and documentation available, including:

Ash Premium Support

If you need more active guidance Alembic’s Ash Premium Support service provides a direct line to our team of Ash Experts for fast, high-quality support that improves your knowledge and speeds up delivery.

Conclusion

Ash Framework is a transformative tool for teams looking to modernize their tech stack. Its declarative nature simplifies backend logic while complementing the Phoenix framework for web interfaces. Whether building POCs/MVPs or migrating legacy systems, Ash helps achieve scalability, maintainability, and faster development cycles.

Adopting Ash could be the key to unlocking your team’s potential—start exploring today!