12 Creating applications over microservices

 

This chapter covers

  • Building an end user application on top of a microservice system
  • Understanding the composite application, API Gateway, and backend for frontend design patterns
  • Using server-side and client-side rendering in web applications

So far, we’ve concentrated on implementing business capabilities in microservices and exposing those capabilities through HTTP APIs. But end users don’t use HTTP APIs—they use web apps, mobile apps, desktop applications, smart TVs, VR headsets, and other applications on devices with interfaces geared toward humans. To give end users access to all the capabilities of microservices, we need to implement applications on top of microservices. This chapter is about doing that: we’ll move from looking at designing single microservices to bringing all the microservices together in an architecture that supports building applications for end users.

We’ll start with a broad, nontechnical discussion of how to approach building applications on top of a microservice system. Then we’ll go into three specific architectural patterns for implementing applications: the composite application, the API Gateway, and the backend for frontend patterns.

12.1 End user applications for microservice systems: One or many applications?

12.1.1 General-purpose applications

12.1.2 Specialized applications

12.2 Patterns for building applications over microservices

12.2.1 Composite applications: Integrating at the frontend

12.2.2 API Gateway

12.2.3 Backend for frontend (BFF) pattern

12.2.4 When to use each pattern

12.2.5 Client-side or server-side rendering?

12.3 Example: A shopping cart and a product list

12.3.1 Creating an API Gateway

12.3.2 Creating the product list GUI

12.3.3 Creating the shopping cart GUI

12.3.4 Letting users add products to the shopping cart

12.3.5 Letting users remove products from the shopping cart

Summary