Book Image

Learn Docker - Fundamentals of Docker 18.x

By : Dr. Gabriel N. Schenker
Book Image

Learn Docker - Fundamentals of Docker 18.x

By: Dr. Gabriel N. Schenker

Overview of this book

Docker containers have revolutionized the software supply chain in small and big enterprises. Never before has a new technology so rapidly penetrated the top 500 enterprises worldwide. Companies that embrace containers and containerize their traditional mission-critical applications have reported savings of at least 50% in total maintenance cost and a reduction of 90% (or more) of the time required to deploy new versions of those applications. Furthermore they are benefitting from increased security just by using containers as opposed to running applications outside containers. This book starts from scratch, introducing you to Docker fundamentals and setting up an environment to work with it. Then we delve into concepts such as Docker containers, Docker images, Docker Compose, and so on. We will also cover the concepts of deployment, orchestration, networking, and security. Furthermore, we explain Docker functionalities on public clouds such as AWS. By the end of this book, you will have hands-on experience working with Docker containers and orchestrators such as SwarmKit and Kubernetes.
Table of Contents (21 chapters)
Title Page
Packt Upsell
Contributors
Preface
Index

Chapter 6


  1. In a system consisting of many parts, failure of at least one part is only a matter of time. To avoid any downtime if such a situation occurs, one runs multiple instances of each component. If one of the instances fails, there are still others to serve the requests.
  2. In a distributed application architecture, we have many moving parts. If Service A needs access to an instance of Service B, then it cannot know where to find such an instance. Instances can be on any random node of the cluster and they can even come and go as the orchestration engine sees fit, so we do not identify the target instance by, say, its IP address and port, but rather by its name and port. A DNS service knows how to resolve a service name into an IP address since it has all the information about all service instances running in the cluster.
  1. A circuit breaker is a mechanism that helps to avoid cascading failures in a distributed application triggered by a single failing service. The circuit breaker observes a request from one service to another and measures the latency over time and the number of request failures or timeouts. If a certain target instance causes too many failures, the calls to it are intercepted and an error code is returned to the caller, instantly giving the target time to recover if possible, and the caller, in turn, knows instantly that it either should degrade its own service or try with another instance of the target service.
  2. A monolith is an application that consists of one single code base that is highly coupled. If changes to the code are made, no matter how minimal, the whole application has to be compiled, packaged, and redeployed. A monolith is simple to deploy and monitor in production due to the fact that it has very few moving parts. Monoliths are difficult to maintain and extend. A distributed application consists of many loosely coupled services. Each service originates from its own independent source code base. Individual services can and often have independent life cycles. They can be developed and revised independently. Distributed applications are more difficult to manage and monitor.
  3. One talks about a blue-green deployment when a currently running version of a service, called blue, is replaced by a new release of the same service, called green. The replacement happens without any downtime since while the blue version is still running, the green version of the service is installed on the system and, once ready, a simple change in the configuration of the router that funnels traffic to the service is needed so that the traffic is now all directed to green instead of blue.