Now You See Me, Now You Don’t: LinkedIn’s Real-Time Presence Platform

Akhilesh Gupta
11 min readintermediate
--
View Original

Overview

The article discusses LinkedIn's Real-Time Presence Platform, detailing how it manages the online status of its users through a robust infrastructure built using the Play Framework and Akka Actor Model. It highlights the challenges faced in real-time presence detection and the solutions implemented to ensure a seamless user experience.

What You'll Learn

1

How to implement a real-time presence detection system using Akka

2

Why using periodic heartbeats can improve user experience in mobile applications

3

How to manage online status updates efficiently in a distributed system

Prerequisites & Requirements

  • Understanding of real-time systems and distributed architectures
  • Familiarity with Akka and Play Framework(optional)

Key Questions Answered

How does LinkedIn determine when a member is online?
LinkedIn establishes a persistent connection with its Real-Time Platform when a member opens the application. This connection indicates that the member is online, and any changes in status are published to their connections through a publish/subscribe system.
What challenges does LinkedIn face with mobile connections?
Mobile users often experience jittery connections due to fluctuating network conditions. This can cause their presence status to oscillate between online and offline. To mitigate this, LinkedIn uses periodic heartbeats to maintain a stable online status as long as heartbeats are received within a specified duration.
How does LinkedIn detect when a member goes offline?
LinkedIn employs a delayed trigger mechanism that starts a timer for each online member. If the heartbeat for that member expires, the system publishes an offline event, notifying their connections of the status change.
What technology does LinkedIn use for real-time presence updates?
LinkedIn utilizes the Play Framework and the Akka Actor Model to build its Real-Time Presence Platform, enabling it to handle thousands of presence updates per second for millions of users.

Key Statistics & Figures

Requests handled per node
1.8K QPS
Each node in the Presence Platform can process approximately 1.8K queries per second, including heartbeat and API requests.
Time to detect presence status changes
less than 200ms at p99
The system is designed to update presence status changes quickly, ensuring users receive timely information about their connections.

Technologies & Tools

Backend
Play Framework
Used to build the infrastructure for the Real-Time Presence Platform.
Backend
Akka Actor Model
Facilitates the handling of concurrent user presence updates efficiently.

Key Actionable Insights

1
Implementing a real-time presence detection system can significantly enhance user engagement. By ensuring that users see accurate online statuses, you can improve interaction rates and user satisfaction.
This is particularly relevant for applications that rely on user interactions, such as messaging platforms or social networks.
2
Using periodic heartbeats can help manage network fluctuations effectively. This technique allows applications to maintain a stable online status for users even during temporary disconnections.
This approach is beneficial for mobile applications where users frequently encounter varying network conditions.
3
Leveraging a publish/subscribe model can streamline the distribution of presence updates. This architecture allows for efficient communication between the server and connected clients, reducing latency.
This model is essential for applications with a large user base, ensuring that updates are delivered in real-time without overwhelming the system.

Common Pitfalls

1
Failing to account for network variability can lead to poor user experience. If an application does not handle disconnections gracefully, users may see inaccurate online statuses.
To avoid this, implement strategies like periodic heartbeats that can help maintain a stable connection state despite network fluctuations.

Related Concepts

Real-time Systems
Distributed Architectures
Publish/Subscribe Messaging Patterns