chapter one

1 What are microservice web APIs?

 

This chapter covers

  • What microservices are and how this architectural pattern differs from monolith applications
  • What web APIs are and why it makes sense to implement web APIs as microservices
  • What the Python ecosystem can offer to develop microservice APIs more easily
  • The most important challenges of developing and managing microservices

This chapter introduces and defines the most important concepts in this book: microservices and web APIs. Microservices are an architectural style that structures an application as a collection of loosely coupled services, and web APIs are the web interfaces that allow us to interact with those services. We will see the defining features of microservices architecture, and compare them with those of monolithic applications. In contrast with microservices architecture, monolithic applications are structured around a single codebase and deployed in a single build. If you have experience working with traditional web development frameworks such as Django or Flask, you are probably already familiar with the features of a monolithic application. In this chapter, we draw examples from those types of frameworks to illustrate the ideas that we describe.

1.1   What are microservices?

1.1.1   Defining microservices

1.1.2   What is a monolith?

1.1.3   Introducing the CoffeeMesh application

1.1.4   Microservices vs monoliths

1.1.5   Microservices today and how we got there

1.2   What are web APIs?

1.2.1   What is an API?

1.2.2   What is a web API?

1.3   Why does it make sense to deploy web APIs as microservices?

1.4   How Python makes it easier to develop microservice web APIs

1.5   Microservices-specific challenges

1.5.1   Effective service decomposition

1.5.2   Microservices integration tests

1.5.3   Handling service unavailability

1.5.4   Distributed transactions

1.5.5   Increased operational complexity

1.5.6   Infrastructure overhead

1.6   What you will learn in this book

1.7   Summary