--
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+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/dddcqrs.
For more options, visit https://groups.google.com/d/optout.
To your first point. Once events are stored, I inform a "sequencer" of that fact. It then numbers the new events inside Sql Server. The events are then published in that order. So events with original id values 10 and 11 may get sequence 10 and 11, or 11 and 10 if the first transaction takes longer and is not done when the sequencer starts. But that is perfectly fine, because sequence 10 will always be published before sequence 11. In either case everything will be ordered by the sequencer and there will be no gaps.
Disclaimer, this is probably not the best solution for large systems with high load, but it works great for me. Also I am not suggesting anyone do it this way, only answering your question of how others do it.
Cheers
Ramin
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/dddcqrs.
For more options, visit https://groups.google.com/d/optout.
--
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+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/dddcqrs.
For more options, visit https://groups.google.com/d/optout.
The problem you're going to run into is that only a single document write in mongodb is atomic. Thus the only way to guarantee consistency (a requirement for any eventstore) is to keep all events for a stream in a single document.
On Thu, Jul 13, 2017 at 11:56 AM, Sebastian Stehle <mail2...@gmail.com> wrote:
So you have a single server as sequencer in your cluster? I could just write an event store server on top of MongoDB and ensure that I write the events ordered. Probably good enough and should be easy to achieve a throughput of 2000/sec or so. I could also stream the data with Grpc.
Am Donnerstag, 13. Juli 2017 11:13:03 UTC+2 schrieb Ramin:I think I might be doing something similar. Here's how I do it. I write the events to Sql Server, and once that is done I publish the stored events to the bus. No need for one transaction. On top of that I can handle events synchronously in the first step inside the transaction for denormalizations I want to not be eventually consistent.To your first point. Once events are stored, I inform a "sequencer" of that fact. It then numbers the new events inside Sql Server. The events are then published in that order. So events with original id values 10 and 11 may get sequence 10 and 11, or 11 and 10 if the first transaction takes longer and is not done when the sequencer starts. But that is perfectly fine, because sequence 10 will always be published before sequence 11. In either case everything will be ordered by the sequencer and there will be no gaps.
Disclaimer, this is probably not the best solution for large systems with high load, but it works great for me. Also I am not suggesting anyone do it this way, only answering your question of how others do it.
Cheers
Ramin
--
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.
Visit this group at https://groups.google.com/group/dddcqrs.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/dddcqrs.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/dddcqrs.
For more options, visit https://groups.google.com/d/optout.
--
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+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
How would you solve my problem?
I tried to do it another post.
I am looking for a solution so that each event is handled by each event handler at least once.
Each handler saves the position of the last received event and polls for all events after this position. There is no need that this position is a global sequence number.My current solution for MongoDB/CosmosDB associates a global unique number for each event (could also be the ticks). But even if Event2 gets a higher number than Event1 it does not mean that Event1 is available for the query before Event2. If you don't serialize the insertion to the MongoDB you get this problem.
Another idea is to insert the events without a global sequence number and assign a global sequence number in a background process.I guess it should be possible to number thousands of events per second with bulk updates, which is good enough for me.
Am Donnerstag, 13. Juli 2017 18:54:08 UTC+2 schrieb Nils Kilden-Pedersen:On Thu, Jul 13, 2017 at 11:49 AM, Sebastian Stehle <mail2...@gmail.com> wrote:How would you solve my problem?Can you rephrase it more succinctly? Specifically why you think you need monotonic global ordering?
--
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+unsubscribe@googlegroups.com.