pcharbon

pcharbon

This is a new extension for the Ash framework that lets you use the Commanded library in a more declarative manner and removes most of the repetive ceremony while using the Commanded libraru. By combining the power of the Spark DSL library and the Domain/Resources concepts of Ash, this extension will generate for you at runtime all you need to implement a CQRS/ES system. Your commanded Aggregates, Events. Commands, etc will still all be there.

AshCommanded is an Elixir library that provides Command Query Responsibility Segregation (CQRS) and Event-Sourcing (ES) patterns for the Ash Framework. It extends Ash resources with a Commanded DSL that enables defining commands, events, and projections. The extension relies on the excellent Commanded library. The Commanded Guides section explains the different concepts better than I could.

Feedback always very welcomed!

https://github.com/accountex-org/ash_commanded

Showing Posts 1 to 10

johnsseruwagi

johnsseruwagi

Thank you so much for this great library, am currently learning CQRS/ES following the book real world event sourcing in elixir, am primarily a Ash framework developer, so I was looking for an extension for proper ES in Ash and then found this,

However on your Where are the process mangers? Section, you said that you recommend using Reactor for this kind of ochestration and I honestly agree with you.

However the commanded Process Manager behavior gives us some out of the box implementations such as the starting, continuation and stoping coordination and I think it works mechanically well with the router.

My point is, to someone who has not implemented the saga pattern on their own, it would be difficult to replace the commanded Process Manager with reactor.

Can you please provide an extensive example of how to do that with Ash Commanded.

And also if you can provide a fully CQRS/ES application built with ash_commanded this would do so great

suranyami

suranyami

Just been trying to use this in the last few days, an found that the library doesn’t compile. Not sure if something has changed in one of the other frameworks involved (perhaps spark?) but it’s currently unusable.

I’ve written up an issue on the Github repo for it here: AshCommanded.Commanded.ParameterTransformer.__struct__/0 is undefined or private exception thrown during compilation · Issue #3 · accountex-org/ash_commanded · GitHub

pcharbon

pcharbon OP

Sorry about the not compiling. It hss been fixed by someone already in a PR and I forgot to update the version. I will do that tomorrow as soon as possible.

Regarding providing an example, I will be happy to write one and add it to the repo as well. I am also easily reacheable online at any time on Discord under the same username. Feel free to contact me for any questions or discussions on your project. I will be happy to help.

Pascal

pcharbon

pcharbon OP

The fixes have now been published on version 0.2. Thank you for your patience.

pcharbon

pcharbon OP

I will try to write some example application this week but you can still use the Process Manager with the Ash Commanded extension. It will not overwrite any Process Managers you have or other files. Sorry for the late reply. This commend somehow got past me. I really need to work toward that zero emails zen state :blush:

johnsseruwagi

johnsseruwagi

Thank you so much, I will be eagerly waiting for the example, I have been diving deeper into reactor and it makes a lot of sense for ochestration, no worries atleast you have responded and it means a lot to me

johnsseruwagi

johnsseruwagi

Hello, any updates on this, please

pcharbon

pcharbon OP

I am sorry I did not have time to write a complete example yet as I have been busy lately. I have not forgotten you and it is on my to-do list. I appreciate your patience. Feel free to contact me directly on discord for any questions in the meantime.

suranyami

suranyami

Tried getting a bit further with ash_commanded, and encountering an error when trying to generate the Aggregate:

     error: undefined function snapshot_state_if_needed/1 (expected Core.Organizations.OrganizationAggregate to define such a function or for it to be imported, but none are available)
     │
 134 │           BaseTransformer.create_module(aggregate_module, ast, __ENV__)
     │           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     │
     └─ deps/ash_commanded/lib/commanded/transformers/generate_aggregate_module.ex:134: Core.Organizations.OrganizationAggregate.apply/2

I’ve documented the issue on Github here: undefined function `snapshot_state_if_needed/1` when generating Aggregate · Issue #6 · accountex-org/ash_commanded · GitHub

It would be really great if anyone has a working MVP that works, so that others can follow along.

I’m happy to write up a detailed walk-through and add it to the docs if someone wants to point me to such an example.

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
fuelen
Hi all! I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas. You...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
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
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
akoutmos
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews