3 ms·
> How do I efficiently reconstruct the current state from the event stream? There isn't one 'current state'. That thinking comes from centralising everything
by mrkeen 3y ago
> How do I efficiently reconstruct the current state from the event stream?
There isn't one 'current state'. That thinking comes from centralising everything in one DB.
You create different states in different systems according to different requirements. If you're building a shopping system, with Purchases and Customers, one service could read events and produce a relational table for finance purposes. Another service could read events and produce a key-value store of customer data. A third service could power an OpenSearch service for searching over products.
> How would the event stream be modelled in the database?
It's a list. If you're using something fit-for-purpose like Kafka, then it's multiple lists (topics, partitions, etc.).