TribunPass
Sell every seat once, even when everyone clicks at once.
A match-day ticketing backend in Go and PostgreSQL. Groups of tickets are held atomically, paid before a deadline, and never oversold, even across multiple servers.
- Year
- 2026
- Context
- Live product, open source
- Work
- Backend, concurrency tests, organizer dashboard
- Role
- Backend Software Engineer
- Stack
- Go, PostgreSQL, Next.js, REST API, k6, Docker
How it works
A two-ticket checkout
A fan books 2 Reguler tickets at Rp75,000 each. Stock drops from 10 to 8, and the fan has 5 minutes to pay Rp150,000. Paying issues two tickets, each with its own QR code.
Reserving a group atomically
The Go handler accepts the whole group or declines it. A conditional PostgreSQL update protects the stock, and one transaction records the stock change, the hold, the unit price and the response under an idempotency key. A retry on another instance returns the same reservation.
Payment at the deadline
The signed payment callback and the expiry worker lock the same hold before reading the database clock. An on-time payment issues one ticket per place. Expiry returns the group exactly once. A unique constraint on order ID and ticket number stops duplicates.
How the organizer counts sales
Counts come from one PostgreSQL snapshot, and only confirmed orders count. A capacity change is rejected if the new limit is below what is held plus sold.
What the concurrency tests prove
Four simultaneous requests for 4 tickets each against 10 places: two groups got 8 tickets and 2 remained. Replaying a payment for 3 tickets on two servers gave one paid order, 3 ticket IDs and Rp225,000 revenue.
By the numbers
- 8 / 2sold / left, 4 x 4 requests vs 10 places
- 5 minhold before the group is released
- 1paid order after a two-server payment replay






























