Blokh
Greetings,
I’ve been looking around for a good Event-Sourcing sample project in Elixir but all I could find is the great job of Ben Smin (@slashdotdash).
Which is really great but I do not believe in CQRS complexity for a simple project.
Does anyone have any suggestions where I could study more about Event sourcing in elixir without slicing apart my read and write interfaces?
Thanks in advance,
Blokh
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
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
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
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
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
LostKobrakai
It’s not really ready yet (a few upcoming changes in the pipeline), but GitHub - CargoSense/fable: Your events have a story to tell. · GitHub is a great intermediate between not doing es and going all in with commanded.
Blokh
Thank you @LostKobrakai!
But I am searching for an ES project.
Just not a CQRS ES project - which divides the read from write interfaces.
kokolegorille
You might like
I am not sure it is a requirement to have multiple database, isn’t it just a separation of concern between read and write?!
Blokh
Thank you very much! @kokolegorille
I will watch it ASAP, it may provide me some clearance of what I am searching for.
Anyhow.
From my understanding -
Event sourcing is for each action happening in the system - It generates an event regarding this action.
the action is being stored and later on, you can do whatever you want with it. call the aggregator, or later on.
like Registry in elixir only here the data is saved to the event_store.
CQRS took it to another level which is optional. you have one logic for reading the information. and one logic to dispatching the data into the event_store/Database.
I want to keep my read and write logic under the same interface, including the validations, queries and so on.
If I am wrong, could anyone please clarify it for me?
bottlenecked
Hi there, the problem that cqrs tries to solve is that because of the way data is written in the event store it’s very difficult and/or inefficient to do aggregate queries against that data.
For example lets say your domain is banking accounts, and each event represents a transaction in some customer’s account. Without a separate read model optimized for queries it would be really difficult to get stats like “give the top ten accounts that have made a deposit over x amount last month”
So unless you never read that data outside your main application (eg no admin screens presenting aggregate info over your data), you’re probably going to need a separate read model- and that means buying fully into es+cqrs
peerreynders
Event Sourcing
Blokh
@bottlenecked @peerreynders hank you very much for taking the time to respond.
@bottlenecked I agree when you see events as “actions”, then you generate the “new state of a different projection” by those actions.
I see events as changes in state of a model.
e.g. for bank - the transactions generate a new event in the balance_store - that includes all your balances from the open_account event.
the balance is transactions history. and the last state of the store is the current state.
anyhow I would like to save states instead of actions.
@peerreynders Thank you, I will check the sources out.
Thank you for reaching to me.
bottlenecked
I see… so you’re thinking of capturing all current state in what is effectively a data dump. I think I can see a few problems with this approach:
I hope the above help you
benwilson512
To be clear, Fable is ES, not CQRS, which is what I think @LostKobrakai meant to say. You could probably build a CQRS system on top of Fable, but that isn’t how we use it. Here’s a post where I talk about it in more detail: Opinion on file & memory based event sourcing system - #4 by benwilson512
slashdotdash
You can use Commanded for event sourcing without requiring CQRS. Commanded focuses on the write model, but provides the Ecto projections library as one way of projecting events into a SQL database. There’s an undocumented function to access aggregate state (
Commanded.Aggregates.Aggregate.aggregate_state/3) which would allow you to use Commanded with a single model for writing and to later query the state of the aggregate.The reason why this isn’t the preferred approach (IMO) is because although the query model initially closely resembles the write model, soon they will start to differ in structure or access pattern (e.g. reporting, aggregating data and multi-entity views). Hence why I opt to go with separating reads from writes from the outset (CQRS) when using event sourcing.