liveBook · Manning

Microservice architecture

As explained in gRPC Microservices in Go

Microservice architecture is an architectural style that structures an application as loosely coupled, independently deployable, and independently scalable services.

Microservice architecture structures an application as loosely coupled services organized around business capabilities. Each service can be deployed and scaled independently and assigned to a team for code ownership. This is a form of feature-based, or Y-axis, scaling: instead of copying the whole application, you split it by function. section 2.3 section 2.2.3

Start with the business model, not a target number of services. A monolith is often the simpler starting point because it helps reveal business capabilities. Reassess decomposition when scaling problems, slower development, or longer release cycles make independent services valuable. Smaller releases and independent scaling are potential gains, not reasons to split every application. section 2.3 section 2.6

E-commerce service boundaries

An e-commerce application can separate product, cart, checkout, payment, and shipping capabilities. Checkout needs cart items, a shipping address, and a payment charge. With gRPC, it calls those services through generated client stubs added as Go dependencies. These boundaries support separate ownership, but a former in-process function call is now a network call that needs fault-tolerant handling. section 1.4.1 section 1.1

Figure 1.1 Architecture diagram of an e-commerce product built with Go microservices on top of Kubernetes, including CI/CD flow and observability

The architecture diagram places the e-commerce services in a Kubernetes environment alongside CI/CD and observability, showing the deployment context around the service boundaries. section 1.4

Service independence adds distributed-system work. Interservice communication must remain reliable, and data consistency needs deliberate handling; synchronous request/response and asynchronous messaging are available patterns. gRPC provides generated stubs and communication features, while saga patterns address consistency. Choose these mechanisms for the boundaries and failure modes you actually have. section 1.4.1 section 2.3 section 2.6

How gRPC Microservices in Go covers it

How deep it goes
Defines service characteristics and selection criteria, then sketches communication and consistency challenges without detailing their implementation here.
Examples
Uses product, cart, checkout, payment, and shipping services, including checkout calls through generated gRPC stubs.
What it assumes
Introduces Go, microservices, and gRPC for newcomers, but assumes familiarity with the business model when choosing service boundaries.
What you can do after
Evaluate/understand it: assess whether business boundaries and scaling or release problems justify decomposition, then identify interservice calls needing fault tolerance.
How it connects
Connects Y-axis scaling, monolithic architecture, gRPC, service discovery, and saga patterns to service decomposition.

Also explained in

Compare how 14 books explain microservice architecture →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of gRPC Microservices in Go. The section links point to the parts of the book it draws on.