5 Serverless Platforms for Building Internet-scale Real-time Applications

How they help you to take away the complexity of building Internet-scale event-driven applications.

Dunith Danushka
Tributary Data
8 min readMay 20, 2021

--

Photo by henry perks on Unsplash

Real-time applications are becoming increasingly popular in the new digital economy.

Unless your application doesn’t push information to users, they might not engage with it, and maybe they will forget it eventually. That’s why every application you see today tries to send you notifications.

It’s a subtle way of telling, “Dear user, please use me today.”

However, building such applications is challenging. But some serverless platforms make it painless for you. This post discusses them in detail.

For a primer on event-driven APIs and how real-time applications work, you can refer to my article below.

What are some real-time application examples?

Today, we can see many applications provide real-time, interactive, and immersive user experiences to their users. They push information to users in real-time so that users don’t have to poll. Improved user engagement, loyalty, and boosted revenue are some positive outcomes of it.

Some examples applications include:

  • Chat applications
  • Real-time dashboards
  • Push notifications
  • Geo-location tracking
  • Command and control of IoT and connected devices
  • Mass scale online multiplayer gaming
  • Media
  • Trading applications

Building real-time applications is complicated.

Behind every real-time application lies an ever-evolving, complex system architecture that is challenging to maintain. That consists of many event-driven APIs, a pub/sub mechanism, a distributed data storage, and an army of top-of-the-class engineers.

If you think that real-time applications are all about sending asynchronous notifications to your users, that is wrong.

In fact, that is just the tip of the iceberg.

The first hurdle you’ll have to face is scalability. As an Internet-scale application, you need to send that notification to billions of users with a sub-second latency range.

Then you’ll have to make sure that a user will not get the same notification more than once. Also, users from different geographical regions shouldn’t feel a lag in their chat messages. That makes you consider exactly-once processing and eventual consistency, which eventually makes the system more complicated.

When you try to address every challenge above, managing the system infrastructure keeps on increasing. Not to mention the effort you must put into keeping the user data secure and standard compliant. An unexpected data breach will crush your application’s future overnight.

What are your chances of building a real-time, interactive, and responsive application as a regular mobile, web, or backend developer despite all these challenges?

It appears that you’ll have to earn a specialty in building distributed systems, whether you like it or not.

Can that be avoided? YES!!

Let’s see how.

Sometimes, building everything from the scratch is not applicable.

How Serverless platforms help?

Fortunately, several serverless platforms emerged in the past few years to help developers design and build real-time applications without getting a degree in distributed systems.

These platforms come to you as managed services that abstract away the underlying complexity from you. Below is a list of things common to most of them.

Being serverless — Being serverless takes away the burden of building and managing the complex infrastructure that serves billions of consumers of your application. You can better focus on the application’s logic instead.

Scalability and availability — The platform itself takes care of multi-regional high availability, on-demand scaling and ensures a predictable latency across the globe.

Reduced complexity — Most platforms are built around scalable pub-sub systems that can effectively handle about a billion subscribers at a time. Events coming from and going out to consumers are durably stored on a distributed and partitioned event log.

That kind of architecture solves many problems native to distributed systems — exactly-once processing, message ordering, and dealing with eventually consistent data.

Multi-protocol API support — These platforms make sure to hide their inner complexity from their end-users, that is, developers. Underlying system functionality is exposed to developers through well-documented APIs and SDKs.

Developers have the flexibility to deal with the platform with their familiar programming language while the platform takes care of the rest.

The majority of the platforms support event-oriented API technologies to send and receive data. WebHooks, WebSockets, SSE, STOMP, and MQTT are a few examples.

SDK support of Ably

Security for data in motion and data at rest — Many platforms offer you strong security measures for data that they store — some of them even provide AES256 encryption and compliance with SOC2 and HIPAA.

Security compliances of PubNub

Considering all these facts, it is inevitable that most developers will choose a serverless platform like below to start building real-time, Internet-scale applications.

1. Ably

What can you build with Ably?

At its core, Ably is a cloud-based pub/sub Platform-as-a-Service ensuring any device publishing messages to Ably will be received in real-time by any number of subscribing devices.

As a developer, you can use Ably as a scalable pub/sub engine to build real-time messaging applications that require guaranteed delivery, message ordering, and message persistence. Apart from that, Ably can be used as a streaming system to connect and consume the stored messages in a streaming manner. You can use protocols like WebSockets or SSE to send/receive data to/from Ably continuously. Ably also hosts and manages message queues that are exposed via AMQP and MQTT protocols.

Moreover, Ably provides rich ecosystem support for third-party integrations. Its pub/sub engine can post to external WebHooks, invoke serverless functions, and even stream to other message platforms such as AWS Kinesis and RabbitMQ. Apart from that, push notifications are also supported.

Ably maintains a streaming data hub that allows developers to find and consume free and open streaming data sources to augment their applications with third-party real-time data. Currently, there are streaming sources across industries like transport, sports, news, weather, social media, and finance.

All these functionalities are offered to developers with a wide range of language-specific SDKs and developer-friendly APIs.

2. Pusher

What can you build with Pusher?

Pusher’s serverless platform offers developers two products to build real-time applications; Channels and Beams.

Channels provide basic pub/sub features that can be used to build chat applications, real-time dashboards, presence indicators, and geo-location tracking. Consumers connect to Channels using WebSockets connections to send and receive events continuously. Apart from that, Channels supports event-based integrations with WebHooks, where it can post to a registered WebHook when something interesting happens.

Beams is a cross-platform push notifications API designed for developers who need to deliver critical transactional information in real-time, without complex integrations and maintenance.

Pusher provides end-to-end encryption for data in motion while being compliant with GDPR and HIPAA.

For integrating with the platform, Pusher provides a wide range of language-specific SDKs and developer-friendly APIs.

3. PubNub

What can you build with PubNub?

PubNub positions itself in the market as a real-time in-app chat and communication platform.

PubNub provides a reliable and low-latency in-app messaging service to cater to both pub/sub and message-queue semantics. Each device is associated with a channel which is the primary way of receiving messages from PubNub. Channel has multiple variations to support one-to-one, many-to-many, unicast, and broadcast communication patterns.

The messaging service also provides a presence API to detect and notify participant’s online status. Besides that, PubNub integrates with 65+ third-party systems and APIs with webhook and data stream interfaces and a secure vault for storing external credentials.

One thing that helps PubNub stand out from its competition is its built-in support to execute serverless functions. PubNub Functions enable developers to run code within their network or leverage existing integrations to transform, re-route, augment, filter, and aggregate messages to detect and block spammers, measure averages, and more.

PubNub supports compliance for regulatory environments that include HIPAA, GDPR, SOC2 Type 2, and CCPA.

Like any other platform, PubNub provides developers with a rich set of APIs and language-specific SDKs.

4. Azure SignalR

Azure SignalR Service simplifies the process of adding real-time web functionality to applications over HTTP. This real-time functionality allows the service to push content updates to connected clients, such as a single-page web or mobile application. As a result, clients are updated without polluting the server or submitting new HTTP requests for updates.

SignalR is an excellent option if you plan to build your entire application stack on the Azure platform as it natively integrates with Azure services like Azure Functions and ASP.NET Core.

SignalR provides connectivity to consumers over multiple protocols. WebSockets is the optimal transport, but other techniques like Server-Sent Events (SSE) and Long Polling are used when other options aren’t available.

At the end of the day, it’s an Azure service, which means that a wide range of SDKs, APIs, and security compliance is provided to developers out of the box.

5. AWS AppSync

AWS AppSync is a fully managed service that makes it easy to develop GraphQL APIs. GraphQL APIs built with AWS AppSync give front-end developers the ability to query multiple databases, microservices, and APIs from a single GraphQL endpoint.

Although AppSync primarily positions itself as an API gateway to build and run GraphQL APIs, it also supports building real-time applications via in-built GraphQL Subscriptions.

With managed GraphQL subscriptions, AppSync can push real-time data updates over Websockets to millions of clients. AppSync also provides local data access for mobile and web applications when devices go offline and data synchronization with customizable conflict resolution when they are back online.

Developers can leverage AppSync and other AWS services to build real-time applications while benefitting from language-specific SDKs, APIs, and security compliances.

Conclusion

Building scalable real-time applications is challenging even though we live in the cloud-native world. As a developer or an architect, you must find a way of making it a painless process in the long run.

Serverless platforms come in handy at this point, taking away the complexity out of developers and adding value in terms of built-in scalability and availability. That allows you to focus more on solving the actual problems rather than battling with ever-increasing infrastructure issues.

--

--

Dunith Danushka
Tributary Data

Editor of Tributary Data. Technologist, Writer, Senior Developer Advocate at Redpanda. Opinions are my own.