Chapter 4. Backing Services
In Chapter 3 we built our first microservice with ASP.NET Core. This service exposed some simple endpoints backed by an in-memory repository to provide consumers with the ability to query and manipulate teams and team membership. While it was enough to get started, it’s far from an example of a production-grade service.
In this chapter we’re going to make our first foray into the world of microservice ecosystems. Services never exist in a vacuum, and most of them need to communicate with other services in order to do their jobs. We call these supporting services backing services, and we’ll explore how to create and consume them by creating a new service and modifying the original team service to communicate with it.
Microservice Ecosystems
As we saw in Chapter 3, it’s pretty easy to fire up a quick set of middleware to host some RESTful resources on an HTTP server. These are just implementation details. The real work lies in designing ecosystems of microservices, where, within a larger community of interconnected services, each service can have its own release cadence, can be deployed on its own, and can scale horizontally on demand.
To achieve this, we need to put a little thought into what we’re doing. While classic “hello world” samples all exist in a vacuum and rely on no other services, we’re rarely going to see a lone service in production (with a few exceptions). This was the driving factor behind the discussion of the concept of API First in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access