Hacker News new | ask | show | jobs
by arnioxux 2780 days ago
I wrote a similar comment before, viewing redux as a realization of the event sourcing pattern: https://news.ycombinator.com/item?id=17061827

You can go even further and use the exact same "events" or "actions" for event sourcing on the server side too. You just need to save the list of actions to the server. This lets you do realtime sync and multiplayer really easily!

2 comments

This.

It makes Implementing CQRS in a single service really easy. GETs load the event log, replay and display the results while POSTs send a command that gets translated into an event. If it is valid it gets appended to the log. This approach is storage agnostic: It doesn’t matter how the log ultimately gets stored

Yeah good connection there. The Redux chrome plugin does indeed show a log of actions and you can rewind through time.

That's another nice way of doing things that way, better diagnostics eh?