Here are the design considerations for a software.
The querying of data should be as fast as possible (reader <1s, writer <2.5s possibly since it also take time to reach the client end web or mobile)
It should use microservices so there can be a swarm of them when load increases
The system writes should be efficient and Sql Server should not become a bottleneck.
Each mini-team should be responsible for their microservice only.
- each microservice, there is a pair=> (reader, writer).
- The writer would write to Sql Server and emits events
- The cache updater listens to events and updates cache.
- The reader would only query cache.
- The gateway communicates only through AMQP either reader or writer
However I'm a bit confused if Web Gateway should be using AMQP to communicate to reader since it requires multiple hops
- Web gateway to AMQP (Query)
- AMQP to Reader (Query delivered)
- Reader to Cache
- Cache to Reader
- Reader to AMQP (Response)
- AMQP to Web Gateway (Response delivered)
Would it be a better idea NOT TO USE AMQP for readers? Other choices could be
- NETMQ, a dotnet variant of ZeroMQ: fastest but it involves checking your each frame yourself
Does this design not satisfy the objective 4 that each team should work on their microservice only? If I put reader and writer in one service then it increases the surface area as reader would be communicating through a mechanism other than AMQP for performance while writer is using AMQP.