Skip to content

Instantly share code, notes, and snippets.

@Jean85
Last active January 15, 2018 12:03
Show Gist options
  • Save Jean85/60404a658d67caa4d4ed5ed8a1102a50 to your computer and use it in GitHub Desktop.
Save Jean85/60404a658d67caa4d4ed5ed8a1102a50 to your computer and use it in GitHub Desktop.
Abstract: Adding Event Sourcing to an existing PHP project (for the right reasons)

Adding Event Sourcing to an existing PHP project (for the right reasons)

"Event Sourcing", along with "CQRS" (Command Query Responsibility Segregation), have recently become trending terms, and now there is so much theory, blog posts and talks about them.

However, most of these deal with the problem starting from an utopian assumption: having to write a project from scratch (greenfield), but at the same time with a high domain complexity right from the start, enough to justify the use of a complex technique like event sourcing and CQRS, which carry a fair amount of inherent complexity. But the reality greatly differs: projects are born from small and simple prototypes, and they accumulate complexity only with time and the growth and evolution of specifications and features.

This talk is a case history in which I will tell you (with little theory and a lot of practical examples) how we decided to add event sourcing to an already existing project (without eradicating the rest or rewriting it), to solve a specific problem (reporting and its historicization) for which this methodology proved to be the perfect solution.

@chrisseaton
Copy link

CQRS

What does this stand for? I'm not sure it's common enough to use without explanation.

for which this methodology proved to be the perfect solution

I can't believe it's perfect. Surely there were some down-sides? Sounds like a one-sided talk otherwise.

@Jean85
Copy link
Author

Jean85 commented Jan 15, 2018

@chrisseaton thanks for the review! Answers below:

CQRS stands for Command Query Responsibility Segregation; I skipped adding it to avoid those lengthy words, I might add it if the CFP limits allows it; I've edited the gist to add it, thanks.

As for the "perfect solution" remark, I stated it that way because it's the right tool for the right job, not a golden hammer; I think mostly there are implementation downsides, which I cover in the talk; apart from that, the only downside that I see is the inherent complexity, which I already highlighted in the previous paragraph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment