We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Downloading a Billion Files in Python

Formal Metadata

Title
Downloading a Billion Files in Python
Subtitle
A case study of multi-threading, multi-processing, and asyncio
Title of Series
Number of Parts
118
Author
License
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
You've been given a task. You need to download some files from a server to your local machine. The files are fairly small, and you can list and access these files from the remote server through a REST API. You'd like to download them as fast as possible. The catch? There's a billion of them. Yes, one billion files. How would would you do this? Would you do this synchronously in a single for loop? Would you use a producer/consumer queue with threads? Multiprocessing? Asyncio? In this talk, we'll examine 3 different mechanisms for concurrently downloading files: multithreading, multiprocessing, and asyncio. For each of these mechanisms we'll look at design best practices, how to handle debugging and error handling, and of course the overall performance. By examining three different approaches using the same data set, we gain a better understanding of the tradeoffs of each approach so we can pick the right library for the job.
Keywords