i'm new to the whole Microservice architecture so pardon my unstructured questions:

Context: The business needs customers to be able to select commodities, calculate the cost of these commodities based on certain business rules to do with the amount of commodities selected, currency and other rules that affect the calculation result. So:

  1. there is need to invoke an exchange reference service for currency rates
  2. Get selected commodities from user interface
  3. Invoke a calculation engine to return the calculation result done based on the business rules

Q1. What would be the best format to write this calculation microservice specification to pass on for development?

Q2. In an ideal architecture will the calculation engine sit in the commodities database or as a separate service?

Q3. Any model way(microservices) to architect this with the dependencies mentioned in 1,2 and 3 above?

Thanks All

  • 1
    Q1: Why should there be more than 1 microservices CommoditiesService? Q2: Service Q3: A single and monolith web application. You didn't introduce any valid reason that justifies Microservice (or any other distributed architecture). – Laiv Feb 28 '18 at 10:32

Q1. What ever format you normally use. make sure to specify all the business rules clearly.

Q2. In a seperate service. It's always bad to do business logic on the database.

Q3. The microservices way is to make ever smaller services and join them up with message queues. But at some point you have to make a judgement call about whats worth moving out into another service, as there is a degree of work and maintenance penalty per microservice. This will depend on the details of your setup.

  • Thanks Ewan, can both the calculation engine housing the business logic and service doing the exchange rate conversion be one microservice? or better developed as separate services? – Jp Nerih Feb 28 '18 at 12:00

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.