General steps for solution architecture are –
- Break down/decompose the application into functional areas. These functional area’s provide us the with the bounded context
- Within the functional bounded context, design/define your micro services
- Functional areas talk to each other over micro services or use some kind of event queue models
- Each of the functional areas only expose services to be consumed by the application
Now from the design perspective, you have the service identified, exposing endpoints.
Qs comes, who will do the orchestration of service invocation and aggregation of data from multiple services?
Where does the intelligence lies ?
- Server Side - Create an aggregator service that internally invokes other services (across functional domains) and aggregates the results. This aggregator service is invoked by the application presentation tier
- Presentation/Application Side – If you implementing JSP or server side view creation, the presentation tier can perform the orchestration across the services and aggregate the data. One can use Lambda/Futures to implement non blocking call model also
- Client Side – In this case, the invocation of services and aggregation of data happens at client side. The UI is composes of multiple widgets, which call up individual services and aggregate the response on the client side
Where should you intelligence lie?
There is no correct answer, depending on the use case, different options can be applied. One can also apply multiple options within the same application depending on the type of the client to be supported or at times, you do not want to expose individual services and an aggregator service might be better.
This post originally appeared at www.techspot.co.in