2

How do you design Telegram's feature where you get a notification each time a contact of yours joins the service? what does it look like in terms of a scalable backend architecture?

Scenario: Two users, where both have a common contact, join Telegram. Then, that contact joins Telegram too, the system should then notify both users that their contact has joined Telegram.

adi518
  • 863
  • 1
  • 11
  • 19

1 Answers1

0

First thing that comes to my mind is to have a DB design similar to what is described here: https://stackoverflow.com/a/38111303/12250254 and a similar one https://stackoverflow.com/a/11189651/12250254

It should scale pretty well

So basically when another user joins Telegram an empty conversation (i.e. dialog / chat) is created and treated as an empty chat between two users. Besides that it bubbles up above all existing chats in order to draw user's attention as if it were a regular incoming message.

In terms of notifications if we speak about web I would recommend you to check Web Push Notifications. Although I believe it's much less effective than native app notifications, like we have in Telegram Desktop or Telegram mobile apps.

Vlad
  • 985
  • 1
  • 6
  • 10