Doing microservices with JHipster
微服务与单片架构 Microservices vs Monolithic architecture
JHipster会问你的第一个问题是你想要生成的应用程序。您可以选择两种构建方式:
- A "monolithic" architecture uses a single, one-size-fits-all application, which contains both the front-end Angular code, and the back-end Spring Boot code.
- A "microservices" architecture splits the front-end and the back-end, so that it's easier for your application to scale and survive infrastructure issues.
A "monolithic" application is much easier to work on, so if you don't have any specific requirements, this is the option we recommend, and our default option.
微服务架构概述 Microservices architecture overview
JHipster微服务架构的工作原理如下::
- 一个gateway 是一个JHipster应用 (当生成时选择的应用类型是
microservice gateway
),它是Web流量的入口和服务于Angular应用程序. 可以有几个不同的网关,如果你想遵循 Backends for Frontends pattern, 但这不是强制性的。- JHipster Registry 是一个运行的应用程序对所有应用程序注册,并得到他们的配置。它还提供运行时监控仪表板。
- Microservices 是JHipster生成的应用程序 (using application type
microservice application
when you generate them), 用于处理REST请求。它们是无状态的,并且它们的几个实例可并行启动以处理重负载。 - The JHipster Console is a monitoring & alerting console, based on the ELK stack.
在下图中,绿色组件特定于您的应用程序,蓝色组件提供其底层基础架构。