简体   繁体   中英

How does UI (View) and Microservices communicate do I make GUI within per service?

Ive been understanding Microservices and Monolithic arch type

Within a Mono App, Everything from UI (view) from models to controllers and Services are within that one War file or if using springboot embedded tomcat then its within that fat jar file. ETC

So when it comes down to microservices, do i keep all the UI files within the main app? So like my main app would only contain the VIew Model and Controller (MVC) etc. Do I just use controllers and models to update UI(view) from the data ive gotten from per service?

or do i need to create a presentaional layer (GUi) within each service i create to return that page? what im saying is within the micro do i need to make a view(GUI) within that app itself instead of the main application.

Im still understanding, So lets say our main app runs on port 80 is that where all GUi's(views) and our Models and Controllers will live? then another port will have the per service and i just make that call to just get the data to display it within our main app UI (View).

Im just trying to wrap my head around how the UI works with mircoserives thats the only thing stopping me,

my main point is that. In a Micro app. Ill have Everything from MVC to within one app which is our main app will deploy then within that main app will make API request to the micro service then update the view with our data.

Help me understand this one someone please help me clarify this blockage about how do i implement our UI within a micro arch type. I know this question is all over the place but i was trying to paint a picture.

It depends on your architecture, but in most common cases the architect is as follows: Imagine you have a shop and in your shop you have Order service on port 8081 and inventory service on port 8082 and so on. each service exposes some rest Api's. Then you will have a discovery server, which brings all of these Rest Api's to a single address together(Eureka for instance). Then you have a single GUI that consume these API's. These days normally you use React or Vue or Angular as Single page application to make the consumer GUI for your app. In production you will deploy each part on different Docker Containers and config the orchestration with some tool like kube.netis. In this case they will be able to speak together. In between services sometimes we use KAFKA or rabbit MQ for decoupling the services. Also, you can implement the authentication by using some services like keycloack which is a complete open source third party to handle both authentication and authorization. Hopefully this can answer your question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM