capitalone/cqrs-manager-for-distributed-reactive-services

1 vs n command processors?

Closed this issue · 1 comments

In the Commander architecture diagram, there are many micro consumers, but only a single command processor (either one logical application with many instances scaled across partitions, or a single instance consuming all partitions. Is this understanding correct?

The benefits of a single command processor seem to be:

  • A linearisable history of commands, and the ability to process each command serially (similar to Datomic's transactor). I'm not sure how important this turns out to be in practice?
  • Each command only needs to be read once

The downsides are:

  • Failover and updating is more complicated
  • All commands are written in the same application, which means that different teams need to coordinate deployments/updates to the single command processor

The pros/cons of running several command processors are the inverse of this.

Is the single command processor a specific design decision in the commander pattern, or am I misreading the diagram?

bobby commented

Yes, the intent is to have a single command processor to handle all causally-related commands on a partition. If commands aren't causally linked, they can go on a different topic/partition and be handled by a different command processor.