Chapter 5. Deployment and Testing

This chapter will explain how to deploy microservices in different forms, from standalone to containers such as Docker. It will also demonstrate how Docker can be used to deploy our sample project on a cloud service such as AWS. Before implementing Docker, first we'll explore other factors about microservices, such as load balancing and Edge Server. You will also come to understand microservice testing using different REST clients such as RestTemplate, Netflix Feign, and so on.

In this chapter, we will cover the following topics:

  • An overview of microservice architecture using Netflix OSS
  • Load balancing microservices
  • Edge Server
  • Circuit breakers and monitoring
  • Microservice deployment using containers
  • Microservice integration testing using Docker containers

An overview of microservice architecture using Netflix OSS

Netflix are pioneers in microservice architecture. They were the first to successfully implement microservice architecture on a large scale. They also helped increase its popularity and contributed immensely to microservices by open sourcing most of their microservice tools with Netflix Open Source Software Center (OSS).

According to the Netflix blog, when Netflix was developing their platform, they used Apache Cassandra for data storage, which is an open source tool from Apache. They started contributing to Cassandra with fixes and optimization extensions. This led to Netflix seeing the benefits of releasing Netflix projects with the name Open Source Software Center.

Spring took the opportunity to integrate many Netflix OSS projects, such as Zuul, Ribbon, Hystrix, Eureka Server, and Turbine, into Spring Cloud. This is one of the reasons Spring Cloud provides a ready-made platform for developing production-ready microservices. Now, let's take a look at a few important Netflix tools and how they fit into microservice architecture:

An overview of microservice architecture using Netflix OSS

Microservice architecture diagram

As you can see in the preceding diagram, for each of the microservice practices, we have Netflix tool associated with it. We can go through the following mapping to understand it. Detailed information is covered in the respective sections of this chapter except concerning Eureka, which is elaborated on in the last chapter.

  • Edge Server: We use Netflix Zuul Server as an Edge Server.
  • Load balancing: Netflix Ribbon is used for load balancing.
  • Circuit breaker: Netflix Hystrix is used as a circuit breaker and helps to keep the system up.
  • Service discovery and registration: Netflix Eureka Server is used for service discovery and registration.
  • Monitoring dashboard: Hystrix Dashboard is used with Netflix Turbine for microservice monitoring. It provides a dashboard to check the health of running microservices.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset