0

Read through a lot of the CQRS/DDD/ES blog posts, still unsure a simple blog engine would work.

In the case of publishing a post, for instance... User clicks publish → PostPublished event added to Event Store → Triggers the Aggregate Objects (for instance, Archive and FrontPage) to be updated to reflect most recent event.

On the user side, I click the publish button and am redirected to the front page of my blog, where I expect to see the new post on the top. However, if the Event Store is behind (say by 1-2 seconds), my new post will not show up.

Is the answer to have a system that waits for all the Aggregates to be updated before returning the redirect to the user?

ehfeng
  • 3,807
  • 4
  • 33
  • 42

1 Answers1

0

Your question is how to deal with eventual consistency, and there really isn't a fool proof one size fits all solution.

The best solution IMO would be to simply put a 'Post published, it will show up in a moment' notification up there. Some people will also do queries over and over until they get the recent change THEN display the front page. Which delays the front page for a second or two if the ES is behind.

Charles
  • 3,734
  • 3
  • 31
  • 49