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

This lesson's interactive features are locked, please to keep using them

Large Files

So, what are "large files" anyway?

Click to play video

You're probably already familiar with small structured data; the stuff that's usually stored in a relational database like Postgres or MySQL. I'm talking about simple, primitive data types like:

  • user_id (integer)
  • is_active (boolean)
  • email (string)

Large files, or "large assets", on the other hand, are giant blobs of data encoded in a specific file format and measured in kilo, mega, or gigabytes. As a simple rule:

  • If it makes sense to go into an excel spreadsheet, it probably belongs in a traditional database
  • If it would normally be stored on your hard drive as its own file, it probably is a "large file"

Large files are interesting because:

  1. They're large in size (duh) and are thus more performance-sensitive
  2. They're usually accessed frequently, and this combined with their size can quickly lead to performance bottlenecks

Assignment

./samplesdownload.sh

Note that this will download about 60MB of sample files, so depending on your internet connection it might take a second.

xxd <file>

xxd converts the binary content of the file into a human-readable hexadecimal and ASCII formats. You should see a bunch of gobbledegook - that's what a PNG file looks like in its raw form.

xxd -l 8 <file>

You'll see that the first 8 bytes are 89 50 4e 47 0d 0a 1a 0a, which is the PNG file signature. It tells the reader that this is a PNG file, in fact, the characters PNG are present in bytes 2-4.

Run and submit the CLI tests from the root of the repo.