
This video gives an overview of this section.
We need a common understanding of microservices.
Learn common definitions
Learn our definition
Why microservices
Where does this approach come from and what can it look like?
Learn monoliths/big applications
Learn different distributed approaches
Deployment of microservices needs a different approach. Here is a high-level overview.
Learn how to run a single microservice
Learn how to deploy a microservice
Learn how to manage the life cycle of your application
Docker and its tools is the foundation for later work.
Download Docker
Check if Docker works
You need to learn about a very important tool for dealing with distributed Docker applications.
Explore the docker-compose CLI
Deploy and run applications
Let’s get docker-compose to work.
Combine old files
Add a new service
We have seen how to mock simple users, but you can also use your own user classes in tests.
Update the directory layout
Tweak the existing bookmark service
Requests need to be routed to different services and also instances. Add a simple reverse proxy for that.
Create the service
Use hardcoded service instances for now
Give it a try
We need to know which services and which instances are running.
Create the service instance
Add Eureka client to the bookmarks service
We need to finish the service registration.
Finalize Eureka integration
Give it a try
We need a way to handle configuration among all services and service instances. Spring has a service for that.
Add the configuration service
Move the shared configuration to that service
When we have finished the configuration, we can spin up the application to see it in action.
Finish the service configurations
Start all services
Refresh a service
Using Spring Cloud bus, we can easily interact with a group of services at once and exchange data.
Add the dependency
Configure Spring cloud bus to use rabbitMQ
Give it a try
It’s tedious to start everything by hand all the time; we need script support.
Create automation scripts
Give it a try
There are a couple of ways to create distributed user interfaces. Let’s learn about a few.
Get an overview
Learn shared layout in a library
Learn web components for distributed services
In this video, we will look at the steps to update to the latest version of Spring Boot.
Take a look at the update to Spring Boot 2
Take a look at the Spring Cloud release train Finchley
In this video, we will continue to look at the steps to update to the latest version of Spring Boot.
Take a look at the update to Spring Boot 2
Take a look at the Spring Cloud release train Finchley
We will finish updating to the latest version of Spring Boot.
Fix some more upgrade findings
First, we extract the user and login handling.
Create the new user service
Transfer functionality from the bookmarks service
The reverse proxy is our gatekeeper, so it needs to know where to send users to login.
Add dependencies for the reverse proxy
Configure the reverse proxy to use the user service for the login
We’re pretty much done with the login, clean house and try it.
Configure and clean up
Start everything up
Test it
Let’s try the library approach to share common layout data between services.
Create the library project
Create fragments in the layout file
We’re almost done with the layout file. Finish that and include the library in the other services.
Finish the layout file
Use the library in the services
Web components are a very important new web standard that fit well with distributed applications.
Learn what is a web component
Learn how to use a simple web component
See their advantages and disadvantages
As a start, we try to show some data using a web component.
Add dependencies
Add a page that contains the component
Create a bookmark list component
We now need to finish the JavaScript code for the component and try it out.
Finish the bookmark list component
Integrate on the new page
Give it a try!
We also need to edit data, so we add a way to edit it as well.
Tweak Java code
Add permission-based links
Add bower dependencies
The bookmark list view should honor the available options for the user.
Add styling for buttons
Add permission-based buttons
Create JavaScript handlers
Now we can start to create the form component.
Create an edit component file
Add a template
Start with JS code
The UI needs handlers for the important actions.
Create a Showeditor method
Create a save method
Give it a try
We have to add another service to have some reason to communicate.
Add a project using the project generator
Copy the configuration from the bookmarks service
Add the REST controller
We need to finish the controller and add a data model with persistence.
Finish the controller
Finish the data model
Start with the DAO class
After finalizing the DAO, we also need something to visualize the ratings.
Finish the DAO
Add a simple web component for ratings
To put the rating service to use, we have to integrate it into the Bookmarks UI.
Prepare routing config in the reverse proxy
Add the web component to the Bookmarks UI
Add delete calls to clean up
When the delete call is completed in the bookmarks service, we need the rating service to handle it.
Finish the delete call
Add a delete handler in the ratings service
Give it a try
To make the service communication more reliable, we should add Hystrix.
Add the Hystrix dependency
Integrate into the ratings service call
Add automatic retries
We need to configure the ratings service to react to the delete events.
Configure message broker bindings
Test the message processing
Start the service
To notify interested services, we now have to emit the delete events.
Configure the bookmarks service
Write a test that verifies that an event is published
Give it a try
You should know about the different ways to communicate using events.
Learn different event types
Learn message durability
Learn event sourcing
To follow a request to the system, we need to pass an identifier around with the requests.
Enhance Zuul to generate the IDs
Add logging and forwarding of the ID in the bookmarks service
Add logging and forwarding of the ID in the ratings service
To know how the Hystrix supported communication works, we can utilize an existing monitoring dashboard.
Add the Turbine service
Add the Hystrix dashboard service
Give it a try
Even better than the DIY tracking solution is to use zipkin, which is battle tested and open source.
Add dependency to the services
Add zipkin-ui to Docker
Give it a try
As a simple UI to see the status of your services, you can use the spring boot admin application.
Add a new service
Configure the bookmarks service to allow access by the application
Give it a try
There are a couple of things you should also know about when dealing with distributed systems and monitoring.
Learn call tracing
Learn log handling
Learn monitoring tools
To run the service in the cloud, we want to use Docker containers.
Make the bookmarks service able to be deployed using Docker
Check the changes for the other services
There are still some changes in the services to check and the configuration service needs some Docker-specific properties.
Finish the changes to the other services
Add Docker-specific properties for services to the configuration service
To run multiple Docker containers at once with a given configuration, you can use docker-compose.
Add the docker-compose configuration
See some important Docker commands in action
Start services
Now that everything runs, we should verify this.
Check that services are running
Check log files of services
Give it a try
Kubernetes is a well-known cloud platform, so we use it to run the application in a cloud-ready way.
Update Docker files to work with Kubernetes
Update the docker-compose config to still be able to run it locally
Check the Kubernetes con-fig for our services
After finishing the service configuration, we can configure Kubernetes to expose our reverse proxy
Check the remaining Kubernetes service configurations
Configure the ingress controller
When we’ve finished all configuration files, we can build and run everything to see that it really works.
Check the remaining configurations
Build everything
Give it a try
When all services are started, we can finally check the application in the browser.
Start the remaining services
Check in a browser
Sometimes the legal regulations require special solutions
Learn the CLOUD act
Learn about Datensparsamkeit
Learn GDPR
Sometimes, the decision on where to put something is hard; this can be data or functionality.
Learn the data model
Learn about service boundaries
When developing larger applications, you can kill or strengthen developer productivity using the right rules and environments.
Test
Learn about developer environments
Ask questions
When compiling and packaging your software, you can do quite a few things wrong?
Learn continuous integration
Learn dependency handling
Learn about Docker
When deploying your software, you should do a few things and especially do a few things not to create a working and secure solution.
Learn about rolling out new versions
Configuration
Learn secrets handling
Using the right monitoring tools, you can see not only how well your application is, but also how well your business is running.
Monitoring tools
Custom business metrics
Custom technical metrics
In this course, you will learn how to split an existing application into smaller services and what you need to build, deploy, and run it. You will learn how you can use Docker to support your local development and how you can utilize it to run your application in the cloud. To work with multiple services, you will need (for example) service discovery and reverse proxies. To be able to maintain the development pace, you also need to break up your user interface, so every service can serve its own UI, and you need to learn how to communicate with these services synchronously using REST and asynchronously using events. To run your application, you need to know what is going on in your distributed application, so monitoring and tracing calls is an important topic as well, and one that you'll learn about. So overall, this course will give you valuable insights and recipes with which to create your own distributed application, for deployment to the cloud.
You will also see what needs to be done to upgrade a Spring Boot 1.x service to Spring Boot 2 with the recent Spring Cloud release.
About the Author
Patrick Cornelissen is a software developer at heart and the founder and CEO of the Orchit GmbH and kulinariWeb GmbH. He has written a number of applications in various languages and platforms and specializes in microservice-based applications and the transition of monolithic applications into microservices. He has been using the Spring Framework since 2009 and has been a big fan ever since. After his family, software craftsmanship is a passion of his that he pursues whenever he has any spare time. For this, he has organized, for example, code retreats and open space conferences in the past. He enjoys both learning and teaching new things in the field of (agile) software development.