In our monolith application, the piece of code that used to handle sending SMSes and emails was written in our business layer. Now the responsibility of sending emails and SMSes is handled by a microservice. Lets call it
SendMicroservice. Now other microservices call
SendMicroservice if they want to send any emails and SMSes. Lets say this microservice is named
Now typically, the norm in our organisation is to have a service layer for talking to the outside world. The business layer for taking decisions and data access layer for talking with databases, just a typical N-layer architecture.
Now in which layer of
WantsToSendMicroservice, should it talk to
SendMicroservice? Currently in our organisation, it is done in business layer. But there they just talk to the
SendMicroservice. Typically no decisions are made there. Is the business layer an ideal place for microservices to talk to each other or that should be done in some other layer? Maybe the service layer or some other one?