Layered APIs using Microservices
Mon, Jun 15, 2015
The following reference architecture shows the logical layering of microservices in a typical API based architecture.
Microservices are shown as honeycomb components and have the following characteristics:
- Each performs a single function and is access via light weight REST service APIs
- Each is typically stateless but may maintain a local data store or use a shared data store or cache as required
- Each can scale individually, and can be hosted one per virtual host or co-hosted in docker containers.
Another key component of the reference architecture is the use of an API Gateway for the overlay of security and integration and other infrastructure level requirements. It is typical to create APIs as simply as possible with as few infrastructure overheads as can be allowed. This allows applications to scale easily as the API Gateway or Gateways can be used to overlay security only for client application connections.
The reference architecture defines the following logical layers:
- Client Applications - Client applications use light weight REST services to connect to API services exposed via the API Gateway. The client applications are typically a responsive HTML client or native application.
- Customer/Channel Services - The Customer/Channel Services layer is responsible for housing client and device centric APIs. These are sometime composite services that present a simplified API to the client that orchestrates several calls to supporting business domain services. This promotes scalability in the solution whilst also reducing the client side application complexity. This technique or pattern is typified by the API Gateway services created by Netflix to support the myriad of client applications.
- Business Services - Business services are typically grouped by domain and based on the identified business capabilities. Services may make use of services in other business domains or at the host and re,source layer.
- Host & Resource Services - This layer is typically more focussed on the applications and supporting technology components. They are typically “out of the box” or legacy services that may be used directly or via protocol translation services such as Node JS Express components.
Some further reading - Introduction to Microservices