Apurva Singh
Apurva Singh

Reputation: 5000

How to implement User Interface for Microservice Application based on AWS

There are numerous articles such as this one, which insist that while implementing microservices, each team should build its own UI. These fragments can be composed into a single page using iFrames or div. My question is, how to implement using AWS. This could be done at deployment time, or runtime. 1. Deployment time: HTML fragments need to be collected as part of CI/CD process and put together in S3 which serves as web server for static pages (API GW for dynamic JSON content). 2. Run time: The html fragment (div)will have to be delivered to client browser on demand, as and when client clicks through (can be cached in client browser, and/or API GW. What is the technology for this? I don't think Lambdas can deliver HTML fragments through API GW. Also, the CI/CD approach appears to be fuzzy to me. Btw any other way? Thanks

Upvotes: 0

Views: 78

Answers (1)

Gourab Paul
Gourab Paul

Reputation: 655

Use SPA like angular/react (but not limited to. Same method can be implemented in MPA). SPA helps us to segregate the UI from the back-end and both runs independently. And in the service layer of the application(UI), call the respective micro-service say M1 or M2. In monolithic applications like MPA (multi page application- spring/struts/jsp) where the UI is generated from the back-end and are tightly coupled you need to call different rest-api using jquery/ajax and process the JSON response.

In SPA multiple scenarios like parallel trigger all micro-services or wait for M1 and pass the payload to M2 or race between M1 and M2 can be achieved using promises in javascript

Upvotes: 1

Related Questions