- Spring 5.0 Microservices(Second Edition)
- Rajesh R V
- 478字
- 2021-07-02 19:44:52
An example of a holiday portal
In the first example, we will review a holiday portal--Fly By Points. Fly By Points collects points that are accumulated when a customer books a hotel, flight, or car through their online website. When a customer logs in to the Fly By Points website, they will be able to see the points accumulated, personalized offers that can be availed by redeeming the points, and upcoming trips, if any:

Let's assume that the preceding page is the home page after login. There are 2 upcoming trips for Jeo, 4 personalized offers, and 21123 points. When the user clicks on each of the boxes, details will be queried and displayed.
Holiday portal has a Java, Spring-based traditional monolithic application architecture, as follows:

As shown in the preceding diagram, Holiday portal's architecture is web-based and modular with clear separation between layers. Following the usual practice, Holiday portal is also deployed as a single war file deployed on a web server such as Tomcat. Data is stored in an all encompassing backing relational database. This is a good fit for the purposes of architecture when the complexities are less. As the business grows, the user base expands and the complexity also increases.
This results in a proportional increase in the transaction volumes. At this point, enterprises should look for rearchitecting the monolithic application to microservices for better speed of delivery, agility, and manageability:

Upon examining the simple microservices version of this application, we will immediately see a few things in this architecture:
- Each subsystem has now become an independent system by itself--a microservice. There are three microservices representing three business functions--Trips, Offers, and Points. Each one has its internal data store and middle layer. The internal structure of each service remains the same.
- Each service encapsulates its own database as well as its own HTTP listener. As opposed to the previous model, there is no web server and there is no war. Instead, each service has its own embedded HTTP listener, such as Jetty, Tomcat, and more.
- Each microservice exposes a rest service to manipulate the resources/entities that belong to that service.
It is assumed that the presentation layer is developed using a client-side JavaScript MVC framework, such as Angular JS. These client-side frameworks are capable of invoking REST calls directly.
When the web page is loaded, all three boxes, Trips, Offers, and Points, will be displayed with details such as points, number of offers, and number of trips. This will be done by each box independently making asynchronous calls to the respective backend microservices using REST. There is no dependency between the services at the service layer. When the user clicks on any of the boxes, the screen will be transitioned and will load the details of the clicked item. This will be done by making another call to the respective microservice.
- JSP網(wǎng)絡(luò)編程(學(xué)習(xí)筆記)
- Node.js Design Patterns
- Python機器學(xué)習(xí):數(shù)據(jù)分析與評分卡建模(微課版)
- C語言程序設(shè)計案例教程(第2版)
- SpringMVC+MyBatis快速開發(fā)與項目實戰(zhàn)
- 架構(gòu)不再難(全5冊)
- Python程序設(shè)計(第3版)
- 三維圖形化C++趣味編程
- Learning Informatica PowerCenter 10.x(Second Edition)
- Mastering AndEngine Game Development
- Flux Architecture
- Modern JavaScript Applications
- Natural Language Processing with Java and LingPipe Cookbook
- Managing Microsoft Hybrid Clouds
- 零基礎(chǔ)學(xué)HTML+CSS第2版