The concept Four ways for systems to talk
How systems communicate shapes reliability, latency, coupling and operational complexity. There are four main patterns, and each fits a different kind of business timing.
In detail Each pattern, its strengths and its costs
| Pattern | Use it when | Advantages | Disadvantages |
|---|---|---|---|
| Synchronous API | The caller needs the result now, such as reading a transaction or updating an exception | Simple request-response; immediate feedback | Depends on downstream availability; timeouts; cascading latency |
| Async messaging | Work can happen independently, such as payment event ingestion | Decouples systems; absorbs spikes; recovers after failures | Duplicates, ordering, replay and eventual consistency to design for |
| Batch | The process is naturally periodic, such as the daily settlement file | Efficient at volume; matches partner schedules | Delayed results; one failed batch affects many records; large files |
| Event streaming | Continuous high volume with several consumers | Many consumers; real-time analytics; replay where retained | Most infrastructure; partitions, lag and schema compatibility to manage |
Side by side How the patterns compare
| Factor | Synchronous API | Async messaging | Batch | Event streaming |
|---|---|---|---|---|
| Immediate response | Yes | No | Usually no | Not inherently |
| Decoupling | Lower | Higher | Higher | Higher |
| Workload spikes | Limited by capacity | Can buffer | Scheduled | Absorbed by retained streams |
| Processing model | Request and response | Message | Group of records | Continuous events |
| Ordering | Application-defined | Depends on setup | File order | By partition and key |
| Operational complexity | Low to medium | Medium | Low to medium | Medium to high |
Apply it One solution, several patterns
Practice Pick the pattern
Practical exercise
Four more workflows
Choose a pattern for each workflow and give one reason.
- A borrower checks their payment status in a mobile app.
- A fraud team wants every payment event as it happens, alongside reconciliation and analytics.
- Finance needs a month-end extract of all adjustments.
- The loan servicing platform is occasionally unavailable for minutes at a time.
Show sample answers
- Payment status: synchronous API; the borrower is waiting for an answer.
- Fraud plus reconciliation plus analytics: event streaming may now be justified, because several consumers need the same continuous events. Confirm the volume first.
- Month-end extract: batch; it is periodic and nobody needs it sooner.
- Servicing sometimes down: accept and record events, then process asynchronously so a short outage does not reject payments.
3 questions
Check your understanding
Answer every question to submit.
What you can do now
- Explain the four communication patterns and their trade-offs.
- Compare them on response, decoupling, spikes, ordering and complexity.
- Combine several patterns in one solution.