The outbox pattern in .NET: reliable events without distributed transactions
Saving a payment and then publishing "PaymentSucceeded" is two writes to two systems. One of them will eventually fail. The outbox pattern turns it into one write, with runnable EF Core code.