Picking Up the Digital Living Room
You know how our homes can get messy. Well, our digital homes can also get messy and cluttered as well. Last week, I received an account notice from my website hosting provider informing me that I was at 80% capacity of my allocated disk space. In plain English, I needed to declutter.
The images stored on the server for this blog, yes all those cutesy photos of Frugal Boy, were taking up about 50% (2.5 GB) of the digital living room. I had four choices.
- Pay $20/month more to double the room size (5 GB -> 10 GB). Then the blog images would only take up 25%.
- Stop blogging
- Delete or downsize existing images. This would be like taking scissors to a shoebox of old photos.
- Move all of those images to a storage locker outside of the house.
I decided to go ahead with option 4. While my hosting provider charges a premium for storage space, there are many other companies that offer abundant storage for cheap. In simple terms, I could keep the same living room and just move all of the junk to a storage locker.
You are probably already familiar with Amazon.com, the mega online retailer. What you may not know is that Amazon offers a variety of web services as well. Collectively, these AWS (Amazon Web Services) power many of the behind the scenes things of websites and mobile apps that you use everyday. One of their most popular services is the S3 storage service. It is a pay for what you use digital storage service. The pricing is a bit complicated because they calculate it on how much space you use and how often you need access to the stuff in that space. Imagine a storage locker that billed you according to how many square feet you used and how many times you put things in or took things out.
While I will have to wait for the dust to settle from moving all of those files over, I estimate that the normal month will cost me less than 50¢.
Content Delivery Network
Going along with our analogy of a storage locker, suppose that the locker is in Virginia and you live in California. It would take a long time to go all the way to Virginia and back to get a photo. Here is an example of a link to one such photo.
http://blog.andrewschenk.com.s3.amazonaws.com/wp-content/uploads/2013/08/Andrew-Shae.jpg
You can see how there is my storage locker name “blog.andrewschenk.com” and that it is in the S3 facility “s3.amazonaws.com”.
Wouldn’t it be more convenient if there was a storage locker in California too and while we’re at it, how about one in every major city in the world. That is what CDNs, Content Delivery Networks, do. They make a copy of the original contents in Virginia and then set up identical lockers all over the world. Now you can go to the locker that is closest to you!
Here is the same image as above, except this time, the link will take you to the closest locker to you.
http://d2ql3eiz1dngwz.cloudfront.net/wp-content/uploads/2013/08/Andrew-Shae.jpg
Amazon offers a CDN service called CloudFront. There are a bunch of other CDN providers out there and any major website that you visit will utilize one.
By using a CDN, I save some money on people making trips to the Virginia facility. It also speeds up the page loading on this website so you have a better viewing experience.
We can go one step further however. While the above URL works just fine, it doesn’t look very pretty. Thankfully, we can mask that and give it a different name. It’s a lot like how 1-800 numbers sometimes use letters and words to make an ugly number easier to remember.
In technical terms, I set up a CNAME alias for the DNS system.
The final result is a URL that looks like this:
http://images.andrewschenk.com/wp-content/uploads/2013/08/Andrew-Shae.jpg
Wrapping Up
In conclusion, by offloading the storage to Amazon I should be able to save about $234 a year. I think I got everything squared away, but if you see a blank box where an image should be let me know what blog post it is and I can take a look at it. Sometimes things get broken in a move!