Re: Event sourcing and topic partitions

2016-03-29 Thread Mark van Leeuwen
Thanks. Apparently there is nothing wrong with that :-) I came to the same conclusion in an earlier post. Would be good if someone having experience with Kafka and event sourcing corrected this stackoverflow answer (i.e. update 2): http://stackoverflow.com/questions/17708489/using-kafka-as-a-c

Re: Event sourcing and topic partitions

2016-03-29 Thread Mark van Leeuwen
Thanks for your detailed reply. Viewing each partition as an ordered event bus is helpful. The problem then moves to working out a strategy for mapping individual DDD aggregates to partitions in a cluster which distributes load and also allows for growing the cluster. On 30/03/16 01:07, Hel

Re: Event sourcing and topic partitions

2016-03-29 Thread Cees de Groot
What's wrong with multiple aggregates per partition? You'll still process all events for each aggregate in order. If you want to just replay for a single aggregate somewhere, Kafka can spit out events fast enough to allow you to quickly skip through all the stuff you don't need... On Mon, Mar 28,

Re: Event sourcing and topic partitions

2016-03-29 Thread Helleren, Erik
Well, if a partition is too large of a unit of order for your tastes, you can add publisher ID¹s to some metadata, or force partition mapping and use the key as an extra level of partitioning. And, pick a topicName that describes all the traffic on that topic. An example: topicName=³ad.click.even

Re: Event sourcing and topic partitions

2016-03-29 Thread Mark van Leeuwen
Thanks for sharing your experience. I'm surprised no one else has responded. Maybe there are few people using Kafka for event sourcing. I did find one answer to my question http://stackoverflow.com/questions/26060535/kafka-as-event-store-in-event-sourced-system?rq=1 I guess using a single top

Re: Event sourcing and topic partitions

2016-03-28 Thread Daniel Schierbeck
Have you looked into using a relational database as the primary store, with something like Maxwell or Bottled Water as a broadcast mechanism? On Mon, 28 Mar 2016 at 17:28 Daniel Schierbeck wrote: > I ended up abandoning the use of Kafka as a primary event store, for > several reasons. One is the

Re: Event sourcing and topic partitions

2016-03-28 Thread Daniel Schierbeck
I ended up abandoning the use of Kafka as a primary event store, for several reasons. One is the partition granularity issue; another is the lack of a way to guarantee exclusive write access, i.e. ensure that only a single process can commit an event for an aggregate at any one time. On Mon, 28 Mar

Event sourcing and topic partitions

2016-03-28 Thread Mark van Leeuwen
Hi all, When using Kafka for event sourcing in a CQRS style app, what approach do you recommend for mapping DDD aggregates to topic partitions? Assigning a partition to each aggregate seems at first to be the right approach: events can be replayed in correct order for each aggregate and ther