🏗️Sequence Diagram
Also known as UML Sequence Diagram, Sequence Chart
A diagram of the messages between parts of a system. Read it from top to bottom.
Think of it like
It is like a comic strip of a phone call. Each box shows who spoke, and in what order.
Example
Emma draws the login flow as a sequence diagram. It shows the browser, the app and the login service, and the four messages between them in order.
Why it matters
Bugs between services often hide in the order of the calls. A sequence diagram puts that order on one page.
Definition
Example code
mermaid
sequenceDiagram
Browser->>App: Open page
App-->>Browser: Go to sign in
Browser->>IdP: Sign in
IdP-->>Browser: Signed tokenCommon mistake
Key takeaways
- 1Time runs down. Read it from top to bottom.
- 2Lifelines. One dashed line for each part.
- 3Calls and replies. Solid arrows ask, and dashed arrows answer.