
This section will explain you what this course covers. The table of contents and objectives of the course.
Also, it will demonstrate the different applications and setup requirements need to be installed before you proceed with the course.
This lesson gives you an introduction to microservices. It covers the background, evaluation, and fundamental concepts of microservices.
In this section you will learn the following:
Evolution of Microservices
Speed of Delivery and Agility
Turn Around Time and Cost
Microservices are an architectural style used by many organizations today as a game changer to achieve high degrees of agility, speed of delivery, and scale.
In this section you will learn the following:
Definition of Microservices
Microservices example – An example of a Holiday Portal
Microservice offers several benefits over the traditional multi-tier monolithic architectures. This section explains some of the key benefits of the microservices architecture approach.
In this section you will learn the following:
Supports Polygot Architecture
Elastically and Selectively Scalable
Allowing Co-existence of Different Versions
Enables DevOps
This section will summarize the topics covered in this lesson.
Take the assessment to test your understanding about this lesson.
This lesson covers the relationship with Service Oriented Architecture, the concepts of cloud native and Twelve Factor applications, and explains some of the common use cases. It will cover the objectives and topics that will be explained.
Twelve-Factor App, forwarded by Heroku, is a methodology describing characteristics expected from a modern cloud-ready application. These twelve factors are equally applicable for microservices as well. Hence, it is important to understand the Twelve Factors.
In this section you will learn the following:
Single Code Base
Bundle Dependencies
Externalizing Configurations
Backing Services are Addressable
Isolation between build, release and run
Stateless Shared Nothing Process
Exposed Services Through Port Bindings
Concurrency for Scale Out
Disposability with Minimal Overhead
Development Production Parity
Externalizing Logs
Package Admin Processes
The trios Cloud (more specifically, Containers), Microservices and DevOps, are targeting a set of common objectives--speed of delivery, business value, and cost benefits.
In this section, you will learn the following:
DevOps Clouds and Containers
DevOps as the Practice and Process for Microservices
Cloud and Containers
Many organizations had already successfully embarked on their journey to the microservices world.
In this section, we will examine some of the front runners on the microservices space to analyze why they did what they did, and how they did it?
Here you will be familiarized with a curated list of organizations adopted microservices, based on the information available on the internet.
Microservices are already in the mainstream. When developing microservices, there are some cross-cutting concerns that need to be implemented, such as externalized logging, tracing, embedded HTTP listener, health checks, and so on.
As a result, significant efforts will go into developing these cross-cutting concerns.
Microservices frameworks are emerged in this space to fill these gaps. In this section you will learn about the curated list of Microservices Frameworks.
This section will summarize the topics covered in this lesson.
Here, we will introduce the Spring Boot framework, and explain how Spring Boot can help building RESTful microservices in line with the principles and characteristics discussed in the previous lesson. Finally, some of the features offered by Spring Boot for making the microservices production ready will be reviewed. It will cover the objectives and topics that will be explained.
The easiest way to develop and demonstrate Spring Boot's capabilities is by using the Spring Boot CLI, a command-line tool.
In this section you will learn to do the following:
Setting up a Development Environment
Developing a Spring Boot Microservice
Developing our first Spring Boot Microservice
There are multiple ways to test REST/JSON Spring Boot microservices.
The easiest way is to use a web browser or a curl command pointing to the URL, like this: curl localhost:8080.
In this section you will learn to do the following:
Testing Spring Boot Microservice
Reactive Microservices using Spring Boot and RabbitMQ
Creating a Spring Boot application with a sender and receiver both connected through an external queue
In an ideal case, all microservice interactions are expected to happen asynchronously using publish subscribe semantics. Spring Boot provides a hassle-free mechanism to configure messaging solutions:
In this section you will learn to do the following:
Reactive Microservices using Spring Boot and RabbitMQ
Creating a Spring Boot application with a sender and receiver both connected through an external queue
It is important to secure the microservices. This will be more significant when there are many microservices communicating with each other. Each service needs to be secured, but at the same time, security shouldn't surface as an overhead. In this section, we will learn some basic measures to secure microservices.
In this section, you will learn the following:
Securing a Microservice with Basic Security
Enabling Cross Origin for Microservices Interactions
Monitoring Using JConsole
Documenting Microservices
Generating REST API documentation using Springfox libraries
This section will summarize the topics covered in this lesson.
This lesson will examine the technical challenges around the practical implementations of microservices. It will also provide guidelines around critical design decisions for successful microservice developments. The solutions and patterns for several commonly raised concerns around microservices will also be examined. It will cover the objectives and topics that will be explained.
The most pragmatic way to design microservice boundaries is to run the scenario at hand through several possible options, just like a service litmus test. Keep in mind that there may be multiple conditions matching a given scenario that will lead to a trade-off analysis.
In this section you will learn the following:
Autonomous Functions
Polygot Architecture
Agile Teams and Co-Development
Single Responsibility
Communication between microservices can be designed either in synchronous (requestresponse) or asynchronous (fire and forget) styles.
In this section, you will learn the following:
Synchronous Style Communication
Asynchronous Style Communication
Choosing Style
Orchestration of Microservices
Can Microservices share a Data Store
Deciding Transactional Boundaries
One of the important aspects of microservices is the service design.
In this section, you will learn the following:
Use of API Gateways in Microservices
Service Versioning Considerations
Microservices and Bulk Operations
This section will summarize the topics covered in this lesson.
In this lesson, we will take a step back and put together our learnings into a capability model.
There are several ecosystem capabilities required for the successful delivery of microservices.
It is important to ensure that those required capabilities are in place as a precondition. Even though the capabilities required for microservice implementation may vary based on the solution context, this course attempts to build a generic microservice capability model instead of building a low-level reference architecture. At the end of this lesson, we will also examine a maturity model for microservice adoption. It will cover the objectives and topics that will be explained.
Core capabilities are those components generally packaged inside a single microservice.
For example, let's take an Order microservice. The Order microservice will have two key deployable parts, order.jar developed using Spring Boot and its own database—Order DB.
The order.jar will encapsulate service listeners, libraries required for execution, service implementation code, and service APIs or endpoints, and Order DB stores all data required for Order service.
Smaller microservices only require these core capabilities. Gartner named this as inner architecture and the capabilities outside of this core as outer architecture.
In this section you will learn the following:
Service Listeners and Libraries
Storage Capability
Service Implementation
Service Endpoint
Certain infrastructure capabilities are required for a successful deployment and managing large-scale microservices. When deploying microservices at scale, not having proper infrastructure capabilities can be challenging and lead to failures. In some cases, Platform as a Service (PaaS) vendors such as Red Hat OpenShift offer all these capabilities out of the box.
In this section, you will learn the following:
Container Runtime
Container Orchestration
Supporting capabilities are not directly linked to microservices, but these are essential for large-scale microservices development. These services will have a dependency on the production runtime of microservices.
In this section you will learn the following:
Service Gateway
Software Defined Load Balancer
Central Log Management
Service Discovery
Service Configuration
Ops Monitoring
Dependency Management
The last piece in the puzzle is the process and governance capabilities that are required for microservices. These are processes, tools, and guidelines around microservices implementations.
In this section you will learn the following:
DevOps
Automation Tools
Microservice Documentation
Reference Architecture and Libraries
Microservice adoption needs some careful thoughts. A quick maturity assessment will be helpful to understand the maturity of the organization and some of the challenges the organization can expect.
In this section you will learn the following:
Microservices Maturity Model
Level 0 - Traditional
Level 1 - Basic
Level 2 - Intermediate
Level 3 - Advanced
This section will summarize the topics covered in this lesson.
This lesson will introduce BrownField Airline (BF), a fictitious budget airline, and their journey from a monolithic Passenger Sales and Service (PSS) application to a next generation microservices architecture. Also, this lesson examines the PSS application in detail, and explains the challenges, approach, and transformation steps of a monolithic system to a microservices-based architecture, adhering to the principles and practices that were explained in the previous lesson.
The intention of this case study is to get us as close as possible to a live scenario so that the architecture concepts can be set in stone. At the end of this lesson, we will also examine a maturity model for microservice adoption. It will cover the objectives and topics that will be explained.
The BrownField Airline is one of the fastest growing, low-cost, regional airlines, flying directly to more than one hundred destinations from its hub. As a start-up airline, BrownField Airline has started its operations with a few destinations and a few aircrafts. The BrownField has developed its home-grown PSS application to handle their passenger sales and services.
In this section you will learn the following:
Business Process Review
Functional View
Architecture View
Design View
Implementation View
Deployment View
The PSS application was performing well, successfully supporting all business requirements, as well as expected service levels. The system had no issues in scaling with the organic growth of the business in the initial years. The fleet size increased significantly, and new destinations got added to the network.
As a result of this rapid growth, the number of bookings has gone up, resulting in a steep increase in transaction volumes--up to 200 to 500-fold of what was originally estimated.
In this section, you will learn the following Pain Points:
Stability
Outages
Agility
There are not many improvement opportunities left to support the growing demand of BrownField Airline's business. BrownField Airline was looking to re-platform the system with an evolutionary approach rather than a revolutionary model. Microservices is an ideal choice in such situations, for transforming a legacy monolithic application with minimal disruption to the business.
In this section you will learn the following:
Planned Approach for Migration
Migration Approach
Identification of Microservices Boundaries
Analyze Dependencies
Prioritizing Microservices for Migration
Data Synchronization during Migration
Managing Reference Data
User Interfaces and Web Applications
Test Strategy
Orchestrating Microservices
We will be implementing four microservices--Search, Fare, Booking, and Check-In.
In order to test the application, there is a website application developed using Spring MVC with Thymeleaf templates. The asynchronous messaging is implemented with the help of RabbitMQ.
In this sample implementation, the default H2 database is used as the in-memory store for demonstration purposes.
In this section you will learn the following:
Target Implementation
Implementation Projects
Running and testing the Project
This section will summarize the topics covered in this lesson.
This lesson will provide a deep insight into the various components of the Spring Cloud project, such as Eureka, Zuul, Ribbon, and Spring Config, by positioning them against the microservices capability model.
We will demonstrate how the Spring Cloud components help to scale the BrownField Airline's PSS microservices system. It will cover the objectives and topics that will be explained.
Spring Cloud provides several capabilities, which are essential when developing applications targeting cloud deployments that adhere to the Twelve-Factor Application principles.
By using Spring Cloud, developers just need to focus on building business capabilities using Spring Boot, and leverage the distributed, fault-tolerant, and self-healing capabilities available out-of-the-box from Spring Cloud. It offers many choices of solutions for developers based on their requirements.
In this section you will learn the following:
Spring Cloud Releases
Setting up the Environment for BrownField PSS
Spring Cloud Config
Setting Up the Config Server
Understanding the Config Server URL
In this section you will learn the following:
Accessing the Config Server from Clients
Handling Configuration Changes
In this section you will learn the following:
Using Spring Cloud Bus
Setting up High Availability for the Config Server
Monitoring Config Server Health
Config Server for Configuration Files
Completing Changes to use Config Server
So far, we have achieved externalizing configuration parameters, as well as load balancing across many service instances. Ribbon-based load balancing is enough for most of the microservices requirements.
In this section, you will learn the following:
Eureka for Registration and Discovery
Understanding Dynamic Service Registration and Discovery
Understanding Eureka
Setting up the Eureka Server
Zuul is a simple gateway service or edge service, which well suits such situations. Zuul also came from the Netflix family of microservices products. Unlike many enterprise API gateway products, Zuul provides complete control to developers to configure or program based on specific requirements.
In this section you will learn the following:
Zuul acting as a Proxy
Setting Up Zuul
Usefulness of Zuul
Filters
In this section you will learn the following:
Writing a Custom Filter
Custom Filter
Protecting Microservices with Spring Cloud Security
Summarizing the BrownField PSS
Run RabbitMQ
This section will summarize the topics covered in this lesson.
This lesson will cover the necessity and importance of logging and monitoring in microservice deployments. Further will examine the challenges and solutions to address logging and monitoring with several potential architectures and technologies. It will cover the objectives and topics that will be explained.
Logs are nothing but streams of events coming from a running process. The applications send log entries to the console or the filesystem. File recycling techniques are generally employed to avoid logs filling up all disk space.
In this section you will learn the following:
Understanding Log Management Challenges
Centralized Logging Solution
Components of Centralized Logging Solution
Spring Cloud Config
There are several options available for implementing a centralized logging solution.
These solutions use different approaches, architectures, and technologies. It is important to understand the capabilities required and select the right solution that meets the needs.
In this section, you will learn the following:
Cloud Services
Off the Shelf Solutions
Best of the Breed Integration
Custom Logging Implementation
Understanding Log Management Challenges
Implementation of a custom logging solution using the ELK stack
Microservices are truly distributed systems with fluid deployment topology. Without a sophisticated monitoring in place, the operations team may run into trouble managing large-scale microservices.
In general, application monitoring is more of a collection of metrics and aggregation and validating them against certain baseline values. If there is a service-level breach, then monitoring tools generate alerts and send to administrators.
In this section you will learn the following:
Monitoring Challenges
Monitoring Tools
Monitoring Microservice Dependency
Spring Cloud Hystrix for fault tolerant Microservices
The following example showcases how to use Turbine to monitor circuit breakers across multiple instances and services. We will use the Search service and Search API Gateway in this example. Turbine internally uses Eureka to resolve service IDs that are configured for monitoring.
In this section you will learn the following:
Aggregate Hystrix Streams with Turbine
Data Analysis using Data Lake
This section will summarize the topics covered in this lesson.
This lesson will introduce the concepts and relevance of virtual machine images and containerized deployments of microservices. Further familiarize you with how to build Docker images for BrownField PSS microservices developed with Spring Boot and Spring Cloud. Finally, this lesson will also touch base on how to manage, maintain, and deploy Docker images in a production-like environment. It will cover the objectives and topics that will be explained.
Container providers, such as Docker, simplified container technologies to a great extent, which also helped the large adoption of container technologies in today's world. The recent popularity of DevOps and microservices also acted as catalysts for the rebirth of container technologies.
In this section you will learn the following:
What are Containers
Difference between Virtual Machine and Containers
Benefits of Containers
Microservice and Containers
Docker is a platform to build, ship, and run lightweight containers based on Linux kernels.
Docker has a default support for Linux platforms. They also have support for Mac and Windows using Boot2Docker, which runs on top of Virtual Box. Amazon EC2 Container Service (ECS) has out-of-the-box support for Docker on AWS EC2 instances. Docker can be installed on bare metals and on traditional virtual machines such as VMWare or Hyper-V.
In this section, you will learn the following:
Key Components for installation of Docker
The Docker Image
The Docker Container
The Docker Registry
Docker File
This lesson will operationalize our learning by showcasing how to build containers for our BrownField PSS microservices.
In this section you will learn the following:
Deploying Microservices in Docker
Running RabbitMQ on Docker
Using the Docker Registry
Future of Containerization
This section will summarize the topics covered in this lesson.
This lesson will explain the basic scaling approaches and the need and use of Mesos and Marathon as an infrastructure-orchestration layer to achieve optimized resource usage in a cloud-like environment when deploying microservices at scale.
We will also provide a step-by-step approach to setting up Mesos and Marathon in a cloud environment.
Finally, we will demonstrate how to manage dockerized microservices into the Mesos and Marathon environment. It will cover the objectives and topics that will be explained.
In this section, we will focus on scaling dockerized microservices using Mesos and Marathon.
In this section you will learn the following:
Understanding Autoscaling
The Missing Pieces
Container orchestration tools provide a layer of abstraction for developers and infrastructure teams to deal with large-scale containerized deployments. The features offered by the container orchestration tools vary between providers.
In this section, you will learn the following:
Importance of Container Orchestration
Functions of Container Orchestration
Key Capabilities of Container Orchestration
Common Strategies of Resource Allocation
Relationship with Microservices
Relationship with Virtualization
Many organizations choose Kubernetes or Mesos with a framework such as Marathon.
In this section we will see how Mesos works with Marathon to provide the required container orchestration capability.
Mesos is used by many organizations including Twitter, Airbnb, Apple, eBay, Netflix, PayPal, Uber, Yelp, and many others.
In this section you will learn the following:
Mesos in Details
Mesos Architecture
Mesos Workflow
Marathon
Basic features of Marathon
In this section, the dockerized Brownfield microservices developed in lesson 9, Containerizing Microservices with Docker, will be deployed into the AWS cloud, and we will manage them with Mesos and Marathon.
In this section you will learn the following:
Installation Mesos, Marathon and related components
Running Mesos and Marathon
Preparing BrownField PSS services
Deploying BrownField PSS services
This section will summarize the topics covered in this lesson.
Spring is one of the most popular choices among Java developers when it comes to developing applications for enterprises or the web.
This course is designed to help you implement microservice architecture in Spring Framework, Spring Boot, and Spring Cloud. You will get started by understanding the guidelines for implementing responsive microservices at scale. After this, you’ll get up to speed with how Spring Boot can be used to deploy serverless autonomous services without the need for a heavyweight application server. As you cover later chapters, you’ll explore advanced topics, such as deploying your microservices to Docker and managing them with Mesos.
By the end of this course, you’ll have developed the skills you need to implement microservices using the Spring framework and use them in internet-scale deployments with the help of real-world examples.
About the Author
Rajesh R V is a seasoned IT architect with extensive experience in diversified technologies and more than 18 years of airline IT experience. He received a degree in computer engineering from the University of Cochin, India, and he joined the JEE community during the early days of EJB. During his course as an architect, he worked on many large-scale, mission-critical projects, including the new generation passenger reservation system (iFly Res) and the next-generation cargo reservation system (Skychain, CROAMIS) in the Airline domain. At present, as a chief architect at Emirates, Rajesh handles the solution architecture portfolio spread across various capabilities, such as JEE, SOA, NoSQL, IoT, cognitive computing, mobile, UI, and integration. At Emirates, the open travel platform (OTP) architected by him earned the group the prestigious 2011 Red Hat Innovation Award in the Carved Out Costs category. In 2011, he introduced the innovative concept of the Honeycomb architecture based on the hexagonal architecture pattern for transforming the legacy mainframe system. Rajesh has a deep passion for technology and architecture. He also holds several certifications, such as BEA Certified Weblogic Administrator, Sun Certified Java Enterprise Architect, Open Group Certified TOGAF practitioner, Licensed ZapThink Architect in SOA, and IASA global CITA-A Certified Architecture Specialist. He has written Spring Microservices and reviewed Service-Oriented Java Business Integration by Packt Publishing.
Niyazi Erdogan is a Senior software developer and DevOps engineer and based in Switzerland. He has over 10 years of experience in various fields, namely Telecom, Industries, Healthcare and more. He is also a AWS certified solutions architect. He looks over the development of different softwares right from scratch until production. He has worked in various multi national companies in different locations, namely in Turkey, Portugal and Switzerland. His previous working experience were in Turkcell technology research and development, NETAS, Siemens and Roche to name a few. He also is an Udemy instructor.