RabbitMQ as an example can easily do 10,000/sec. So 2,000,000 with
some quick math would end up taking about 2.5 minutes. It could be
that your handlers are a bit slow (which happens at times). I
generally look at handlers and look for opportunities for batching
(automatically) or in the case of some that are really just slow I
consider it not such a big deal because the rebuilding of projections
is asynchronous anyways. On one system we had about 200,000,000 events
in the store and a replay would often end up needing 20-50m events.
For these they often took over night but since its an async process it
was never a big deal (the system did not have to go down etc in order
to do it).
HTH
Greg
--
Les erreurs de grammaire et de syntaxe ont été incluses pour m'assurer
de votre attention
I hope that we can use some kind of ServiceBus/Messaging to populate
these Views (SQL database).
Our need is that we will find solution where messages are not lost
before they are applied to views and it will not significantly change
performance of our core application.
Are there some points which we have to take care about?
I mean can we just use ApacheMQ and create messages in CRUD and recieve
these messages in new application/service and populate views, or will
be better to develop extension in terms of CQRS which will consume our
Messages from CRUD.
In my point of view CQRS is complicated for this solution and does not
come with any added value in that solution, but more eyes can see more,
so it will be helpfull to read your comments.
Thank you for your help and time.
A>
Many talk about this but it introduces huge amounts of complexity for what is often very slight perf gains. I might consider this in a strange edge case but never in a 'normal' case
I have some questions about that.
If I will use some messaging like ApacheMQ for sending events to
denormalizer is there some good practices, how to deal with situation
when ApacheMQ(or another message queue) is not accessible?
I want to hookup into our existing system, and send events to
denormalizer which is doable, but the main system performance or
functionality have to work without denormalizer or ApacheMQ is not
accessible (hi load, or some net problems), on the other way views has
to be consistent. When the ApacheMQ, denormalizer comes online it has
to reply all events which was not send into queuve.
I can imagine some scenarios, but It will be really nice to hear some
comments from peoples who had some experiences with something similar.
Solution what I can imagine is something like this.
1. Hook into CRUD on recieving/sending money
2. IF ApacheMQ is accessible -> send event which will contain all data
needed to change views in read model. Here is important to attach all
data to event, which are needed to change views without needs to query
our CRUD database, because of that events can be pulled in no time
order, or there can be holes in queue. Another thing is that CRUD DB
records could be in new state in time in which I will consume events
in denormalizer.
3. IF ApacheMQ is not accessible, use some storage to store message
localy, or use CRUD DB to store these events which can be send in
future. This is for keeping read model in consistent state.
But there are some doubts about 2. and 3. It seams that I can remove
2. . When I will create denormalizer which will consume records in
some table in CRUD DB which will contains messages for populating read
model, it can be easlily as bottleneck in system because of traffic on
that table. In the other way if I will use only 2. that CRUD system
will depend on ApacheMQ.
I know that this group is about DDD/CQRS, but it is not possible to
move all app to CQRS, but we want to move some peaces of that system
and hopefully in future we can leave CRUD behind us.
Sorry for my bad english and I hope that someone can understand what I mean.
A.
@Rinat: NoSql for event storage or for persistent view models? How exactly did you find it easier?
I really thank you for your post, because it means that i'm not totaly lost.
I will try some prototype of that "extension" to our system and
hopefully I will get some more space in our bussiness app to do more
DDD CQRS.
Thank you a lot :-)
A.
Ales,
1. Just use some compact serializer and you should be fine even if there are hundreds of thousands of messages in the table. Besides, append-only tables do not cause a lot of stress on the DB. I suggest to benchmark first before making any assumptions on the performance.
2. Messaging is an essential requirement fur such kind of solution. If messaging server is allowed to be down most of the time, then something has to be changed in the project (either discard the entire event-centric approach or make messaging more reliable)