Considerations

Some things to consider when decomposing an application into individual services:

Right now the client makes one request to retrieve catalog information and another for recommendations. We might want to reduce chattiness in the client and aggregate the request in the proxy or make one of the services responsible for that. For example, we can send a request to the catalog service which could request recommendations from the recommendation service, or have the edge proxy fan out and call both and return the combined result.

We might want to further decompose a bounded context around business components, components, or other things. For example, depending on how our application scales, we might want to separate the search function from the other catalog features. We will keep it more coarsely grained until we determine there is a need to further partition.

Elasticsearch is used in place of other graph databases for providing recommendations for a couple of reasons. Elasticsearch includes an extremely powerful graph API, and because it’s used for other areas, we can reduce the number of technologies and share information for best practices.

We could place the recommendations and products into different indexes of the same Elasticsearch cluster. As long as one service is not permitted to directly access the other service’s index, we should be fine and might be able to reduce costs by running multiple clusters.

It’s quite possible that many of these services could be further decomposed into more microservices. For example, the team had considered further decomposing the order service into more services, by moving some of the functionality out to a payment/checkout service. However, the team had determined that refactoring it at a later time would require minimal work, and they were not ready to manage more services or the complexities it involves at this time.

Domain-Driven Design is an approach and a tool. It’s a great tool in this situation, but it’s not the only approach to decomposing a domain into separate services.

At the moment, customers are anonymous and simply enter payment information every time they make a purchase. In the future, a feature will be added to the application that enables customer accounts.

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

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