SYNC
Infrastructure UpdateDec 4, 2025

From WebSockets
to gRPC

How we achieved 70% payload reduction and 3x faster serialization by migrating our microservices to Protocol Buffers and gRPC streaming.

Messages/sec
0
Bandwidth Saved
0.0 GB
0msg/s
Latency
100 ms
CONNECTED
Impact at Scale
0 GB
Daily Bandwidth Saved

Binary protobuf encoding vs JSON text

0 TB
Monthly Savings

Reduced cloud egress costs significantly

0%
CPU Reduction

Faster serialization, less parsing overhead

0x
Faster Encoding

From 130μs to 13μs per message

The New Architecture

Multiple services communicating via high-performance gRPC streams, with WebSocket only at the client boundary.

Data Feed
Box Engine
Signal Engine
Gateway
Client
gRPC (Binary)
WebSocket
Box Engine
Data Processing

Ingests real-time prices, calculates box arrays, streams to all services via gRPC

Signal Engine
Pattern Detection
0000000000000000

Scans millions of fractal paths in real-time, detects patterns, generates signals

Gateway
Client Interface

Receives gRPC streams from internal services, broadcasts to clients via WebSocket

The Transformation

From verbose JSON text to compact binary Protocol Buffers.

Before: JSON/WebSocket
Payload~2.8 KB
Serialize~130 μs
Parse~150 μs
{ "pair": "...", "price": ..., "timestamp": "...", "boxes": [...] }
After: Protobuf/gRPC
Payload~850 B
Serialize~13 μs
Parse~8 μs
Binary encoded • Type-safe • Compact

Performance Gains

Payload Size
2,800 B850 B
-70%
Serialization
130 μs13 μs
10x faster
Internal Latency
~5.1 ms~1.5 ms
-3.6 ms

Daily Impact at Scale

Bandwidth
48.4 GB14.7 GB
-33.7 GB
CPU Time
37.4 min3.7 min
-90%
Allocations
2.6B52M
-98%

The Numbers

Daily Bandwidth (GB)
JSON48.4 GB
Protobuf14.7 GB
Savings-33.7 GB/day
CPU Time Reduction
Before
37m
After
3.7m
-90% CPU overhead

Why gRPC Won

Binary Serialization

Protobuf encodes data in compact binary format. No field names transmitted, just raw, typed data.

HTTP/2 Multiplexing

Single connection handles multiple streams. No head-of-line blocking.

Type Safety

Schema-defined contracts generate typed code across all languages automatically.

Native Streaming

Client-streaming RPCs built into the protocol. No custom implementation needed.

Backpressure

Flow control handles fast producers and slow consumers automatically.

Error Handling

Standardized status codes and rich metadata. No more custom error parsing.

The Numbers Don't Lie

At scale, the savings compound quickly.

MetricDailyMonthlyYearly
Messages Processed17.28M518M6.3B
Bandwidth Saved33.7 GB1.01 TB12.3 TB
CPU Time Saved33.7 min16.8 hrs205 hrs

Built for Scale

The bigger we grow, the more gRPC wins. What started as an optimization became a foundation for handling hundreds of markets in real-time with sub-100ms latency.

Live
All systems running on the new architecture