How HotStar handles Billions of Emoji in real time

You must be a fan of the IPL or even if you’re not, you’ve probably watched some intense cricket rivalry on Hotstar. And chances are, you’ve used those floating emoji or sticker features during live matches. They’re a simple way to express what you’re feeling right from your couch or bed. Pretty cool, right?

These emojis don’t just make things fun they help you feel connected to the game and the crowd, even from miles away.

But have you ever wondered what’s actually happening behind the scenes? How does Hotstar manage to handle billions of emoji reactions all in real time without missing a beat?

In this blog, we’ll take a peek into the system design that powers this real-time emoji experience and explore how it all works under the hood.

Design Implementation

Dedeepya Bonthu

1. Client Request

Let’s say your favorite cricketer hits a big six and you react with an emoji like ❤️ or the one present on HotStar. These emojis are sent from your device to the server using a simple HTTP request.

But processing the emoji (like counting, saving, or updating) right away would slow things down. It might even make the app feel laggy and no one wants that.

So, instead of doing all the work immediately, the emoji is stored in a temporary place. This temporary space is called a message queue, which lets different parts of the system communicate without waiting.

Since HotStar gets huge volumes of emoji reactions, it uses Kafka (a popular message queue system) as a buffer.

User (App)
   |
   |-- HTTP Request -->  
   |
Message Queue (Kafka)

2. Writing Messages to Kafka

There are two ways to send emoji data to Kafka:

  • Synchronous Writing: The system waits for confirmation before responding to the user. It’s safer, but slower.
  • Asynchronous Writing: The system saves the emoji in a local buffer and replies to the user instantly. Later, a background process sends the emoji to Kafka. It’s faster, and for emojis, a tiny chance of loss is okay.

JioStar uses asynchronous writing because speed matters more in this case.

To handle this, JioStar uses the Golang programming language. Why? Because Golang is great at doing many things at once (called concurrency).

It uses something called Goroutines, which are like lightweight background workers. They can run tasks without slowing down the app.

When users send emojis, they are added to a bucket (in Golang, this is called a Channel). A background worker (Goroutine) checks this bucket every 500 milliseconds. It collects up to 20,000 emojis and sends them to Kafka in one go. This makes the process fast and efficient.

User Emoji Input
   |
   v
[Golang]
   |
   |--→ Channel (Emoji Bucket)
                |
                v
        [Goroutine (every 500ms)]
                |
                v
         Batch Send (20,000) 
                |
                v
             Kafka

3. Processing Emojis

Now that the emoji data is stored safely in Kafka, the next step is processing it.

This means counting how many times each emoji was used in a short time window like every few seconds.

Jio HotStar uses Apache Spark for this step, because:

  • It supports micro-batching (small batches every 2 seconds)
  • It handles tasks like counting and grouping really well
  • It has good community support

So, every 2 seconds, Spark checks the emoji data and creates a summary. For example:

In a 2-second batch:

  • 👏 = 12,000
  • 😍 = 9,000
  • 😡 = 4,000

Instead of sending all individual emojis, only these counts are sent to the next step which is delivery to the users.

Kafka (Emoji Events)
      |
      v
[Apache Spark (2s Micro-batch)]
      |
      v
Count & Aggregate:
👏 = 12k, 😍 = 9k, 😡 = 4k
      |
      v
Kafka (Aggregated Counts)

4. Delivery to Users

After counting, the system needs to show the results on users’ screens so they can see floating emoji animations in real time.

To do this, HotStar uses PubSub a real-time messaging system that pushes updates to all users instantly.

You can think of PubSub like a loudspeaker that broadcasts the latest emoji mood to everyone using the app.

What the User Sees:

  • The app gets emoji count data through PubSub
  • It shows floating emojis based on the most used ones at that moment
  • Not every emoji is shown only the most popular ones make it to your screen for a smoother and more fun experience. It’s just like a stadium, where you only hear the loudest chants the crowd favorite player/ team name.
Kafka (Aggregated Emoji Count)
       |
       v
     PubSub
       |
       v
  User Devices (Hotstar App)
       |
       v
 Floating Emojis (Popular only)

Conclusion

Jio Hotstar’s real-time emoji feature has been a cornerstone of their live UX since IPL 2018, letting users bombard the screen with hearts, happy faces, “sixes,” and even player-specific icons during matches

Handling billions of emoji reactions in real time isn’t easy. It needs a system that’s fast, scalable, and reliable.

With smart use of tools like Kafka, Golang, Spark, and PubSub, HotStar makes it all happen and delivers a stadium-like experience right to your screen.

Reference

ByteByteGo

Highscalability

Rohit Mishra
Rohit Mishra

Hello World!