Just a review of what I'm planning and to see if it can work.
Im using a RDBMS and planning to use CQRS without event sourcing. I think event sourcing is a bit advanced for a first attempt and I'm forced to use an RDBMS.
The Task based UI is made up of many commands most of which do not need a response.
Architecture is basically
/---- RDBMS ( EF )
IO ops \
| \
Single threaded Domains Fascade(DTO) Queries
| /
Event/Command Dispatcher /
\ /
MVC client
Single threaded domains don't talk to each other and they talk to the outside world via disruptors (basically ring buffers).
The Command dispatcher copies external events and commands to disk and reloads them in case of crash. Completion is explicitly marked (by IO Ops).
Commands will basically be persisted (with a transactional scope of the command), the IO Ops layer will grab all the events and process them and marks the command completion in 1 transaction. (note the command is persisted via a journal services not the domain but it talks to IO opps which matches it up with work for the command). If the command fails and its marked persist ( not all will be ) then it can be replayed. (It only persists the command when it has the command and has received a DoTransation Message.)
The Command dispatcher connects to the domains via a disruptor.
Questions
Should I load the entire domain into memory (about 300 - 500 Meg) and run of that?Obviously domain would only update after the DB is updated.
Is it OK to mix external events back into the command dispatcher (so it gets picked up by the single thread and processed) . eg the event becomes a command.
It looks simple to code the domains and user code (and I get a nice rich domain), at least from a prototype I'm working on. Is it?
When the domains do IO they send a message to a disruptor and can either
- specify the command guid and the command gets matched up with a transaction
- assume completion ( shoot and pray)
- provide a call back command which is passed to the command dispatcher and then reappears in the domain. After an IO message is created the system can continue on
the current command or complete it and receive the next command.
Is this good enough?
The system runs in one process and shared memory, but the domains resources are only accessed by themselves and 1 thread . Is this ok?
It's a bit of an experimental mish mesh. Any thoughts?