# How to design a short video app like TikTok

Source: https://systemdesignsim.com/system-design/tiktok

System design · Video upload, transcoding, feed retrieval and CDN playback

Keep video upload and playback separate from feed retrieval and ranking. Store original media durably, create playback renditions asynchronously, and deliver bytes through a CDN. The YouTube upload challenge covers part of the media path, not personalized feed ranking.

Updated October 28, 2026 · 4 min read

A teaching design of a system like TikTok, not TikTok's real architecture.

[Take the YouTube upload challenge](https://systemdesignsim.com/challenges/youtube-uploads)

![Short Video App like TikTok architecture diagram](https://systemdesignsim.com/diagrams/tiktok-system-design-diagram.svg)

A viewer reads a ranked feed and fetches approved media through a CDN.

## The short version

* Upload, transcoding, moderation, feed ranking and delivery have different load profiles. Keep them off one request path.
* Uploads use resumable sessions with idempotency keys. Transcoding runs from a queue, never in the upload request.
* The feed returns video IDs and a cursor. Media bytes come from a CDN through a manifest of approved renditions.
* Retrieve bounded candidates, filter for safety and visibility, then rank. A cached list never skips current checks.
* Deletion must reach metadata, feed candidates and cached delivery paths, not one database row.

## Clarifying questions to ask first

* How long are videos and how large are uploads? (Assume short clips and resumable upload for unreliable networks.)
* What matters most in playback? (Assume a first frame within seconds; lower resolution beats a stall.)
* How personalised is the feed? (Assume ranking, with safety and eligibility filters mandatory.)
* What traffic shape? (Assume steady viewing with sharp bursts around viral clips.)
* Which privacy rules apply? (Assume account visibility and deletion cover feed metadata and playback media.)

## Numbers that shape the design

These are assumptions, not TikTok traffic. 500,000 uploads a day at 20 MB is 10 TB/day of originals; three 8 MB renditions add about 12 TB/day. Ten million daily viewers opening the feed 20 times is 200 million requests/day: about 2,315/s average, 11,575/s at an assumed 5x peak. Viral events can be sharper. Ten million viewers polling every ten seconds would be one million requests/s.

A 2 MB clip sent to 100,000 viewers is 200 GB, so the CDN must carry most media bytes.

## API

```
POST /uploads { idempotencyKey, sizeBytes, contentType }
POST /uploads/{uploadId}/parts/{partNumber}
POST /uploads/{uploadId}/complete

GET /feed?cursor=opaque-token
GET /videos/{videoId}/playback-manifest
```

The upload session records ownership, expected size and expiry, so parts can retry safely. Completion verifies checksums and moves the video to processing. The opaque cursor hides ranking internals. Clients never fetch the original object.

## Data model

A video record holds owner, visibility, upload and moderation states, creation time and version. Object storage holds the original and immutable renditions; metadata holds their keys, codecs, dimensions and checksums. Feed items reference IDs and ranking snapshots, never bytes. Upload ID and part number deduplicate retries. Transcode jobs reference a source version, so a late worker can't publish output for an older upload. CDN paths are immutable or versioned.

## High-level design

The upload API issues a session and stores chunks in object storage. Completion writes metadata and publishes a durable job. Workers validate the file, create renditions and a manifest, and moderation runs before publication. The feed API retrieves candidates, filters, ranks a bounded set, and returns IDs and a cursor. Players fetch the manifest and segments from a CDN. The [YouTube guide](https://systemdesignsim.com/system-design/youtube) covers a related media path.

## Transcoding and playback

A queue absorbs upload bursts when workers are slower than arrivals; track its age as well as depth. A job may produce a low-resolution rendition first for faster playback, then higher quality. Workers are idempotent per video version and rendition profile, so a retry verifies the same immutable result instead of mixing manifests. The manifest lets the client pick a rendition for its bandwidth and device. The origin never transcodes per viewer.

## Feed retrieval and safety

Candidates come from followed creators, interactions, topic interests or a discovery pool. Deduplicate, drop blocked creators and unavailable videos, apply moderation and visibility, then rank. A slow ranker falls back to a precomputed eligible list or recent and popular videos.

Precomputed pools for active viewers cut per-request work but add storage and invalidation. A low-activity account may not justify its own list, so use a shared pool or compute on demand. A new follow can reach the feed within a target interval; a block or takedown may need synchronous filtering. Measure candidate freshness, ranker time, empty-page rate and creator diversity.

[TikTok's public explainer](https://newsroom.tiktok.com/how-tiktok-recommends-videos-foryou?lang=en-AU) says recommendations use interactions, video information such as captions and sounds, and device and account settings, with different weights. That's a product-level description, not evidence for this backend, and this guide doesn't reproduce TikTok's ranking model.

## Common traps

* Sending video bytes through the feed API. The CDN delivers segments.
* Transcoding in the upload request, which ties upload latency to variable compute.
* Returning a cached feed item without rechecking visibility. A removed video must be rejected even if an older ranking snapshot holds its ID.
* Letting a viral clip cause a CDN miss storm. Use immutable keys and protect the origin.
* Claiming the YouTube upload challenge simulates ranking or moderation.

## Follow-up questions interviewers ask

* "How do you remove a video that's already cached?" Revoke or version its path, update metadata, and define purge and expiry bounds.
* "What if ranking is unavailable?" Return an eligible fallback or an empty feed; never bypass moderation and privacy.
* "A regional origin fails." Serve approved replicas and state the freshness trade-off.

## Frequently asked questions

### Why store the original video?+

It is the durable source for new renditions or permitted edits. Retention and deletion policy decides when it can go.

### Why use a queue for transcoding?+

It absorbs bursts while workers process at their own rate. It doesn't add throughput, so watch queue age.

### Does a CDN replace object storage?+

No. Object storage is the durable origin; a CDN caches approved media near viewers and cuts repeated origin reads.

### Does this describe TikTok's internals?+

No. It is illustrative. The linked explainer describes public recommendation factors, not this proposed backend.

## More system design guides

[All 76 guides](https://systemdesignsim.com/system-design)

* [Design a YouTubeTranscoding pipeline, object storage, CDN](https://systemdesignsim.com/system-design/youtube)
* [Design an InstagramMedia uploads, feeds, hot accounts](https://systemdesignsim.com/system-design/instagram)
* [Design a Netflix CDNEdge caching and the launch stampede](https://systemdesignsim.com/system-design/netflix-cdn)
* [Design a Live Streaming Platform like HotstarIPL spikes, pre-warming, panic mode](https://systemdesignsim.com/system-design/hotstar-live-streaming)
* [Design an IRCTC Tatkal Booking System10:00 rush, waiting room, no double booking](https://systemdesignsim.com/system-design/irctc-tatkal)
* [System Design Security explainedIdentity, access, encryption and secrets](https://systemdesignsim.com/system-design/security-basics)

## Now fix it yourself.

Run the design under real traffic and see what breaks first. No signup.

[Take the YouTube upload challenge](https://systemdesignsim.com/challenges/youtube-uploads)
