Logo_mezon_light.pngmezon

Breaking the Speed Limit: How Mezon-Proto & Raw QUIC are Redefining Our Architecture

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