A Full Payment Gateway Inside a Database
summary
Boozt builds Kronor, a full payment gateway whose core business logic runs inside PostgreSQL using W3C SCXML statecharts compiled to SQL; state transitions enqueue jobs with a transactional outbox and PG NOTIFY/LISTEN workers perform external calls. Concurrency relies on Postgres serializable transactions to avoid races. Tests use pgtap, CI deploys SQL as code, and Datadog DB APM traces functions. The system handles peaks (later processing ~60% of company transactions) while DB CPU stays low (~6%), showing it scales.
AI-written summary · about
chapters (13)
- 0:00Introduction to the talk
- 1:04Why build a payment gateway
- 3:29Payment journey breakdown
- 7:22Complexity in payment systems
- 10:09State in the database
- 11:57State charts in the database
- 14:26Interpreter for state charts
- 17:15Handling asynchronicity
- 20:10Concurrency and transactions
- 23:24Developer perspective on database logic
- 26:56Observability and performance
- 30:29Scaling and future plans
- 31:16Q&A session
