Chapter 3. Reference Architecture Environment

This reference architecture demonstrates an airline ticket search system built in the microservice architectural style. Each individual microservice is implemented as a REST service on top of Spring Boot with an embedded Tomcat server, deployed on an OpenShift image with a supported OpenJDK. The software stack of a typical microservice is as follows:

Figure 3.1. Microservice Software Stack

Microservice Software Stack

Each microservice instance runs in a container instance, with one container per OpenShift pod and one pod per service replica. At its core, an application built in the microservice architectural style consists of a number of replicated containers calling each other:

Figure 3.2. Container Software Stack

Container Software Stack

The core functionality of the application is provided by microservices, each fulfilling a single responsibility. One service acts as the API gateway, calling individual microservices and aggregating the response so it can be consumed easier.

Figure 3.3. Functional Diagram

Functional Diagram

The architecture makes extended use of Spring Sleuth and OpenZipkin for distributed tracing. OpenZipkin runs as a separate service with a MySQL database used to persist its data, and it is called from every service in the application.

Figure 3.4. Zipkin Calls

Zipkin Calls

Finally, the reference architecture uses Zuul as an edge service to provide static and dynamic routing. The result is that all service calls are actually directed to Zuul and it proxies the request as appropriate. This capability is leveraged to demonstrate A/B testing by providing an alternate version of the Sales service and making a runtime decision to use it for a group of customers.

Figure 3.5. Zuul Proxy

Zuul Proxy