Ceded reinsurance is a consumer of everything else. A cession is triggered by a policy transaction (a bind, an endorsement, an audit adjustment) or by a claim transaction (a reserve movement, a payment, a voided payment). If the reinsurance system misses one of those events, nothing visibly breaks: the policy is still bound, the check still clears. The gap shows up weeks later, when the bordereau doesn't reconcile with the ledger and someone has to find out why.
This article explains the integration pattern we use so that doesn't happen, and the two rules that come with it.
Why "call the reinsurance system when the payment happens" fails
The obvious design is for the claims system to POST to the reinsurance system at the moment it issues a payment. It works in testing. In production it loses events, and it loses them silently: whenever the reinsurance service is being redeployed, is slow, or returns an error after the payment has committed, the payment exists and the event doesn't. Retrying in the request makes it worse: now a timeout can mean the event arrived twice.
The transactional outbox
The fix is to make the event part of the business change:
- Write the event in the same database transaction as the money. When the claims system commits a payment, it also inserts a row into its outbox table: the event type, the payload and a unique
event_id. If the payment commits, the event exists. If it rolls back, neither does. - Publish separately, and retry. A publisher reads unsent outbox rows and delivers them to the reinsurance intake, retrying until each is acknowledged. A redeploy only delays events; it can't lose them.
- Consume idempotently. The intake records every
event_idit has processed and ignores repeats, so "at least once" delivery never becomes "twice" in the cession ledger.
Underwriting publishes policy.bound, policy.endorsed and policy.audited; claims publishes
claim.reserve_movement, claim.payment_issued and claim.payment_voided. Each event carries what the
reinsurance side needs to apply its treaties: the policy or claim, the amounts, the effective dates and the line of business.
Rule 1: reinsurance never writes back
The reinsurance system owns treaties, layers, cessions and recoverables. It does not update premiums or reserves in the underwriting or claims systems. Net figures (gross less ceded) are derived on the reinsurance side and published as a read that the other systems can display. The moment two systems both store "net", they disagree, and nobody can say which is right.
Rule 2: derive, don't store, anything that is a consequence
How much of a layer has been eroded, and how many reinstatements have been used, are consequences of the cessions. Store them as their own counters and they drift: a retried event, a voided payment or a manual correction leaves the counter wrong while the ledger is right. We compute them from the cession ledger instead, which makes impossible states unrepresentable: a layer can't show more erosion than its limit, or more reinstatements used than the contract provides.
One catastrophe loss through the tower
Bayridge's property treaty has a $5M retention, a first layer of $15M excess of $5M and a second layer of $20M excess of $20M. A windstorm produces $31.2M of ground-up loss across many claims. Each claim payment commits with its outbox event; the reinsurance intake allocates the event's losses to the treaty year and applies the tower.
Result: $5.0M retained, $15.0M ceded to layer 1 (exhausting it), $11.2M ceded to layer 2. Layer 1's erosion and reinstatement use are read off the ledger, not kept as separate counters. If a second event arrives after layer 1 is exhausted and its reinstatements are used up, the intake retains the amount and records why, rather than absorbing it silently.
All names and figures are fictional.
Designing the events
- Two times on every event: when the business change took effect (the payment date, the endorsement's effective date) and when it was recorded. Treaties attach by effective or loss date; reconciliation runs by recorded date.
- Amounts as exact decimals, with the currency, never as floating-point numbers.
- Enough to apply treaties without calling back: line of business, policy period, loss date and the identifiers of the policy and claim.
- Corrections as new events, never edits. A voided payment is a
claim.payment_voidedevent that reverses the cession; the original event stays in the history.
Ordering
Events for the same claim or policy must be applied in the order they happened: a void cannot be applied before the payment it voids. The publisher should deliver events for the same policy or claim in the order they were recorded (a sequence number per policy or claim, not a timestamp or the outbox row id), and the intake should check that it has seen the event a correction refers to. An event that arrives out of order is parked and retried, not applied.
Operating it
- Alert on the age of the oldest unsent outbox row, not only on publisher errors. A stuck publisher is quiet.
- Keep processed event ids for longer than any plausible redelivery window, so a late retry is still recognised as a repeat.
- Reconcile regularly: totals of events published by each source against totals applied by reinsurance, for each period.
What it costs, and what it saves
The outbox adds a table, a publisher and an idempotency check. In exchange, every ceded figure can be traced to the business transaction that caused it, reconciliation becomes a query instead of an investigation, and the reinsurance system can be redeployed at any time without anyone checking whether a payment was in flight.
For the data platform those events feed, see building a modern lakehouse for P&C insurance.
Questions we are often asked
Why not publish straight to a message broker?
Writing to the database and then to a broker is two writes with no shared transaction, the same gap as calling the reinsurance system directly. The outbox can still deliver through a broker: the publisher, or a change-data-capture connector reading the outbox table, sends the rows on.
Doesn't the reinsurance system need to show net figures straight away?
Net figures follow the events by the publisher's delay, which is usually short. If a screen needs them, it reads them from the reinsurance side, where they are derived, rather than keeping its own copy.