JSON is easy to read but slow to parse and large to send. For high-scale real-time apps, we use MessagePack.
MessagePack is a binary serialization format. It looks like JSON but is much more compact and much faster to serialize/deserialize. In a SignalR app, switching from JSON to MessagePack can reduce the payload size by **50% or more**, which directly translates to lower latency and higher scalability.
You must enable the MessagePack protocol on BOTH the server and the client. .AddMessagePackProtocol(). Note that browsers can't 'Read' the binary websocket frames as easily in the 'Network' tab, so this makes debugging a bit harder, but the performance gains are worth it for production.
Q: "When is MessagePack required?"
Architect Answer: "Required for mobile clients with limited bandwidth, or highly interactive dashboards that receive hundreds of updates per second. If you're building a simple chat app, JSON is fine. If you're building a real-time trading engine or a multiplayer game, **MessagePack is essential**."