Library / Case Studies
Big Data Processing (2 parts) at Spotify
In this part we’ll take a closer look at Scio, including basic concepts, its unique features, and concrete use cases here at Spotify.
By Spotify engineers · Spotify · Added 2026-10-12
All content belongs to Spotify engineers / Spotify. We only link to it and give credit. Report a problem
Learn this case study
About 37 min left. Your work is saved as you go.
What you are about to study
Spotify explains a real system. You should know the basics: caching, queues and replication.
Ideas you will meet
- Machine Learning Systems
- Recommendations, ranking, feature stores and serving models at scale.
What we already know about this
Our own lessons on these ideas. Read them here before you start, so it makes sense.
Real-World Systems · 9 minUploading large files reliablyChunked, resumable, direct-to-storage uploads: how to move gigabytes over unreliable networks without tying up your servers.Read here
Why large uploads are hard
A 5 GB file on a normal request has many ways to fail:
- A single long connection dies on a flaky network, losing everything.
- Timeouts in load balancers and proxies cut off long requests.
- Your application servers are tied up carrying bytes, and memory or disk fills.
- A failure at 99% means starting again.
- Users want a progress bar and the ability to pause and resume.
The design in one picture
100%Figure SDA-RWS-17-1 · Chunked, resumable upload flow · © forcsguy.com
Before: upload through your server
100%After: upload straight to storage
100%What changed
- Your servers no longer carry large files
- A failed chunk is retried, not the whole file
- Pre-signed URLs keep storage private
Step by step
- Initiate. The client tells the API the file name, size and type. The API checks permissions and limits, and creates an upload session with a unique id.
- Direct to storage. The API returns pre-signed URLs: short-lived, scoped links that let the client upload straight to object storage. Your servers never carry the file.
- Chunk. The client splits the file into parts (for example 5 to 100 MB; object stores typically accept thousands of parts per object) and uploads them, in parallel.
- Verify. Each part carries a checksum (MD5, CRC32C or SHA-256). The storage service or your server checks it, and a bad part is simply re-sent.
- Resume. The session remembers which parts are done. After a drop the client asks which parts exist and sends only the missing ones. Open protocols such as tus standardise resumable uploads.
- Complete. The client sends the list of parts; storage assembles the object.
- Post-process asynchronously. An event triggers virus scanning, type verification, thumbnails or transcoding, and metadata updates. The user sees "processing" until it finishes.
Checking each part
When a part arrives, the store replies with a checksum tag. The client keeps the list of part numbers and tags, and sends it with the final "complete" request, so the store can verify and assemble exactly the parts you meant, in order. A failed part is re-sent alone; assembly of a very large object can take a few minutes, so treat "complete" as asynchronous from the user's point of view.
Smart extras
- Deduplication: hash the file (or chunks) on the client first. If the content already exists in storage, skip the upload entirely and just add a reference (as in cloud file storage services).
- Parallelism and adaptive chunk size: larger parts on fast networks, smaller on poor ones.
- Compression for compressible data before upload.
- Upload acceleration: send to the nearest edge location, which forwards over the provider's backbone.
- Progress and cancellation: the client tracks bytes per part; cancelling aborts the session.
Safety and cost
- Limit size, type and number of concurrent uploads per user, and expire pre-signed URLs quickly.
- Validate on the server, not only in the client: check file type by content, scan for malware, and store uploads in a quarantine area until cleared.
- Use lifecycle rules to delete incomplete multipart uploads after a few days, since unfinished parts cost money until removed.
- Encrypt in transit and at rest; do not let user-provided names choose storage paths.
- Rate limit session creation to prevent abuse.
Failure handling checklist
Failure Handling Connection drops mid-part Retry that part with backoff Client closes the app Session persists; resume later by listing stored parts Corrupted part Checksum mismatch, re-upload that part Duplicate completion request Idempotent: completing twice returns the same result Abandoned upload Lifecycle rule cleans up the leftovers Processing fails Retry from the event queue, mark the file as failed, tell the user Real-world reading
Related reading
- Determinism (4 parts) in League of Legends ServerRiotgames engineers · RiotgamesCase Studies
- Implementing health checksAmazon Builders' Library · Amazon Web ServicesBlogs
- The Network is ReliableKyle Kingsbury · aphyr.comBlogs
- Bulkheads: Partition and Tolerate Failure in One PartSkife engineers · SkifeCase Studies
Show 6 moreShow fewer
- Natural Language Processing and Content Analysis (2 parts) at Condé NastCondé Nast engineers · Condé NastCase Studies
- Autoscaling Bigtable Clusters based on CPU Load at SpotifySpotify engineers · SpotifyCase Studies
- Ambry: Distributed Immutable Object Store at LinkedInLinkedIn engineers · LinkedInCase Studies
- Big Data Processing (2 parts) at SpotifySpotify engineers · SpotifyCase Studies
- Container (8 parts) at Riot GamesRiot Games engineers · Riot GamesCase Studies
- Architecture of Chat Service (3 parts) at Riot GamesRiot Games engineers · Riot GamesCase Studies
Want the architecture first? Read our Spotify case study, with its diagram.
Go deeper on this
A path through videos, articles, other case studies and code on the same ideas as Big Data Processing (2 parts) at Spotify.
ReadEngineers explain it in their own words.
Blogs
Adobe Research
Look into the future of innovation at Adobe Research
AdobeIntermediate
Blogs
Amazon Science
Technical deep-dives and perspectives from our scientists who are pushing boundaries across multiple scientific disciplines while solving real-world challenges. Explore how our teams combine research excellence, world...
AmazonIntermediate
WatchHow others solve the same problem, on video.
Videos belong to their creators and play from YouTube. More on YouTube (opens in a new tab)
See it in another companyThe same ideas, a different system.
Case Studies · Read here
Aroma: Using ML for Code Recommendation at Facebook
Thousands of engineers write the code to create our apps, which serve billions of people worldwide. This is no trivial task—our services have grown so diverse and complex that the codebase contains…
FacebookIntermediate
Case Studies · Read here
Concourse: Generating Personalized Content Notifications in Near-Real-Time at LinkedIn
Social media are computer-mediated platforms that facilitate creation and sharing of information, ideas, career interests, and other forms of expression via virtual communities and networks. In the last few years, not...
LinkedInIntermediate
Keep learning
Loading community…