Reliably publish events when updating database. Problem: updating DB and publishing message aren't atomic. If publish fails, data inconsistency.
Solution: write event to outbox table in same transaction as business data. Separate process reads outbox and publishes to message broker. Delete from outbox after confirmed publish. Guarantees at-least-once delivery.