3

I work in a company that uses microservices. We have one particular service (let's call it Cart Service for example purposes) that manages some logic (storing carts, allowing other services to add and remove items from a given user's cart, etc). My team owns this service and multiple other critical paths (like Item Search) talk to it routinely at 1000+ QPS.

Now, we need to add a web frontend that allows customer support people to remove/add items to the cart manually. This frontend basically needs to do all the stuff our service exposes currently, plus some more specific things (changing the owner of a cart, say). We have two choices:

  1. Make Cart Service serve the frontend. The frontend can talk to Cart Service to change the owners of the cart.
  2. Make a new Cart Admin Service that only serves the frontend and which talks to the Cart Service to perform the cart actions. This service wouldn't store any new data (probably) but would have to talk to other services (like customer support auth, etc).

I think that we should go with option 2 to avoid bloat of the Cart Service (which does a lot of stuff already) and that way we can scale the new service independently. It also separates the customer support concern from the core business concerns - Cart Admin Service and Cart Service have different uptime requirements, and we might bring down Cart Service inadvertently if we introduce a bug trying to change the frontend.

However, my coworker thinks that we should go with option 1 because writing the new APIs that the Cart Service would need to expose would be time better spent doing other things, and since the load of Cart Admin would be so insignificant compared to the current load of the Cart Service, load concerns don't really matter.

What are the pros and cons of each method beyond what I've described? Is there a reason one method is clearly better than the other?

asked Feb 15, 2018 at 7:04
2
  • To what extent does the vocabulary (and data structures behind it) used in Cart and Cart Admin diverge? Would you have to create a lot of Admin-suffixed or prefixed versions of your objects if both lived in the same microservice? Commented Feb 15, 2018 at 9:40
  • I think the vocabulary would be hardly divergent at all. Possibly, we would have to add some flags to the data models in the Cart Service to note that they had been edited by users of the Admin frontend Commented Feb 15, 2018 at 15:33

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.