Page111
Microservices, Containers, and Serverless
The cloud computing revolution has continued to develop and evolve new technologies, including microservices, cloud, and serverless. One of the goals of these technologies is to lower the cost of computing. We originally had computers running on native hardware. Then virtualization allowed multiple operating systems to run on one hypervisor. Cloud brought scale to virtualization. Costs were lowered at every step. That process continued with microservices, containers, and serverless, as we will discuss next.
Microservices
Imagine a company that sold toys online 20 years ago. Usage was (comparatively) low for most of the year but ramped up during sales and the Christmas season. The company required 100 servers for day-to-day operations. During peak (Christmas shopping season) usage would swell, and the company would need 1000 servers to meet demand.
Building that directly on hardware (pre-virtualization) would have been expensive: 900 servers would sit idle for most of the year. Virtualization improved things, but the company would still need a hypervisor capable of running 1000 virtual machines. Cloud provided a real breakthrough; the toy company could utilize Amazon AWS, Microsoft Azure, Google Compute (and many other cloud providers) to provision virtual systems on demand and shut them down after the rush was over.
Microservices allow additional opportunities to scale, while lowering costs. Servers were historically monolithic: one server provided an array of services. Using the toy company example above, each server may have provided a range of services: authentication, inventory, search, shopping carts, credit card validation, shipping, etc. Microservices breaks those services out via APIs (Application Programming Interfaces), and uses technologies such as containers and serverless to provide the required functionality. Amazon describes Microservices:
With monolithic architectures, all processes are tightly coupled and run as a single service. This means that if one process of the application experiences a spike in demand, the entire architecture must be scaled. Adding or improving a monolithic application's features becomes more complex as the code base grows. This complexity limits experimentation and makes it difficult to implement new ideas. Monolithic architectures add risk for application availability because many independent and tightly coupled processes increase the impact of a single process failure.
With a microservices architecture, an application is built as independent components that run each application process as a service. These services communicate via a well-defined interface using lightweight APIs. Services are built for business capabilities and each service performs a single function. Because they are independently run, each service can be updated, deployed, and scaled to meet demand for specific functions of an application [18].