liveBook · Manning

Microservice architecture

As explained in BDD in Action, Second Edition

Microservice architecture is an application architecture in which independently deployable services implement separate business capabilities and communicate through defined interfaces.

Microservice architecture separates business capabilities into independently operated services that communicate through APIs or events. It supports acceptance testing without driving the user interface, reducing browser overhead while exercising service behavior directly. section 13.0 section 13.4

A frequent-flyer registration flow illustrates the arrangement: a membership service creates a pending account, requests a token, publishes an event, and lets an email service send confirmation. Authentication and membership services then support login and account access. section 13.4

The registration process crosses service boundaries in this order:

  • POST registration details to the Frequent Flyer endpoint. section 13.4
  • Create a pending membership account and obtain a single-use token from the token service. section 13.4
  • Publish a NewFrequentFlyerEvent through a message broker so the email service can prepare confirmation. section 13.4
  • Confirm the email through a POST endpoint, activate the account, and use authentication and membership endpoints for login and account details. section 13.4

Acceptance scenario

Given Tracy does not have a Frequent Flyer account, when she registers and confirms her email address, then she should have a new Standard tier account with 0 points. section 13.4

Figure 13.3 The Frequent Flyer membership architecture

Use the architecture diagram to trace requests, events, tokens, and responsibilities across the membership, email, authentication, and token services. section 13.4

How BDD in Action, Second Edition covers it

How deep it goes
Traces a multi-service registration flow through endpoints, databases, tokens, events, and a message broker.
Examples
Uses Frequent Flyer registration, email confirmation, authentication, account lookup, and an executable acceptance scenario.
What it assumes
Assumes familiarity with user-interface acceptance tests while extending testing toward APIs and service interactions.
What you can do after
Apply it via RESTAssured and JSONPath to automate acceptance scenarios through APIs rather than the user interface.
How it connects
Connects microservice architecture with REST APIs, event-based architecture, message brokers, and acceptance testing.

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 BDD in Action, Second Edition. The section links point to the parts of the book it draws on.