cqrs

JOliver EventStore - How to access all stored events?

故事扮演 提交于 2019-12-04 12:42:49
How can I access all stored events in the EventStore to rebuild my read models? A method called GetFrom is mentioned at question J Oliver EventStore V2.0 questions , but I cannot find this method on the interface "IStoreEvents" which is returned from Wireup. Jonathan Oliver That method is a part of the IPersistStreams interface and not the IStoreEvents interface. The API needs to be refined slightly to accommodate that. I have just added a method to IStoreEvents called GetFrom(DateTime started) that returns IEnumerable<Commit> : https://github.com/joliver/EventStore/commit

In ES + CQRS + DDD, can a event not update any real domain state at all?

末鹿安然 提交于 2019-12-04 12:26:02
问题 Would it be ok to have events in the event stream that does not effect any aggregate in the domain state? Take for instance an event such as AllCompletedTodosPurged that does nothing more than change a read model with active todos by removing all completed todos. 回答1: No, it wouldn't be ok. A Domain event is generated when the aggregate state changes. If nothing changed, there is no domain event. You can use events outside the domain as well, but they wouldn't be part of the domain and

CQRS (event sourcing): Projections with multiple aggregates

百般思念 提交于 2019-12-04 12:14:03
问题 I have a question regarding projections involving multiple aggregates on a CQRS architecture. For example sake, suppose I have two aggregates WorkItem and Developer and that the following events happen sequentially (but not immediately) WorkItemCreated (workItemId) WorkItemTitleChanged (workItemId, title) DeveloperCreated (developerId) DeveloperNameChanged (developerId, name) WorkItemAssigned (workitemId, DeveloperId) I wish to create a projection which is as "inner join" of developer

What is causing EventStore to throw ConcurrencyException so easily?

半腔热情 提交于 2019-12-04 11:50:19
Using JOliver EventStore 3.0, and just getting started with simple samples. I have a simple pub/sub CQRS implementation using NServiceBus. A client sends commands on the bus, a domain server recieves and processes the commands and stores events to the eventstore, which are then published on the bus by the eventstore's dispatcher. a read-model server then subscribes to those events to update the read-model. Nothing fancy, pretty much by-the-book. It is working, but just in simple tests I am getting lots of concurrency exceptions (intermittantly) on the domain server when the event is stored to

Choosing a NoSQL database for storing events in a CQRS designed application

你说的曾经没有我的故事 提交于 2019-12-04 11:49:24
I am looking for a good, up to date and "decision helping" explanation on how to choose a NoSQL database engine for storing all the events in a CQRS designed application. I am currently a newcomer to all things around NoSQL (but learning): please be clear and do not hesitate to explain your point of view in an (almost too much) precise manner. This post may deserve other newcomers like me. This database will: Be able to insert 2 to 10 rows per updates asked by the front view (in my case, updates are frequent). Think of thousand of updates per minute, how would it scale? Critically need to be

Relational database schema for event sourcing

泪湿孤枕 提交于 2019-12-04 11:44:35
问题 I am trying to store domain events in a postgres database. I am not sure in many things, and I don't want to redesign this structure later, so I am seeking for guidance from people who have experience with event sourcing. I have currently the following table: domain events version - or event id, integer sequence, helps to maintain order by replays type - event type, probably classname with namespace aggregate - aggregate id, probably random string for each aggregate timestamp - when the event

Event Sourcing command or event from external system?

ε祈祈猫儿з 提交于 2019-12-04 11:12:52
问题 In most cases I understand the distinction between a command and an event in a CQRS + ES system. However, there is one situation that I can't figure out. Suppose I am building a personal finance tracking system, where a user can enter debits/credits. Clearly these are commands, and once they are validated the domain model gets updated and an event is published. However, suppose that credit/debit information also comes directly from external systems e.g. the user's florist sends a message that

Generating events from SQL server

夙愿已清 提交于 2019-12-04 10:53:50
I am looking for a best practice or example of how I might be able to generate events for all update events on a given SQL Server 2008 R2 db. To be more descriptive, I am working on a POC where I would essentially publish update events to a queue (RabbitMq in my case) that could then be consumed by various consumers. This would be the first part of implementing a CQRS query-only data model via event sourcing. By placing on the que anybody could then subscribe to these events for replication into any number of query-only data models. This part is clear and fairly well-defined. the problem I am

CQRS - Single command handler?

删除回忆录丶 提交于 2019-12-04 09:45:15
I´m just trying to wrap my head around CQRS(/ES). I have not done anything serious with CQRS. Probably I´m just missing something very fundamental right now. Currently I´m reading "Exploring CQRS and Event Sourcing". There is one sentence that somehow puzzles my in regards of commands: "A single recipient processes a command." I´ve seen this also in the CQRS sample application from Greg Young ( FakeBus.cs ) where an exception is thrown when more then one command handler is registered for any command type. For me this is an indication that this is a fundamental principle for CQRS (or Commands?)

Event Sourcing: Events that trigger others & rebuilding state

做~自己de王妃 提交于 2019-12-04 08:42:58
问题 I'm struggling to get my head around what should happen when rebuilding the model by replaying events from the EventStore, in particular when events may trigger other events to happen. For example, a user who has made 10 purchases should be promoted to a preferred customer and receive an email offering them certain promotions. We clearly don't want the email to be sent every time we rebuild the model for that user, but how do we stop this from happening when we replay our 10th