Challenge 2: Connection Management - Deepstash
Machine Learning With Google

Learn more about computerscience with this collection

Understanding machine learning models

Improving data analysis and decision-making

How Google uses logic in machine learning

Machine Learning With Google

Discover 95 similar ideas in

It takes just

14 mins to read

Challenge 2: Connection Management

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 can be served by a small number of threads, proportional to the number of cores. This is possible because a thread is assigned to an actor only when it has work to do.
  • Actors are managed by an Akka supervisor actor that sends them events (likes, comments etc.) which need to be forwarded to user devices.

Akka is a toolkit for building highly concurrent, distributed, and resilient message-driven apps.

8

43 reads

MORE IDEAS ON THIS

Challenge 3: Multiple Live Videos

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 all subscriptions in an in-memory table.
  • Every time a new event is published, the su...

8

60 reads

Final architecture

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.
  3. Dispatcher looks up in the key-value store to find out which Frontend nodes are subscribed ...

12

314 reads

Interactive Live Videos

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 sense of the scale, the top live streams in the world gathered millions of concurrent users:

8

119 reads

The Realtime Platform

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 indicators and Read receipts for Instant Messaging
  • Presence i.e. the green online indicators
  • ...

7

116 reads

Related posts

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
  • How LinkedIn measures end-to-end latency across systems: https://engineering.linked...

10

206 reads

Challenge 4: 10K Concurrent Viewers

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 Frontend node, the Dispatcher has a subscriptions table to know which frontend nodes should r...

9

53 reads

Challenge 1: The Delivery Pipe

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 via the EventSource interface.

A persistent connection is an HTTP L...

8

85 reads

Challenge 5: 100 Likes/second

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.
  • Dispatchers are independent from Frontend nodes and don't have persistent connect...

9

75 reads

Bonus Challenge: Multiple data-centers

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 other data-centers.

8

58 reads

Performance and scale

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 (likes, comments, instant messaging etc.).
  • Each Dispatcher can publish 5k events per seco...

8

49 reads

CURATED FROM

CURATED BY

ocpodariu

Alt account of @ocp. I use it to stash ideas about software engineering

stash-superman-illustration

Explore the World’s

Best Ideas

200,000+ ideas on pretty much any topic. Created by the smartest people around & well-organized so you can explore at will.

An Idea for Everything

Explore the biggest library of insights. And we've infused it with powerful filtering tools so you can easily find what you need.

Knowledge Library

Powerful Saving & Organizational Tools

Save ideas for later reading, for personalized stashes, or for remembering it later.

# Personal Growth

Take Your Ideas

Anywhere

Organize your ideas & listen on the go. And with Pro, there are no limits.

Listen on the go

Just press play and we take care of the words.

Never worry about spotty connections

No Internet access? No problem. Within the mobile app, all your ideas are available, even when offline.

Get Organized with Stashes

Ideas for your next work project? Quotes that inspire you? Put them in the right place so you never lose them.

Join

2 Million Stashers

4.8

5,740 Reviews

App Store

4.7

72,690 Reviews

Google Play

Shankul Varada

Best app ever! You heard it right. This app has helped me get back on my quest to get things done while equipping myself with knowledge everyday.

β€œ

samz905

Don’t look further if you love learning new things. A refreshing concept that provides quick ideas for busy thought leaders.

β€œ

Sean Green

Great interesting short snippets of informative articles. Highly recommended to anyone who loves information and lacks patience.

β€œ

Ashley Anthony

This app is LOADED with RELEVANT, HELPFUL, AND EDUCATIONAL material. It is creatively intellectual, yet minimal enough to not overstimulate and create a learning block. I am exceptionally impressed with this app!

β€œ

Jamyson Haug

Great for quick bits of information and interesting ideas around whatever topics you are interested in. Visually, it looks great as well.

β€œ

Laetitia Berton

I have only been using it for a few days now, but I have found answers to questions I had never consciously formulated, or to problems I face everyday at work or at home. I wish I had found this earlier, highly recommended!

β€œ

Giovanna Scalzone

Brilliant. It feels fresh and encouraging. So many interesting pieces of information that are just enough to absorb and apply. So happy I found this.

β€œ

Ghazala Begum

Even five minutes a day will improve your thinking. I've come across new ideas and learnt to improve existing ways to become more motivated, confident and happier.

β€œ

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Access to 200,000+ ideas

β€”

Access to the mobile app

β€”

Unlimited idea saving & library

β€”

β€”

Unlimited history

β€”

β€”

Unlimited listening to ideas

β€”

β€”

Downloading & offline access

β€”

β€”

Personalized recommendations

β€”

β€”

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates