• Matt Burrell

Why You Should Build Real-time Applications

Updated: Jan 14



Real-time features are an essential part of modern web applications. Users are now used to the fast, smooth and transparent experience they get with social media apps. And they expect the same real-time experience from your applications too.


What is a real-time application?


A real-time application updates and displays pieces of information to the user without requiring any interaction. An example would be how messages just appear in messaging applications like WhatsApp.


In traditional web applications updates are ‘pulled’ from the server whenever they’re needed. This is usually in response to a request made by the browser or mobile device. The server responds to individual requests with the requested data or files.


This process can be automated without requiring an actual click from the user, for example through polling. But polling isn’t a scalable solution for providing live updates and isn’t suited for handling streaming data, which is becoming more and more prevalent.


How do real-time applications work?


In ‘real’ real-time applications, a special type of connection is established between the client and server. This connection allows the server to push updates directly to the client without being asked.


This is typically achieved using either Server-Sent Events (SSE) or WebSockets. The advantage of a WebSocket connection, however, is that it allows two-way communication. With Server-Sent Events the server is able to push data to clients, but clients can’t talk back to the server over the same connection. A WebSocket connection on the other hand allows communication in both directions. This is referred to as full-duplex data transmission.


Choosing which of these two technologies to use depends on which browsers and devices you need to support. Older browsers (naming no names…) don’t support server-sent events or WebSockets. In this case, you would need to revert to polling (or better long-polling) to add ‘real-time’ features.


Trying to manage connections (and fall-backs to polling) can become complicated. Luckily there are some great technologies you can use that do all the grunt work for you. For example, ASP.NET SignalR, Socket.IO or Pusher. There are pros and cons for each of these so choosing the right tool requires careful thought and consideration of your existing tech stack.


Examples of real-time applications


Normally you would only add real-time functionality to the parts of your app that require live updates. One of the most obvious use cases would be a chat feature allowing users to message each other in real-time.


But other use cases exist such as dashboards that require live updates, online gaming, collaboration tools, live auction sites, stock tickers, video conferencing, and real-time file sharing.


These examples are intentionally ‘high-level’ but when you combine them together into specific use cases you can build some very powerful and user-friendly apps.


Advantages of building real-time applications


By including real-time features in your application you’re adding some solid benefits for both your users and your business.


  • Real-time features allow users to be proactive rather than reactive. Users can respond and handle events almost as they happen rather than clicking a refresh button.

  • Real-time features are more engaging for the user – think of social media applications and their addictive nature.

  • Real-time applications fit nicely with streaming data sources. They allow users to see live data and analytics as it comes in.

  • Real-time applications can improve business processes and collaboration between users. They enable new types of tools to be built and therefore create new business opportunities.

  • Real-time features can work well with recommendation engines. By integrating your app with machine learning algorithms, you can improve users’ experience and generate more revenue through upselling and referrals by pushing recommendations to users while they are interacting with your application.


The challenges of building real-time applications


Technologies such as ASP.NET SignalR, Socket.IO and Pusher make building real-time applications much easier. But other technical challenges remain.


Before going into production with real-time apps, you need to consider scalability, security, deployment and infrastructure cost. You need to design your application’s data flow and events. You need to consider how your app will integrate with your existing architecture, applications and tools. Databases (relational and NoSQL), for example, aren’t designed to push real-time data to clients so a designing a robust real-time architecture is essential.


Summary


Real-time applications aren’t the future, they’re already well-established and here to stay. There are clear benefits to adding real-time capability to your applications for both users and your business.


But designing and building real-time applications can be tricky. The right tools and architecture need to be in place to ensure your app scales, integrates with your existing infrastructure and remains secure.

Contact

Connect

+44(0)7889908061

©2020 by Solid Code Solutions Ltd. All rights reserved.

Registered number: 08750436. Registered office: 20 - 22 Wenlock Road, London, England, N1 7GU