I am sitting here looking into CQRS and event sourcing, really interesting topics. When it comes to stream design, and and aggregate roots, i feel a bit left in the dark. How do you do it?
Lets imagine that i have an UI, where i can add stuff to a basket, generating a lines in a basket.
Would I have:
- a stream pr basket (with basic info attached, like shipping details, name, email etc)
- a stream pr basketline
So i would have many streams
- streams/basket-[basketid]
- streams/basketline-[basketid]
Basically i only send the minimal data over the wire.
or would i simply have one stream
- stream/basket-[basketid]
And every time i add a line to my basket, i send the whole basket over the wire.
As i understand it, it is best to have one to many streams, and not one big streams/basket stream. Or am I mistaken here as well?
My focus here is streams. Any "best practices" on this kind of design: Links, books etc would be appriciated.