Business Logic Orchestration
I'm currently working on a product that has around 20 Web API micro-services and an Angular front-end. The front end application communicates to the API gateway service. The gateway service then communicates to the other services to perform the necessary actions. What I am struggling with is how to best manage the business logic orchestration.
In simple terms, the web app is a loan application system. A customer fills out a number of fields and clicks apply. Upon clicking apply, this data is sent to the gateway. The gateway then performs a number of actions (by calling many other micro-services) such as customer credit checks, customer fraud checks, gets the apr rate the customer is eligible for, emails the customer and so on and so forth. This process is started with a post to a controller. The controller then has access to what we call a 'Manger class'. This manager class is where the problem is. As this one function has lots of responsibilities, the class is huge. The class contains a lot of - connect to service A , wait for result. Was result A success, connect to service B. Was result B success? connect to service C.
This approach doesn't feel right. The solution is built on micro-services yet feels like a monolith. The class is so far away from SRP its crazy. How could I manage this business logic orchestration in a better way?
Thanks in advance
0 comments:
Post a Comment