Solution

In this architecture, there is scope for two microservices. The first is for authentication that gets users logged in based on the credentials provided and sends the privilege level back to the consumer as a response. The second is based on privilege level. The service should return the percentage of discount that may be applied on the cart (another service) built by the consumer.

In the following diagram, there are two components having two different Databases. Assuming both components have exposed their services as REST interfaces, consumers can hit Authentication Service MS1 with credentials and get the user object, including privilege level, and then, it can hit the second microservice with privilege level and get the discount coupon percentage:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset