On 17 Nov 2015, at 10:42, Jack Snow wrote:
> I am interested in what you guys are doing to deduplicate events on
> the
> read side. All events will have a GUID. Unfortunately, not all events
> can
> be idempotent.
In what circumstances might you get a duplicate event?
>
> I am planning to use Kafka as my message bus. I can read an event on
> kafka
> and process it to update the read side, then update the read offset in
> kafka. However, if the consumer crashes after updating the read side
> and
> before updating the offset in kafka, the event will be read again when
> we
> bring the process back up.
I am also looking at using Kafka as an Event Store and was pondering the
same problem.
Having a uuid per event and having the consumer keep track seems like a
good option to me.
As you suggest the uuid would need to be stored in the same place as the
read model so it can be wrapped in a transaction.
I think the same is usually true of the offset too.
>
> I am considering checking for the guid of the event in the database on
> the
> read side before processing, if it doesn't exist, update the read side
> and
> add the guid of the event to a table in the database. This can be in
> MySQL
> for example, and all of that would happen in a transaction.
>
> Is it valid/acceptable to have a log of processed events in each
> bounded
> context? Is this something that is important in production systems
> from
> your experiences?
>
> Are there any better solutions than the above?
>
> --
> You received this message because you are subscribed to the Google
> Groups "DDD/CQRS" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
dddcqrs+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
-—
Software Engineer
teamcoding.com
github.com/krisleech
linkedin.com/in/krisleech