Casavo
Published in

Casavo

Supercharging our event-sourcing capabilities with Phoenix LiveView

Building visual tools to tame event sourcing architecture complexity

A few of the system components involved in the lead creation on WORMS

Modeling and implementing core subdomains

Commanded for CQRS/ES

  • Aggregates receive commands and emit domain events that are stored in the application event store;
  • Workflows listen to emitted domain events to send commands to aggregates or communicate with external systems;
  • Projectors listen to emitted domain events to update the application read models;
  • Process managers coordinate complex business flows
Main entities in commanded libraries — describes the flow of a command through a router to its aggregate, which emits events, which are listened to from process managers and projectors and stored in an event store; process managers generate more commands, while projectors update the read models.
Main entities in Commanded, from this article series

How can we manage the complexity of the system?

  • Event handlers status page
  • Aggregate history debugger
  • App schema visualizer

Event handlers status page

A screenshot of the event handlers status page
A screenshot of the event handlers status page

Aggregate history debugger

A recording of the aggregate history debugger in action, shows a search for a given aggregate id and browse through the timeline of events
The aggregate history page in action
latest_updated_leads = Repo.all(
from l in Lead,
limit: 10,
order_by: [desc: :updated_at]
)
stream_uuid = "#{aggregate_type}#{aggregate_id}"
{:ok, events} = EventStore.read_stream_forward(stream_uuid)

App schema visualizer

The app schema visualizer in action, shows the graph for the PropertyInformationConfirmed domain event
The app schema visualizer in action

Conclusion

--

--

We believe in the crucial role of technology to make life easier. We love to leverage technology to create solutions for all the people that need to sell, live, or buy a residential property.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store