System Design · Module 17
Realtime systems, chat and social feeds
- Lessons
- 14
- Free
- 0
- Reading
- ~6 h
Your progress
0 / 14 lessons done
Sign in to trackLessons
- WebSockets, SSE and long polling comparedLive screens need more than an open connection. You must choose how updates travel, recover after interruptions, and prevent slow clients from consuming unlimited server memory.
- Scaling WebSocket connections to millionsLong-lived connections consume resources even when customers send nothing. Scaling them requires connection ownership, bounded buffers and a recovery path that survives server failures.
- Presence: tracking online statusOnline indicators affect whether people expect an immediate reply. Building them requires handling silent failures, multiple devices and stale updates without making promises the network cannot support.
- Data modeling for social networksA social feature connects records that change independently. Your model determines whether retries create duplicates, deleted posts return, and private content reaches the wrong reader.
- Follow graphs: storing relationships at scaleFollow relationships drive feeds, notifications and audience lists. Their storage must support both ordinary accounts and unusually popular accounts without turning delayed copies into incorrect permissions.
- Feed generation: fan-out on write vs on readPersonalized feeds move work between publishing and reading. Understanding that choice helps you control page latency, background work and the visibility of new content.
- Hashtags: extracting and indexing tagsHashtags turn user-written text into database keys. Small differences in parsing, normalization or edit handling can split results or leave removed content discoverable.
- Reactions and likes: data modelingLikes combine personal state with a shared total. You need both to behave correctly when requests repeat, users change their minds, or one item becomes unusually popular.
- Design: live reactions on a video streamLive interfaces often need a fresh impression of activity, not a permanent record of every action. That difference changes the data model, retry policy and amount of work each phone must do.
- Design: unread message indicatorsUnread indicators combine user intent, ordered messages and delayed network requests. The same design problems appear in inboxes, support tools and notification centres.
- Design: live sports commentaryLive commentary combines a small write stream with a large broadcast audience. The same design problems appear in incident updates, election coverage and live announcements.
- Design: tagging people in photosA photo tag connects somebody’s identity to another person’s content. Building it safely requires more than storing a name: consent, access checks, retries and delayed notifications must agree.
- Design: a chat app like WhatsAppChat exposes failures that ordinary request-response APIs can hide. A connection can disappear after a message commits, and several devices must still agree about what happened.
- Design: a social media news feedFeeds combine cheap reads with expensive distribution. You need to control that distribution without making a cache responsible for permissions, deletion or durable storage.
Practise with
No tools or paper guides for this module yet.
Terms this module teaches 21
Open glossaryCanonical key
The representation an application stores and compares after applying its agreed normalization rules.
Contiguous cursor
A saved position through which every required record has been stored or otherwise accounted for.
Conversation sequence
A server-assigned position that orders committed messages within one conversation.
Derived counter
A stored total maintained from changes to authoritative records, rather than being the only record of those changes.
Derived view
Stored data computed from authoritative facts that can be rebuilt from those facts.
Display epoch
An identifier for one generation of temporary display state, used to reject output from older generations.
Fan-out on read
Building a personalized feed when it is requested by combining posts from the sources that person follows.
Fan-out on write
Preparing personalized feeds when a post is published by inserting references into followers’ inboxes.
Feed hydration
Loading current post content and eligibility for a collection of feed candidate references.
Feed inbox
A per-reader collection of post references prepared to reduce work when assembling a feed.
Hashtag
A marker followed by a tag name that an application extracts from text to group related content.
Hybrid feed generation
Combining prepared feed entries with posts retrieved from selected sources at read time.
Long polling
An HTTP pattern where the server holds a request until data is available or a deadline expires, then the client starts another request.
Normalized coordinate
A position stored relative to an image’s dimensions rather than one displayed pixel size.
Presence
A status inferred from recent evidence that a user’s application can communicate.
Reaction membership
The stored relationship showing that a particular user currently has a reaction on a particular item.
Read marker
A saved position through which an account has acknowledged a conversation’s messages.
Replay cursor
A position identifying how far a consumer has processed an ordered stream, used to request later events.
Snapshot
A complete representation of selected state at one version, rather than a sequence of changes.
Unicode normalization
A specified transformation that gives equivalent Unicode character sequences a consistent representation.
WebSocket gateway
A service that owns client WebSocket connections and routes authorized application messages through them.