Breaking the Speed Limit: How Mezon-Proto & Raw QUIC are Redefining Our Architecture
🚀 𝐁𝐑𝐄𝐀𝐊𝐈𝐍𝐆 𝐓𝐇𝐄 𝐒𝐏𝐄𝐄𝐃 𝐋𝐈𝐌𝐈𝐓: 𝐇𝐎𝐖 𝐌𝐄𝐙𝐎𝐍-𝐏𝐑𝐎𝐓𝐎 & 𝐑𝐀𝐖 𝐐𝐔𝐈𝐂 𝐀𝐑𝐄 𝐑𝐄𝐃𝐄𝐅𝐈𝐍𝐈𝐍𝐆 𝐎𝐔𝐑 𝐀𝐑𝐂𝐇𝐈𝐓𝐄𝐂𝐓𝐔𝐑𝐄🚀
At Mezon, we’ve always been obsessed with performance. For a long time, our stack (Nginx + Unix Sockets + Golang (fasthttp)) - served us well. But as our traffic scaled and latency requirements tightened, we realized that even the most optimized HTTP/1.1 or H2 stacks carry a "protocol tax" we were no longer willing to pay.
Today, we are excited to share a major architectural shift: the move to Mezon-Proto powered by Raw QUIC.
By stripping away legacy layers and moving toward a custom transport implementation, we’ve effectively decoupled our high-speed "Data Plane" from our complex "Control Plane."
⚡𝐓𝐡𝐞 𝐏𝐫𝐨𝐛𝐥𝐞𝐦: 𝐓𝐡𝐞 "𝐇𝐓𝐓𝐏 𝐓𝐚𝐱"
Even with fasthttp in Go, standard web traffic requires significant CPU cycles for:
- Header Parsing: Validating and processing bulky HTTP headers.
- Context Switching: Moving data between Nginx and our Go backend.
- TCP Overhead: Dealing with head-of-line blocking and multi-step handshakes.
We needed a way to serve the majority of our requests (the "Hot Path") with near-zero processing overhead.
⚡𝐓𝐡𝐞 𝐒𝐨𝐥𝐮𝐭𝐢𝐨𝐧: 𝐀 𝐃𝐮𝐚𝐥-𝐏𝐚𝐭𝐡 𝐀𝐫𝐜𝐡𝐢𝐭𝐞𝐜𝐭𝐮𝐫𝐞
Our new architecture splits traffic into two lanes: the Hot Path for lightning-fast data retrieval and the Cold Path for complex business logic.
1️⃣𝐓𝐡𝐞 𝐇𝐨𝐭 𝐏𝐚𝐭𝐡: 𝐌𝐞𝐳𝐨𝐧-𝐏𝐫𝐨𝐭𝐨 𝐨𝐯𝐞𝐫 𝐑𝐚𝐰 𝐐𝐔𝐈𝐂
For data-heavy requests, the mezon-proto-client talks directly to our new Mezon-Quic Server (written in C).
Zero HTTP Parsing: We use a lightweight, binary protocol.
Tiered Caching: The server checks an L1 Local Cache first. If it misses, it queries Valkey (L2), populates L1, and streams raw bytes back to the client.
The Result: The CPU spends its time moving bytes, not parsing strings.
2️⃣ 𝐓𝐡𝐞 𝐂𝐨𝐥𝐝 𝐏𝐚𝐭𝐡: 𝐋𝐞𝐚𝐧 𝐈𝐏𝐂
When a request requires complex logic, it hits our Mezon-API (Golang) via a Unix Domain Socket.
Goodbye fasthttp: Since we are no longer serving public HTTP traffic directly from Go, we’ve removed fasthttp.
Raw Sockets: The Go backend now receives pre-parsed protocol data through the Unix socket, reducing memory allocations and GC pressure significantly.
⚡𝐖𝐡𝐲 𝐓𝐡𝐢𝐬 𝐌𝐚𝐭𝐭𝐞𝐫𝐬
By moving the "Hot Path" to a C-based QUIC implementation and using Unix sockets for internal communication, we’ve achieved:
- Drastically lower latency: bypassing Nginx and TCP saves milliseconds per request
- Improved memory efficiency: eliminating HTTP parsing reduces footprint and nearly removes GC pauses
- Simplified backend development: engineers can focus on business logic, not infrastructure tuning
------------------------------------------------
MEZON - YOUR CLAN, YOUR WORLD!
A product proudly developed by the engineers at NCCPLUS.
🌐 Website: https://mezon.ai/
📧 Email: hello@mezon.vn
📞 Hotline: 024.6687.4606
📲 Available on App Store & Google Play