Xóm Nông Trại
Server-authoritative social platform with a real economy
The first product I took from a blank repo to live production across every discipline — 10,500+ players in its first month. A social farming game whose hardest problems are financial: every coin is money-like, players act concurrently, and live-ops staff need power without risk.
The constraint
Concurrent players, a currency that must never drift, and operators (human and AI) who need to change prices and issue refunds safely.
Architecture
- Fastify + WebSocket server is the single source of truth; a shared rules package lets the client predict while the server decides.
- Append-only ledger for every gold/xu change, idempotency key on every mutation, transactional outbox for quests, analytics and notifications.
- Versioned config bundles with sha256 checksums — running jobs keep the version they started with.
- Ops MCP: AI agents read through the admin API only and can only file proposals; refunds above a threshold need a second, different approver.
Evidence
- 10,500+players in the first month after launch (Oct 2026)
- 23 msAPI p95 in production at ~4.1M requests a day
- 4,000CCU on 4 shards, one 4-vCPU box shared with Postgres + Redis
- −82%draw calls on a full farm: 2,101 → 375


