- Home
- >
- Software Development
- >
- The Challenge of Scaling WebSockets – InApps 2025
The Challenge of Scaling WebSockets – InApps is an article under the topic Software Development Many of you are most interested in today !! Today, let’s InApps.net learn The Challenge of Scaling WebSockets – InApps in today’s post !
Key Summary
This article from InApps Technology, authored by Phu Nguyen and featuring insights from Matthew O’Riordan (CEO and co-founder of Ably), explores the evolution and challenges of scaling WebSockets for real-time web applications. WebSockets, standardized in 2010, enable bidirectional, full-duplex communication, powering use cases like live updates and collaborative tools. However, scaling WebSockets is complex due to persistent connections and state management across servers. The article discusses serverless WebSockets and third-party solutions to simplify scalability and reduce infrastructure management.
- Context:
- WebSocket Evolution: Originating from Tim Berners-Lee’s web foundations (HTML, URI, HTTP), WebSockets were developed by Michael Carter and Ian Hickson in 2008 to overcome limitations of Comet and AJAX, enabling true real-time communication. Standardized via RFC 6455, WebSockets were adopted by major browsers starting with Google Chrome in 2010.
- Author Background: Matthew O’Riordan, a software engineer with over 20 years of experience, co-founded Ably, a platform for real-time digital experiences, after successfully exiting two tech businesses.
- WebSocket Use Cases:
- Real-Time Updates (Unidirectional): Server pushes low-latency updates to clients, e.g., live sports scores, alerts, real-time dashboards, location tracking.
- Bidirectional Communication: Both client and server exchange messages, e.g., chat apps, virtual events/classrooms (with polls, quizzes, Q&A), collaborative editing (e.g., shared documents).
- Scaling Challenges:
- Persistent Connections: WebSockets require continuous server connections, limiting user capacity to hardware capabilities. Modern JavaScript runtimes handle concurrency well, but scaling beyond a few hundred to thousand users requires significant resources.
- Vertical Scaling: Upgrading hardware (e.g., more powerful servers) has limits and is costly.
- HorizontalScaling: Adding more servers is more sustainable but requires state sharing across nodes, as each node only knows its connected clients.
- State Management: State must be stored out-of-process (e.g., using a pub/sub mechanism or backplane) to ensure consistency across nodes, adding complexity.
- Broadcasting Difficulty: Broadcasting updates to all clients is challenging due to distributed nodes, requiring additional infrastructure like direct node connections or external pub/sub systems.
- Solutions:
- Serverless WebSockets:
- Leverage cloud providers (e.g., AWS recently introduced serverless WebSocket support) to dynamically scale capacity without managing servers.
- Benefits: Elastic scaling, reduced infrastructure overhead.
- Challenge: Adoption is slow due to developer familiarity with server-based approaches and limited education on serverless options.
- Third-Party Platforms:
- Companies like Ably provide managed, low-latency, scalable, and fault-tolerant WebSocket infrastructure, allowing developers to focus on frontend functionality.
- Reduces the need to build complex backend systems for real-time communication.
- Considerations for Implementation:
- Evaluate user volume and potential traffic spikes to choose between on-premises or cloud-based solutions.
- Plan for architectural complexity to ensure low-latency, scalable real-time experiences.
- Serverless WebSockets:
- Key Takeaways:
- WebSockets are critical for real-time web applications but pose scaling challenges due to persistent connections and state synchronization.
- Serverless WebSockets and third-party platforms like Ably simplify scaling and reduce management overhead.
- Organizations must balance in-house vs. cloud solutions based on user scale and performance needs to deliver reliable digital experiences.
- InApps Insight:
- InApps Technology, ranked 1st in Vietnam and 5th in Southeast Asia for app and software development, specializes in real-time applications using WebSockets and serverless architectures.
- Leverages React Native, ReactJS, Node.js, Vue.js, Microsoft’s Power Platform, Azure, Power Fx (low-code), Azure Durable Functions, and GraphQL APIs (e.g., Apollo) to build scalable real-time solutions.
- Offers outsourcing services for startups and enterprises, delivering cost-effective real-time apps at 30% of local vendor costs, supported by Vietnam’s 430,000 software developers and 1.03 million ICT professionals.
- Note: InApps is a subsidiary of Insight Partners, an investor in Ably and Real, mentioned in the article.
- Call to Action:
- Contact InApps Technology at www.inapps.net or sales@inapps.net to develop scalable WebSocket-based applications or explore real-time cloud solutions.
Read more about The Challenge of Scaling WebSockets – InApps at Wikipedia
You can find content about The Challenge of Scaling WebSockets – InApps from the Wikipedia website

Matthew O’Riordan
Matthew O’Riordan is the CEO and technical co-founder of Ably, the platform that powers synchronized digital experiences in real time. Matthew has been a software engineer for over 20 years, many of those as a CTO. He first started working on commercial internet projects in the mid-1990s when Internet Explorer 3 and Netscape were still battling it out. Whilst he enjoys coding, the challenges he faces as an entrepreneur starting and scaling businesses is what drives him. Matthew previously started and successfully exited from two tech businesses.
When Tim Berners-Lee outlined the first “web” of hypertext documents so he could more easily get, share and communicate whilst working at CERN in the late 1980s, it’s unlikely even he could have imagined the impact this would have on all our lives. Today we take our online experiences for granted, but it has taken a lot of great ideas and development to get to this point.
Tim Berners-Lee’s initial creations led to the establishment of HTML, URI and HTTP, the three most fundamental building blocks of the internet. As we progressed through the ’90s, HTTP evolved and was standardized, and we saw JavaScript born to embed scripting capabilities into browsers.
Towards the end of the 20th century, we saw AJAX enter the fray, suddenly allowing parts of a web page to be updated without the entire page needing to be refreshed. As we moved into the 21st century, AJAX, alongside HTTP, laid the foundation for the real-time internet, and the development of Comet also brought significant advances, allowing a web server to push data to a browser when updates were available. The challenge was that these technologies made new, “almost” real-time experiences possible but brought with it challenges around scalability, latency and resource requirements — not a sustainable model when the growth of the internet was accelerating.
In 2008, developers Michael Carter and Ian Hickson both experienced the challenge and pain of using Comet to implement something that resembled a real-time solution. As a result, they hatched a plan to introduce a new standard for modern, real-time communication on the web based on bidirectional full-duplex communication between client and server over a single connection.
Added initially to Google Chrome in 2010, and all major browsers shortly after, and standardized by RFC 6455, the “WebSocket Protocol’’ was invented. We entered the era of truly real-time internet.
What Do WebSockets Make Possible?
WebSockets can be used for many different purposes, such as streaming data between backend services such as enterprise applications or supporting multidirectional communications. We can broadly group WebSocket use cases into two distinct categories:
- Real-time updates, where the communication is unidirectional, and the server streams low-latency (and often frequent) updates to the client. For example, live sports updates, alerts, real-time dashboards, or location tracking.
- Bidirectional communication, where both the client and the server send and receive messages. Examples include chat, virtual events and virtual classrooms (the last two usually involve features like polls, quizzes and Q&As). WebSockets can also be used to underpin multiuser synchronized collaboration functionality, such as enabling multiple people to edit the same online document simultaneously.
Many of these experiences are the ones we’ve come to expect and rely on during our day-to-day use of the internet. This brings with it new challenges, such as how to deal with the sheer volume of people accessing services and the vast amount of data required to deliver them.
The Challenge of Scale
For WebSockets to work, and for every user to see one another, they must be connected to the same WebSocket server. This means that the number of active users you can support is directly related to how much hardware your server has. Modern JavaScript runtime environments are pretty good at managing concurrency, but once you reach a few hundred to a few thousand users, you’re going to need to scale your hardware vertically to keep all the users in sync.
Scaling can either be vertical — i.e., procuring the most powerful hardware you can — or, once you’ve hit the technical limitations of what hardware is capable of, horizontal, which is better in the long run but costs more. Neither is an ideal solution.
But why are WebSockets hard to scale? The main challenge is that connections to your WebSocket server need to be persistent. And even once you’ve scaled out your server nodes both vertically and horizontally, you also need to provide a solution for sharing data between the nodes. Any state needs to be stored out-of-process to ensure that all the nodes have the same view of state.
In addition to having to share state using additional technology, broadcasting to all subscribed clients becomes difficult because any given WebSocket server node knows only about the clients connected to itself. There are ways around this, such as using some form of direct connection between the cluster nodes that are handling the traffic or by using an external pub/sub mechanism. This is sometimes called “adding a backplane” to your infrastructure, but this ends up being another moving part that makes scaling WebSockets difficult.
Moving to the Cloud
One way that the whole server capacity problem can be solved is to move the traffic to the cloud. Serverless WebSockets can help organizations build, extend and deliver real-time capabilities. Businesses can have an elastic WebSocket capability without having to manage or scale WebSocket servers because they can spin up capacity as needed on their cloud provider of choice.
However, many developers choose a server-based approach because it’s the one they know. In addition, we have only recently seen the likes of Amazon Web Services introduce ways to do serverless WebSockets so there is still education needed across the industry. As more and more services rely on streaming data and the appetite for real time grows, we will likely see an increasing number of cloud providers introduce serverless WebSocket capabilities.
Making Your Implementation a Success
There is no denying that WebSockets are a critical component of the real-time web, but organizations must carefully consider their implementations. How many users will you be serving? Do you expect sudden spikes in traffic? Ask yourself these questions and think carefully about what you need; it will help you to choose the right path and ensure the digital experiences you deliver are up to scratch.
Whether to host these services on your own servers or in the cloud is a critical decision that can affect your ability to serve a growing user base effectively. But even serverless implementations require significant development time, so it is prudent to choose an effective way to deliver your services.
Ultimately, delivering real-time capabilities using WebSockets requires additional architectural and engineering complexity, especially when done at scale. Working with an expert third-party can help you build and maintain a low-latency, scalable, fault-tolerant real-time infrastructure. This approach is becoming increasingly attractive, allowing developer teams to focus on frontend functionality rather than what is going on in the background. WebSockets are a great technology, it is now up to organizations to maximize their potential in a scalable way.
InApps is a wholly owned subsidiary of Insight Partners, an investor in the following companies mentioned in this article: Ably, Real.
Feature image via Pixabay.
Source: InApps.net
Let’s create the next big thing together!
Coming together is a beginning. Keeping together is progress. Working together is success.