Engineering
How We Built a Sub-2-Second Approval System
Deep dive into the architecture that powers RCCP's low-latency approval workflow.
January 5, 2025
10 min read
The Challenge
When Claude Code needs approval, every second counts. A slow approval system means wasted development time. We set an ambitious target: P95 latency under 2 seconds.
Architecture Overview
WebSocket-First Design
We chose WebSockets over HTTP polling for real-time communication:
The Outbox Pattern
To ensure exactly-once delivery, we implemented the outbox pattern:
Event-Driven Backend
Our Fastify backend processes events asynchronously:
Performance Optimizations
Connection Pooling
Edge Caching
Efficient Serialization
Results
After optimization:
Lessons Learned
What's Next
We're working on:
Stay tuned for more engineering deep dives!