Chapter 6. S3: cheap, fast file storage

 

As you saw way back in chapter 3, an EC2-based server’s core filesystem is kept on a relatively small Elastic Block Store (EBS) volume. In that case, the volume had only 8 GB to start with, which proved to be more than enough for the example WordPress site. But once they’re running in the real world, most applications—generating, as they often do, fast-growing databases, directories filled with videos, and reams of logs—require far more storage space than an 8 GB or even an 80 GB drive can provide.

Why didn’t we provision a larger EBS volume? Because, relatively speaking, doing so is expensive. A 100 GB general-purpose, solid state drive from EBS will cost you around $10 per month. If there’s a better alternative, you’ll want to know about it. You’ve already seen how large databases can be moved off-site to Amazon’s RDS (although, gigabyte for gigabyte, I’m not sure that will always be cheaper); but what about, say, the media files needed by an application? More often than not, your first choice will be Amazon’s Simple Storage Service (S3). The cost? S3’s most expensive storage option will set you back less than $0.025/month for a gigabyte of data, or less than $2.50/month for 100 GB. So, if your EC2 WordPress server deployment includes providing larger media files for a lot of users, S3 can make a big difference.

6.1. How does S3 work?

6.2. Integrating S3 resources into an EC2-based website

6.3. Using S3 to create a simple static website

6.4. Lab