1

My team is building a tenanted primary service, with shared microservices used by that primary to separate common business tasks. We're building a new microservice that is responsible for running a series of business rules against a primary object in our system. Think of it like the Order in a shopping cart, and maybe the new service is responsible for doing a set of validation checks on the Order.

We like the microservice idea because we can add new business rules very quickly, without necessarily needing to deploy them to all tenants. We have a number of existing rules to build from, and we expect to need new rules on a very frequent basis, although the amount of data on the Order entity will change infrequently.

The question -- What is a good way to design the inputs to this service?

  1. We could pass the new service the entire Order, but that feels overkill if we only need some of the values on it. (it's a lot)
  2. On the other hand, we don't want to have to deploy all of the tenanted systems to add a new business rule, so only passing the currently needed values is not enough.
  3. ?? Your other idea here! I can imagine a great number of complex plans!
  • In your opinion, what is a microservice? – user253751 Mar 9 at 13:06
  • A component that encapsulates a distinct business purpose. – rythos42 Mar 9 at 17:30
  • In your opinion, what is a business purpose? – user253751 Mar 9 at 17:33
  • I'd prefer to answer with examples, not sure I could write a definition. Continuing with the shopping cart example (which my application is not), I'd say that "payment", "order validation" are distinct business purposes. I say "order validation", because you could imagine in a white-label SaaS product that one company running the product might have different rules of validation than another. – rythos42 Mar 9 at 18:54
  • I ask because I don't think that order validation is a business purpose. In most companies, ordering is (apparently) a good fit for a microservice. I'm not familiar with microservice design, but I keep hearing that they should be loosely coupled and shouldn't share databases, etc. Order validation is just part of ordering. What would you gain by running order validation on its own set of servers developed by its own team? – user253751 Mar 9 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.