Reputation: 316
I'm planning a model for microservices using event sourcing. To achieve a high scalability and high throughput handling capacity, I'll use Kafka as a message broker for the microservices.
At this point, I have questions about the implementation of the model to be able to have the benefits of Kafka topic and partition. There are some requirements that my model needs to fit:
Well, with this requirements in mind, I've endend up with a model that:
My questions:
EDIT
My new proposal for my client:
Upvotes: 3
Views: 896
Reputation: 9555
This model does some coupling of the domains? The Gateway is validating subresources ID's to ensure data consistency in one Elasticsearch database (the case of A pointing to B).
You answered your own question with the following sentence:
All read requests are handled by the "Microservice Gateway"
If that is true your system does not have a domain separation at all. In fact you have a god-Gateway that needs to know about all domains.
A gateway should be constrained to very dedicated purposes that the domain specific services cannot fulfill (e.g. security, routing/proxy, load balancing, consolidation, resilience, etc.).
I don't know if this model fits reports requests, there are some complex reports that process a lot of data with input parameters from the user and from his point of view, the operation must be "synchronous" (request/response REST)
I would see reports as a separate service that ideally uses the existing services to get whatever information is required. Depending on your domain and requirements you may want to have some dedicated non-public endpoints at your services for this or you may want to access the database directly (e.g. with specialized queries on graph databases).
Is the validation of requests/new state a part of the business logic (related to DDD)? If so, my model is incorret to separate them into two microservices?
It depends on the type of validation. For validating correctness from a domain point of view you need the corresponding service. If you want to validate other things other parts of your system could be responsible (logging, authorization, thwarting malicious attempts, ...)
*For your edit:
- Instead of having a gateway acting as a part of the microservice, let gateway only for: routing (microservice discovery), balancing and auth stuffs (calling a dedicated microservice for authentication/authorization)
Few things about this:
Upvotes: 2