Welcome to the Huddle01 SDK v2 Launch Blog! In this blog post, we will introduce the new features and improvements that come with the latest version of our SDK. From infrastructure enhancements to multi-region cascading and improved client functionality, we have worked to make the Huddle01 SDK v2 more reliable, scalable, and developer-friendly. Keep reading to learn how these advancements can empower you to build innovative real-time audio/video communication applications.

Here are the main improvements the Huddle01 SDK v2 provides:

Infrastructure Improvements

Transition to uWebSockets for Improved Performance and Reliability

Previously, when using socket.io, we encountered noticeable lag and delays in WebSocket connection creation timings. The library struggled with reconnections and managing the states of the WebSocket connections. It often flushed the metadata during reconnection, especially on poor network performance. Although socket.io automatically switched to HTTP long polling in such cases, it never upgraded the connection back to WebSocket, resulting in increased latency and server load (as long polling is resource-intensive). We had limited control over reconnections, downgrades, and state management, which led us to explore other low-level WebSocket servers that allowed us to have full control over the entire lifecycle of the WebSocket.

UWebsockets can handle at least 10 times the load of Socket.io.

We decided to transition from socket.io to uWebSocket, a performant C++ web server that is highly regarded for its scalability, even by platforms like Discord. With uWebSocket and our in-house reconnection algorithm, we now have smooth transitions across networks. This has significantly improved our user experience, as reconnections have been flawless, and in the event of failures, uWebSocket provides access to connection metadata to aid in recovery.

Now, the WebSocket connections are so robust that the session remains consistent even if the WebSocket server crashes, as it can easily reconnect using the stored connection metadata.

Global Region Aware Distribution with Zero Downtime Upgrades

The RTC Infrastructure has undergone significant changes to enhance its global distribution and scalability. It is now deployed across multiple geographical regions, ensuring optimal connectivity and performance for rooms.

We have also implemented mechanisms for Zero Downtime Upgrades to the infrastructure. This allows for new performance and security updates to be pushed to the infrastructure without ever affecting the user's experience.

Untitled

This new architecture allows for seamless auto-scaling based on load, efficient handling of failures and recovery, and enables zero-downtime deployments. Additionally, we have implemented fast messaging capabilities using Protocol Buffers over gRPC, enabling efficient communication within the system.

Multi Region Cascading

Previously, Rooms were restricted to a single mediaserver, with the location of the mediaserver determined by the location of the first peer to join the meeting. This approach worked effectively when participants from the same region were present.

Untitled

However, it presented challenges when peers from distant geographical locations joined. In such instances, they would experience increased latencies and bandwidth consumption, which could adversely affect the quality of the meeting. To resolve this issue, a new solution was implemented.