Streaming a Million Likes/Second: Real-Time Interactions on Live Video - Deepstash
The Realtime Platform

LinkedIn has built the Realtime Platform to distribute multiple types of data in real-time such as:

  • Likes, comments and viewer count for Live Videos
  • Typing indic...

STASHED IN:

4

Streaming a Million Likes/Second: Real-Time Interactions on Live Video

Streaming a Million Likes/Second: Real-Time Interactions on Live Video

InfoQ

STASHED IN:

0 Comments

Interactive Live Videos

Having a lot of people interact on live videos poses many technical challenges. Mainly because viewers generate a lot of interactions that need to be delivered fast.

To get a...

STASHED IN:

6

Challenge 1: The Delivery Pipe
  • User devices have a persistent connection to the Realtime Platform servers.
  • The servers use server-sent events to stream data fast on this connection ...

STASHED IN:

6

Challenge 2: Connection Management
  • Each connection is managed by an Akka actor.
  • Actors are so lightweight that there can be millions of them on a single system. Moreover, all of them ca...

STASHED IN:

6

Challenge 3: Multiple Live Videos
  • Clients are subscribing to events for a particular live video i.e. they are telling the server which live video they are watching.
  • The Frontend server stores a...

STASHED IN:

6

Challenge 4: 10K Concurrent Viewers
  • Scale horizontally to handle more concurrent viewers -> Add multiple Frontend nodes and coordinate them using a Dispatcher node.
  • In a similar fashion to the Fronten...

STASHED IN:

7

Challenge 5: 100 Likes/second
  • Scale horizontally again to handle more events -> Add multiple Dispatchers and move the subscription table into a key-value store so it's accessible to all Dispatchers.

STASHED IN:

7

Final architecture
  1. A viewer likes a video and sends an HTTP request to the Likes backend, which stores it in a database.
  2. The backend forwards the like to any random Dispatcher node using an HTTP request....

STASHED IN:

10

Bonus Challenge: Multiple data-centers

Expanding to other regions requires two steps:

  1. Replicate the setup in each data-center.
  2. Have the Dispatcher broadcast the events to its peer Dispatchers from the...

STASHED IN:

6

Performance and scale
  • Each Frontend node handles 100k persistent connections. It handles only this many connections because the server is doing a lot of work processing multiple types of data (like...

STASHED IN:

6

Related posts
  • How LinkedIn displays Presence indicators in real-time: https://engineering.linkedin.com/blog/2018/01/now-you-see-me--now-you-dont--linkedins-real-time-presence-platf
  • ...

STASHED IN:

6

Deepstash helps you become inspired, wiser and productive, through bite-sized ideas from the best articles, books and videos out there.

GET THE APP: