0
votes

Currently, we are using the micro services architecture. In the landing page of our application, the user can see the list of campaigns (Campaign Micro service) which is associated with various other parameters such as coupon id (Coupon Micro service), destination country id's (Content Management Micro service), created by user id (User management Micro service) etc., But we need to show the coupon name, destination country names and user name rather than just showing the id's in the listing page.

How I can retrieve all this details without having any lag on the performance?

1
Can you speak to the intents of all the microservices? This may be one of the instances where the microservices are too "micro" and doesn't associate to a given domain and a bounded context. It sounds like all the services are basic CRUD apps. Off the top of my head, I am thinking about using aggregates in the campaign service but that may violate data integrity when it comes to that. In order to not violate data integrity, I would suggest making the additional requests to the respective services but that contributes to network calls which has the potential of hurting performance. - Will C

1 Answers

0
votes

It is always a trade off between availability and consistency. Getting a response within a reasonable amout of time is part of the availability of the CAP theorem.

If you are going to implement microservices and you don't want to take the hit on performance, then you should think about data duplication. The data you need for showing this list will be duplicated in the database that your landing page has access to. But the different services (i.e. Campaign, Coupon etc) will still be the source of truth in your application landscape.

This will solve the potential performance problem, but you get the problem of keeping the data eventual consistent in return.