Skip Navigation

How do social media companies like twitter or youtube not run out of space for posts?

I know memory is fairly cheap but e.g. there are millions of new videos on youtube everyday, each probably few hundred MBs to few GBs. It all has to take enormous amount of space. Not to mention backups.

97 comments
  • Not only that but for each video on YouTube there are different versions for each resolution. So if you upload a 1080p video, it gets converted to 1080p AVC/VP9, 720p AVC/VP9, 480p... also for the audio.

    If you run youtube-dl -F <youtube url> you will see different formats.

    • Does youtube actually store copies of each one? Or does it store 1 master copy and downsaple as required in real time. Probably stores it since storage is cheaper than cpu time

    • I'm keen to know about how large these source files are for YouTube compared to the 720/1080 quality ones were see on the front-end. I remember them using really impressive compression but that the bitrate was super low to keep the since small.

      If they're reducing a 10m 1080p file from 400MB down to 40MB then that's a good gain

  • Enormous servers all around the world and over the years storage is getting smaller and smaller proportionally to how much you can store on it

  • Three additional things that you have to keep in mind are that:

    1 - Enterprise storage is much, much denser (as in, capacity per physical space occupied) than you would expect.
    2 - These systems have capacity recovery features (primarily compression and deduplication) that save a lot more storage than you would expect.
    3 - The elements in the infrastructure are periodically refreshed by migrating them to newer infrastructure (think of how you could migrate two old 500GB disks to a single modern 1TB disk to save the physical space of a disk).

    As an example about point 1, this is what IBM advertises in their public whitepaper for their Storage Scale systems (https://www.ibm.com/downloads/cas/R0Q1DV1X):

    "IBM Storage Scale System is based on proven IBM Storage 2U24 hardware that can be expanded with additional storage enclosures up to 15.4PB of total capacity in a single node and 633YB in a single cluster. You can start with 48TB using half-populated flash nodes or create a fully-populated NVMe flash solution with 24, 2.5” drives in capacities of 3.84TB, 7.68TB, 15.36TB or 30TB. Using the largest capacity 30TB NVMe drives, up to 720TB total flash capacity, in a 2U form factor, along with associated low weight and low power consumption. Adding storage enclosures is easy as up to 8 enclosures (each 4u with 102 drives) can accommodate up to 816 drives of 10TB, 14TB or 18TB or 14.6PB of total raw HDD capacity."

    In short, you end up packing a stupid amount of storage in relatively moderate spaces. Combined with the other two points, it helps keep things somewhat under control. Kinda.

  • Scalable shared storage. Scalable database, web, and cache servers. Using AWS terminology, it's elastic. The Multi-zone storage my own company, for example, is practically infinite and scales automatically.

97 comments