---
title: "Discussion on \"System Design Drill Day 15: Real-Time Chat and Live Order Tracking\" | Hashnode"
description: "Discussion on \"System Design Drill Day 15: Real-Time Chat and Live Order Tracking\". How to design real-time chat and live tracking: polling vs SSE vs WebSockets, a Redis pub/sub backplane, sequence numbers and resync."
url: "https://hashnode.com/posts/system-design-drill-day-15-real-time-chat-and-live-order-tracking/6af182ac97c64d348b044f28"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [System Design Drill Day 15: Real-Time Chat and Live Order Tracking](https://blog.anishansari.com.np/system-design-drill-day-15-real-time-chat-and-live-order-tracking?utm_source=hashnode&utm_medium=feed)

How to design real-time chat and live tracking: polling vs SSE vs WebSockets, a Redis pub/sub backplane, sequence numbers and resync.

Nov 9 · 6 min read · blog.anishansari.com.np  
Read the article

-   [#laravel](https://hashnode.com/tag/laravel)
-   [#redis](https://hashnode.com/tag/redis)
-   [#interview-preparation](https://hashnode.com/tag/interview-preparation)
-   [#system-design](https://hashnode.com/tag/system-design)
-   [#websockets](https://hashnode.com/tag/websockets)

## Written by

[Anish Ansari](https://hashnode.com/@anish78)

@anish78 · kathmandu, Nepal

  
[View profile](https://hashnode.com/@anish78)

Food,Code and Cloud Computing. You can support here :https://www.buymeacoffee.com/anishansari

## Responses 6

Markdown supported · ⌘↵ to post

[OneLifeVibe](https://hashnode.com/@onelifevibe)

[Nov 10](https://hashnode.com/posts/system-design-drill-day-15-real-time-chat-and-live-order-tracking/6af182ac97c64d348b044f28/comment/6af314306762d56f5b80a4f4)

The 'save first, broadcast second' rule is the clearest takeaway for me — it reframes the socket as a best-effort notification layer rather than the system of record, which is exactly why a message to an offline user still exists. I also liked the unconditional resync on reconnect: fetching everything after the last seq without waiting to detect a gap removes a whole class of 'did I miss something' bugs. Parsa's point about a small Redis cache of recent messages per conversation pairs well with that, since it would keep the reconnect spike off MySQL when many clients come back at once.

[Anish Ansari](https://hashnode.com/@anish78)

[Nov 11](https://hashnode.com/posts/system-design-drill-day-15-real-time-chat-and-live-order-tracking/6af182ac97c64d348b044f28/comment/6af314306762d56f5b80a4f4#reply-6af3ec4b39b3a6f4cab2b81e)

Glad the save first, broadcast second rule clicked for you. Once the socket is just a notification layer, offline delivery stays simple, and pairing the unconditional resync with Parsa's recent messages cache is a nice way to soften that reconnect spike.

[Branden Floris](https://hashnode.com/@branden991)

[Nov 10](https://hashnode.com/posts/system-design-drill-day-15-real-time-chat-and-live-order-tracking/6af182ac97c64d348b044f28/comment/6af2ab08085d2a44211e06f6)

The seq number plus resync-from-DB approach is the right call, and it quietly makes the pub/sub backplane's at-most-once delivery a non-issue, which a lot of chat writeups never explain. One thing I'd add for the reconnect storm: when a WebSocket node dies, all its clients reconnect within a second or two, and they all hit the same after\_seq endpoint at once. Jitter on the client reconnect delay plus the Redis recent-messages cache mentioned above usually covers it. Also good call questioning whether order tracking needs WebSockets at all. Location updates every few seconds with tolerance for a missed one is a great fit for SSE or even polling, and it keeps the stateful connection count reserved for chat where it actually matters.

[Anish Ansari](https://hashnode.com/@anish78)

[Nov 10](https://hashnode.com/posts/system-design-drill-day-15-real-time-chat-and-live-order-tracking/6af182ac97c64d348b044f28/comment/6af2ab08085d2a44211e06f6#reply-6af317ca89a0e7693f62dfcc)

Good point on the reconnect storm, Branden. Random jitter on the client's retry delay plus the recent-messages cache keeps that after\_seq burst from hitting MySQL all at once, and staggering deploys helps in the same way.

[Parsa Aftabi](https://hashnode.com/@parsaaftabi)

[Nov 9](https://hashnode.com/posts/system-design-drill-day-15-real-time-chat-and-live-order-tracking/6af182ac97c64d348b044f28/comment/6af1eb783fc61c9cdfaece5e)

I would add a short Redis cache of recent messages per conversation for resync. When many clients reconnect at once, serving those recent messages from Redis instead of MySQL avoids a spike on the database, and MySQL still covers older gaps.

[Nov 10](https://hashnode.com/posts/system-design-drill-day-15-real-time-chat-and-live-order-tracking/6af182ac97c64d348b044f28/comment/6af1eb783fc61c9cdfaece5e#reply-6af2eed2ef788f8d609de5d1)

Nice addition Parsa, a small per-conversation cache of the last few messages takes the reconnect spike off MySQL, and since MySQL stays the source of truth a cache miss just falls back to the normal after\_seq query.
