Payments Academy
Modern payment engines 1 Modern payment engines NOW 2 Service has 3 Down when event published 4 Failure in a microservices engine 5 Contract test verifies that a service 6 Database Most modern payment engines are built as microservices: small, independently deployable services, each owning one capability and its own data. Step 1 of 6 Modern payment engines 1 NOW Modern payment engines 2 Service has 3 Down when event published 4 Failure in a microservices engine 5 Contract test verifies that a service 6 Database Most modern payment engines are built as microservices: small, independently deployable services, each owning one capability and its own data. Step 1 of 6
Service has a clear contract 1 Modern payment engines 2 Service has NOW 3 Down when event published 4 Failure in a microservices engine 5 Contract test verifies that a service 6 Database Each service has a clear contract: it receives a defined input, produces a defined output, and owns its own data. Step 2 of 6 Service has a clear contract 1 Modern payment engines 2 NOW Service has 3 Down when event published 4 Failure in a microservices engine 5 Contract test verifies that a service 6 Database Each service has a clear contract: it receives a defined input, produces a defined output, and owns its own data. Step 2 of 6
Service: down when event published 1 Modern payment engines 2 Service has 3 Down when event published NOW 4 Failure in a microservices engine 5 Contract test verifies that a service 6 Database If a service is down when the event is published, it catches up by replaying the event log when it recovers. Step 3 of 6 Service: down when event published 1 Modern payment engines 2 Service has 3 NOW Down when event published 4 Failure in a microservices engine 5 Contract test verifies that a service 6 Database If a service is down when the event is published, it catches up by replaying the event log when it recovers. Step 3 of 6
Failure in a microservices engine 1 Modern payment engines 2 Service has 3 Down when event published 4 Failure in a microservices engine NOW 5 Contract test verifies that a service 6 Database Failure in a microservices engine is partial by nature. Step 4 of 6 Failure in a microservices engine 1 Modern payment engines 2 Service has 3 Down when event published 4 NOW Failure in a microservices engine 5 Contract test verifies that a service 6 Database Failure in a microservices engine is partial by nature. Step 4 of 6
Contract test verifies that a service honours 1 Modern payment engines 2 Service has 3 Down when event published 4 Failure in a microservices engine 5 Contract test verifies that a service NOW 6 Database A contract test verifies that a service honours the contract it publishes: that the validation service returns the fields the routing service expects Step 5 of 6 Contract test verifies that a service honours 1 Modern payment engines 2 Service has 3 Down when event published 4 Failure in a microservices engine 5 NOW Contract test verifies that a service 6 Database A contract test verifies that a service honours the contract it publishes: that the validation service returns the fields the routing service expects Step 5 of 6
Database: complete 1 Modern payment engines 2 Service has 3 Down when event published 4 Failure in a microservices engine 5 Contract test verifies that a service 6 Database NOW A database change must be backwards compatible too: the new version must be able to read data written by the old version Step 6 of 6 Database: complete 1 Modern payment engines 2 Service has 3 Down when event published 4 Failure in a microservices engine 5 Contract test verifies that a service 6 NOW Database A database change must be backwards compatible too: the new version must be able to read data written by the old version Step 6 of 6

Flow of the explanation in this lesson.

0:00 / 6:31 Step 1 of 6

Microservices for payments: service boundaries and data ownership

Payment engine internals and observability, Lesson 6 of 7, Narration 6:31, D09 Payment architecture and technology

SettlementClearingQueue

What you will learn

Your objective. By the end of this lesson, you will be able to explain microservices for payments: service boundaries and data ownership and apply it to a real banking scenario.

Why it matters. For a business analyst, the requirement is to define, for each service, what data it owns, what events it publishes, what events it consumes, and what happens when an event is delivered twice or out of order.

Chapter objective: What is inside a payment engine, and how operations sees what it is doing

Key learning points

  • Modern payment engines
  • Service contracts
  • Event replay after downtime
  • Failure in a microservices engine
  • Contract testing
  • Backwards compatible database changes

Key terms

Settlement: The final movement of funds between banks to discharge obligations created by cleared payments. Settlement is usually made in central bank money or through correspondent accounts.

Clearing: The process of exchanging payment instructions between banks and calculating what each bank owes the others.

Queue: A holding area in a payment system where payments wait for sufficient funds or for their turn to settle.

Payment flow diagram showing Microservices for payments: service boundaries and data ownership.

Insights and practice scenarios

Worked insights and practice scenarios for this lesson. Each one is a reusable PaymentForge case, so the same case may appear in more than one lesson.

Practise this lesson

Exercise

Apply the concept in this lesson to a real banking scenario.

Use the definition, the example and the key points in this lesson.

  1. What to do. Explain the concept in your own words, give a banking example with an amount, and state what goes wrong if it is misunderstood.

Correct result. A correct answer names the concept accurately, uses a realistic banking example with a concrete amount, and identifies the consequence of getting it wrong.

Why. Understanding is not memorising a definition. It is being able to explain it, apply it, and spot the failure it prevents.

Check your understanding

Practice question

Which of the following best describes microservices for payments: service boundaries and data ownership?

Takeaway and next step

What to remember

For a business analyst, the requirement is to define, for each service, what data it owns, what events it publishes, what events it consumes, and what happens when an event is delivered twice or out of order.

Follow a payment through every stage, from instruction to beneficiary credit, and note where it can stop.

Open the Payment Lifecycle Simulator →

Builds on "Observability: metrics, logs, traces and alerting for payments".

Transcript and full text

Show transcript

Most modern payment engines are built as microservices: small, independently deployable services, each owning one capability and its own data. The alternative is a monolith, one large application that does everything, which is simpler to build but harder to change, because a change to one payment type requires testing and deploying the whole system. Microservices let a bank change the instant payments engine without touching the high value engine, and let different teams own different services. But microservices introduce their own problems, and a payments SME must understand them, because the architecture shapes how payments fail and how they are fixed. Source: microservices architecture patterns; bank payment platform modernisation case studies. Service boundaries follow the payment lifecycle. A typical decomposition is: an intake service that accepts instructions, a validation service that checks them, an enrichment service that resolves reference data, a routing service that picks the clearing system, a screening service that runs sanctions and fraud checks, a processing service that debits and sends, a settlement service that confirms clearing, and a posting service that writes ledger entries. Each service has a clear contract: it receives a defined input, produces a defined output, and owns its own data. The validation service owns the validation rules; the routing service owns the routing table; the posting service owns the ledger entries. No service reaches directly into another service's database, because that would couple them together and defeat the purpose of the split. For a business analyst, the requirement is to define this behaviour explicitly, because the engine does what the requirement says and nothing more. Data ownership is the hardest part of microservices for payments. In a monolith, the payment, the account balance, the routing table and the ledger all live in one database, so a transaction can update them all atomically. In microservices, each service has its own database, so there is no single transaction that spans services. The payment service records the payment, the account service records the balance, and the ledger service records the entries, and the three must agree. They agree through events: when the payment service debits an account, it publishes an event, and the account service and the ledger service consume that event and update their own data. If a service is down when the event is published, it catches up by replaying the event log when it recovers. This is eventual consistency: the three views agree eventually, but not necessarily at the same instant, and the engine must be designed so that a brief inconsistency cannot cause a duplicate payment or a lost payment. The payment record itself needs a single source of truth. In a microservices engine, that is usually the payment service, which owns the payment state machine and the payment identifier. Other services read the payment state through an API or through events, but they do not change it directly. If the screening service wants to hold a payment, it sends a hold instruction to the payment service, which records the hold and changes the state. This prevents two services from changing the same payment at the same time and disagreeing about its state. For a business analyst, the requirement is to define, for each service, what data it owns, what events it publishes, what events it consumes, and what happens when an event is delivered twice or out of order. Failure in a microservices engine is partial by nature. One service can be down while the others keep working, and the engine must degrade gracefully rather than failing completely. If the enrichment service is down, the engine queues payments that need enrichment and continues processing payments that are already enriched. If the screening service is slow, the engine holds payments in a queue rather than skipping the screening check. Circuit breakers stop the engine from calling a service that is failing repeatedly, and bulkheads isolate failures so that a problem in the instant payments engine cannot affect the high value engine. A payment that is stuck because a service is down must be visible in the operations dashboard, with its state and the reason, so the team knows it is waiting and not lost. The operations team must be able to see this state on a dashboard, because a payment that cannot be seen cannot be managed. Testing a microservices engine is harder than testing a monolith, because a test must cover the interactions between services, not just each service in isolation. A contract test verifies that a service honours the contract it publishes: that the validation service returns the fields the routing service expects, and that the routing service sends the routing decision in the format the processing service understands. An end to end test sends a real payment through all the services and verifies that it completes, that the ledger balances, and that the audit trail is complete. A chaos test deliberately stops one service and verifies that the engine degrades gracefully rather than failing completely. A test pack that has only unit tests will pass while the engine fails in production, because the failures happen at the boundaries between services, not inside them. Deployment of microservices for payments has its own rules. A new version of a service must be deployed without stopping payments, which means running the old and new versions side by side until the new version is proven, then shifting traffic gradually. This is a blue green or canary deployment, and it requires the service to be backwards compatible with the events and APIs the other services use. A database change must be backwards compatible too: the new version must be able to read data written by the old version, and the old version must be able to read data written by the new version, until the migration is complete. A deployment that requires all services to stop at the same time is not a microservices deployment; it is a monolith deployment with extra steps. For a business analyst, the requirement is to define the deployment strategy, the rollback procedure, and the compatibility rules for events and APIs. Further reading: microservices architecture patterns; Building Microservices, Sam Newman. Last reviewed 7 November 2026.

Most modern payment engines are built as microservices: small, independently deployable services, each owning one capability and its own data. The alternative is a monolith, one large application that does everything, which is simpler to build but harder to change, because a change to one payment type requires testing and deploying the whole system. Microservices let a bank change the instant payments engine without touching the high value engine, and let different teams own different services. But microservices introduce their own problems, and a payments SME must understand them, because the architecture shapes how payments fail and how they are fixed. Source: microservices architecture patterns; bank payment platform modernisation case studies.

Service boundaries follow the payment lifecycle. A typical decomposition is: an intake service that accepts instructions, a validation service that checks them, an enrichment service that resolves reference data, a routing service that picks the clearing system, a screening service that runs sanctions and fraud checks, a processing service that debits and sends, a settlement service that confirms clearing, and a posting service that writes ledger entries.

Each service has a clear contract: it receives a defined input, produces a defined output, and owns its own data. The validation service owns the validation rules; the routing service owns the routing table; the posting service owns the ledger entries. No service reaches directly into another service's database, because that would couple them together and defeat the purpose of the split. For a business analyst, the requirement is to define this behaviour explicitly, because the engine does what the requirement says and nothing more.

Data ownership is the hardest part of microservices for payments. In a monolith, the payment, the account balance, the routing table and the ledger all live in one database, so a transaction can update them all atomically. In microservices, each service has its own database, so there is no single transaction that spans services. The payment service records the payment, the account service records the balance, and the ledger service records the entries, and the three must agree.

They agree through events: when the payment service debits an account, it publishes an event, and the account service and the ledger service consume that event and update their own data. If a service is down when the event is published, it catches up by replaying the event log when it recovers. This is eventual consistency: the three views agree eventually, but not necessarily at the same instant, and the engine must be designed so that a brief inconsistency cannot cause a duplicate payment or a lost payment.

The payment record itself needs a single source of truth. In a microservices engine, that is usually the payment service, which owns the payment state machine and the payment identifier. Other services read the payment state through an API or through events, but they do not change it directly. If the screening service wants to hold a payment, it sends a hold instruction to the payment service, which records the hold and changes the state. This prevents two services from changing the same payment at the same time and disagreeing about its state. For a business analyst, the requirement is to define, for each service, what data it owns, what events it publishes, what events it consumes, and what happens when an event is delivered twice or out of order.

Failure in a microservices engine is partial by nature. One service can be down while the others keep working, and the engine must degrade gracefully rather than failing completely. If the enrichment service is down, the engine queues payments that need enrichment and continues processing payments that are already enriched. If the screening service is slow, the engine holds payments in a queue rather than skipping the screening check.

Circuit breakers stop the engine from calling a service that is failing repeatedly, and bulkheads isolate failures so that a problem in the instant payments engine cannot affect the high value engine. A payment that is stuck because a service is down must be visible in the operations dashboard, with its state and the reason, so the team knows it is waiting and not lost. The operations team must be able to see this state on a dashboard, because a payment that cannot be seen cannot be managed.

Testing a microservices engine is harder than testing a monolith, because a test must cover the interactions between services, not just each service in isolation. A contract test verifies that a service honours the contract it publishes: that the validation service returns the fields the routing service expects, and that the routing service sends the routing decision in the format the processing service understands.

An end to end test sends a real payment through all the services and verifies that it completes, that the ledger balances, and that the audit trail is complete. A chaos test deliberately stops one service and verifies that the engine degrades gracefully rather than failing completely. A test pack that has only unit tests will pass while the engine fails in production, because the failures happen at the boundaries between services, not inside them.

Deployment of microservices for payments has its own rules. A new version of a service must be deployed without stopping payments, which means running the old and new versions side by side until the new version is proven, then shifting traffic gradually. This is a blue green or canary deployment, and it requires the service to be backwards compatible with the events and APIs the other services use. A database change must be backwards compatible too: the new version must be able to read data written by the old version, and the old version must be able to read data written by the new version, until the migration is complete.

A deployment that requires all services to stop at the same time is not a microservices deployment; it is a monolith deployment with extra steps. For a business analyst, the requirement is to define the deployment strategy, the rollback procedure, and the compatibility rules for events and APIs. Further reading: microservices architecture patterns; Building Microservices, Sam Newman. Last reviewed 7 November 2026.

Full lesson text (all scenes)

Completing a lesson updates your progress dashboard on the homepage.

Scene timestamps are estimated by allocating the narration text proportionally across the real audio length. The audio playback position is the source of truth: pause freezes the visual, seeking restores the correct scene, replay restarts the scene animation.