Blog Articles on DDD, Event Sourcing and software development in general, with a sprinkle of PHP and sarcasm.

Immediate vs eventual consistency

In the [last article](https://barryosull.com/blog/projection-building-blocks-what-you-ll-need-to-build-projections) we looked at projectors, the backbone of any CQRS/Event Driven system. This article was originally meant to be about implementing projectors, but I realised there was an important question to answer first, one that would shape the solution, "When do we project the events, now, or later?". Turns out this question has far reaching effects, so it's important we dig into it before moving onward. # Immediate vs Eventual Consistency When it comes to projectors there are two choices, immediate or eventual consistency. With i...
Read on »

Projection Building Blocks: What you'll need to build projections

Let’s talk about projections. This topic is quite large, so this is the first part in a four part series on projections. 1. **Projection Building Blocks**: What you'll need to build projections 1. **Broadcasting events in PHP**: Techniques and technologies 2. **Designing Projections**: How to design and implement real world projections 3. **Projection DevOps**: Continuously deploying new/updated projections with zero downtime If you've read my previous articles, you should have the basics of [event sourced](event-sourcing-what-it-is-and-why-its-awesome)/[event driven](https://dev.to/barryosull/event-granularity-modelling-even...
Read on »

Developer deprogramming: Getting started in Event Sourcing

There are two things I wish I knew when I started building Event Sourced Apps. 1. Always talk to the domain expert before building or designing anything, no matter how "simple" 2. Always start with events, don't start with a UI, no matter how "simple" it is When we ignore the above and just forge ahead, we invariably end up with CRUD based events. Nine times out of ten these events will not mirror the actual business processes, and instead they will get in the way and make development harder and slower. # The problem with CRUD [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) stands for Create/Read/Update/Dele...
Read on »

Immediate Consistency in Event Sourcing

A continuation on the [Messy Event Flows series](https://dev.to/barryosull/messy-event-flows-part-1) (if you could call it that). You don't need to read it first, but if you're interested, give it a shot, it gives a little more context. In the [last article](https://dev.to/barryosull/messy-event-flows-part-2---what-it-should-be) we talked about our domain wide (cross aggregate) constraints, and mentioned one way to implement them in an [event sourced system](https://dev.to/barryosull/event-sourcing-what-it-is-and-why-its-awesome), but we haven't gone into any real detail since then. So let's look at one of the constraints and fi...
Read on »

Messy Event Flows: Part 2 - What it should be

So, [last time](https://dev.to/barryosull/messy-event-flows-part-1) we looked at our event flow, and I went into detail about the problems we've had with it. The next step was to remodel our event flow, not as it is, but how it should be. As part of this exploration, I also annotated the event flows, being more precise on what's needed by each iteration of the flow to ensure constraints are met. Ie. Do we need to listen to all events, or just a subset, and if it's a subset, can we define it? # The updated model ![Event Flow/Temporal model](https://thepracticaldev.s3.amazonaws.com/i/t7z6n9z0uoggwz24d10j.png "Event Flow/Temporal mo...
Read on »

Messy Event Flows: Part 1

# Intro I've been trying to write lately and I've been finding it difficult. Then I watched a video ["Don't create, document"](https://www.youtube.com/watch?v=RVKofRN1dyI). TL;DR: instead of trying to write a how-to, focussing on a solution, why not document what you're doing, as you work towards a solution? I really like this idea, as it's a problem first, solution second approach, which is how any process of discovery or creation should begin (true of coding and any other endeavour really). So without further ado, let's get into a problem we've been facing. # The current state of our system We have an [event sourced](https://mar...
Read on »

Event Sourcing: What it is and why it's awesome

At the last [PHPDublin meetup](https://www.meetup.com/PHP-Dublin/events/242463770/) I was asked "What do you do?" and as usual the answer boiled down to "I design and build event sourced applications". Which leads to the following question. "What is Event Sourcing?". That's where this article came from, it is my best shot at explaining Event Sourcing and all the benefits it brings. # The Status Quo Before we get into the nitty gritty of event sourcing, let's talk about the status quo of web development. At it's heart, current web dev is database driven. When we design web apps, we immediately translate the specs into concepts fro...
Read on »