Reputation: 6002
When creating a snapshot of a stream, do I continue the snapshotted stream as usual, or do I create a new stream where all events after the snapshot will be placed?
stream-123: event1 | event2
<snapshot-123-event2>
stream-123: event1 | event2 | event3 | event4
stream-123-1: event1 | event2
<snapshot-123-event2>
stream-123-2: event3 | event4
Upvotes: 0
Views: 38
Reputation: 57267
Most commonly, creating a new stream is done in response to something of significance in the business domain. For example, at the end of the fiscal year, we might "close the books", bringing that life cycle to an end, while beginning the life cycle of a new collection of entities to track the next year.
Another example might be a transition from one process to another -- when we are shopping, we're adding and removing items from the cart. But once we place the order, we have new processes that launch to handle billing, fulfillment, and so on, which could be tracked by different services in different streams.
Snapshotting as a performance optimization does not usually introduce a new stream; instead, it only caches some interesting (and non-authoritative) intermediate results to improve the latencies in handling requests.
Upvotes: 4