Serverless microservices

Serverless, Microservices & Function Design
Lesson 2 · Architecture, continued

Serverless, Microservices & Function Design

Where cloud-native design actually runs: on-demand server functionality, small independent services that find each other dynamically, and functions that fire, run, and disappear.

2.3

Serverless Environments

Serverless doesn't mean there are no servers — it means your team isn't the one managing them. Your cloud provider offers server functionality as a subscription service (Function as a Service), starting it on demand and scaling it as needed.

idle — 0 active instances
Instances scale with demand, then wind back down to zero
No workload, no running instance, no cost. Hardware, OS, and maintenance stay abstracted away from the development team entirely.
2.3 continued

Microservices

Instead of one large monolithic program, cloud applications link together small independent components — microservices — each providing a single function. They're not coded ahead of time with each other's location, which keeps them loosely coupled. This loosely coupled architecture is the underlying structure of cloud-native development.

01
Small size
02
Independent
03
Single function
04
Self-contained
05
Scalable
↗ Easier scalability
⚡ Quicker build times
✓ Easier service improvement
2.4

Service Discovery

If microservices scale dynamically, one can never be hard-coded with another's location — that would couple them, breaking the loosely coupled design. Instead, providers register their functionality in a service registry; consumers query that registry to find providers. Run the diagram below to see the exchange.

CONSUMERMicroservice-A
PROVIDERMicroservice-B
REGISTRYService Registry
Waiting to run — Microservice-A doesn't know where Microservice-B is yet.
2.5

Function Design Patterns

A function is a single programmatic capability, triggered by an event, holding no data of its own — started and destroyed on demand. Microservices usually rely on several functions working together, most often in one of two patterns.

Function chain — multiple functions execute serially, each one's output feeding the next, one after another.
§ 2.3–2.5 · Serverless, Microservices & Function Design