is Perfecting the Art of Caching (or Cashing-in?)

“Depend upon it there comes a time when for every addition of knowledge, you forget something that you knew before. It is of the highest importance, therefore, not to have useless facts elbowing out the useful ones.”—Sherlock Holmes

Reserve Section of a Library (Image Source: Wikimedia Commons)

Caching (pronounced “cash-ing”) in Computer Science is a method of speeding up performance by providing a temporary space where urgent data can be stored for quicker access. It’s a loaded definition. Think of a college library. Let’s say I’m taking Calculus this semester and I don’t want to pay $200 for the text book. I go to the library, request said textbook, do my homework, and then return the book. The librarian walks all the way to the fifth floor to replace the book because “Stewart” is the author’s last name. He returns to his desk only to find another student requesting the same text. It’s a recipe for anger management issues. To keep all librarians sane, libraries have a reserve section. Books that are expected to be frequently requested are kept in a nearby location to speed up the process for all parties involved. This is called “caching.”

Hierarchy of Memory (Image Source: Wikimedia Commons)

Computers are able to perform efficiently because of this same process. Caching creates what we call a “memory hierarchy.” The memory on your hard drive takes a longer time to access than the memory that holds your programs while your computer is on (called “main memory”). Cache memory acts as a buffer between these two which results in a hierarchy based on access time. In order for cache to be of any use, it must be volatile and current. Caching algorithms have to determine when the data in cache memory is no longer useful, and replace it with current data that the user will need. Hence, as Sherlock Holmes rightly observed, forgetting is as important as remembering—a notion exemplified by caching.

I recently stumbled upon an application of caching that the vast majority of us can relate to: Amazon Prime. I was playing around with my delivery options and after changing the shipping address, I saw that my item could be delivered even faster to a different address. It turns out that Amazon is in the caching business. All shipping channels, including air, have limits on speed. So how is it that Amazon can deliver at the rate that it does? Amazon has thousands of fulfillment centers strategically placed throughout the US. These huge fulfillment centers generally defy any type of humanly-comprehensible notion of organization. In fact, incoming items are simply placed wherever there is space. There is one visible exception: items that are high in demand are placed in a different area. This is Amazon’s cache and it allows for faster delivery.

Inside an Amazon Warehouse (Image Source: MaryLand Gov Pics via Flickr)

Amazon analyzes trends in orders based on location and tries to isolate items that are most frequently requested. I can only imagine the complexity of the algorithm used to achieve this, but Amazon is making even bigger strides. According to an article in Forbes Magazine in 2014, “It was revealed recently that has obtained a patent for what it calls ‘anticipatory shipping’ — a system of delivering products to customers before they place an order.” Although Amazon has been granted the patent, implementation will take a while. The general idea is that Amazon will have locally-stored inventories based on order statistics for much smaller regions which will allow for delivery within a few hours. In short, Amazon intends to take its cache to a whole other level. While much is still unknown about the specifics of anticipatory shipping, we can expect that caching will play a major role in making this innovation happen.

At the same time, it is important to acknowledge that Amazon has not become one of America’s most highly valued companies only because of impressive algorithms. Amazon’s warehouses, the enterprise’s nuclei, are driven by the immense manpower responsible for implementing its caching strategies. But efficiency has its price. It is no surprise that the company has routinely come under scrutiny for harsh working conditions and mistreatment of employees in order to meet delivery schedules. We have to wonder if the number of reported abuses won’t skyrocket with the promise of even quicker delivery. There is also the threat to local businesses and community services which anticipatory shipping will most certainly exacerbate. I confess that if my textbook rental were delivered within the hour, I’d never make trips to the local library in the interim that it otherwise takes for normal delivery. So while I’m intrigued by the strategic and technological aspects of anticipatory shipping, I cringe at the human rights and economic issues that are sure to follow.

2 thoughts on “ is Perfecting the Art of Caching (or Cashing-in?)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.