- Spring 5.0 By Example
- Claudio Eduardo de Oliveira
- 348字
- 2021-06-24 19:17:27
Microservices and Spring Boot
The microservices architectural style, in general, is distributed, must be loosely coupled, and be well-defined. These characteristics must be followed when you want a microservices architecture.
Much of Spring Boot is aimed at developer productivity by making common concepts, such as RESTful HTTP and embedded web application runtimes, easy to wire up and use. In many respects, it also aims to serve as a micro-framework, by enabling developers to pick and choose the parts of the framework they need, without being overwhelmed by bulky or otherwise unnecessary runtime dependencies. This also enables Boot applications to be packaged into small units of deployment, and the framework is able to use build systems to generate those deployables as runnable Java archives.
The main characteristics of microservices are:
- Small-grained components
- Domain responsibility (orders, shopping carts)
- Programming-language agnostic
- Database agnostic
Spring Boot enables us to run an application on embedded web servers such as Tomcat, Jetty, and Undertow. This makes it extremely easy to deploy our components because it is possible to expose our HTTP APIs in one JAR.
The Spring Team even thinks in terms of developer productivity, and they offer a couple of projects called starters. These projects are groups of dependencies with some compatibilities. These awesome projects additionally work with the convention over configuration. Basically, they are common configurations that developers need to make on every single project. We can change these settings in our application.properties or application.yaml files.
Another critical point for microservices architecture is monitoring. Let's say that we're working on an e-commerce solution. We have two components, shopping cart and payments. The shopping cart probably needs to have several instances and payments need to have fewer instances. How can we check these several instances? How can we check the health of these services? We need to fire an alarm when these instances go down. This is a common implementation for all services. The Spring Framework supplies a module called Spring Boot Actuator that provides some built-in health checks for our application, databases, and much more.
- 程序設計與實踐(VB.NET)
- JavaScript+DHTML語法與范例詳解詞典
- Docker進階與實戰
- 跟小海龜學Python
- Learn WebAssembly
- 微信公眾平臺開發:從零基礎到ThinkPHP5高性能框架實踐
- Mastering openFrameworks:Creative Coding Demystified
- Python Machine Learning Blueprints:Intuitive data projects you can relate to
- 并行編程方法與優化實踐
- C++程序設計教程
- Angular Design Patterns
- 從零開始:C語言快速入門教程
- Robot Framework Test Automation
- Deep Learning for Natural Language Processing
- 體驗之道:從需求到實踐的用戶體驗實戰