The Distance Your Content Travels is Related to How Fast it Loads OR  Why I’m Glad the Maine Library System is not a CDN

There is a copious list of case studies and research that consistently demonstrates that the faster your webpage or application loads, the happier your customers are. (The newest and coolest studies can often be found with the #perfmatters hashtag on Twitter).  Tools like AT&T’s Video Optimizer can help you examine the content you are sending, and provide suggestions on how to decrease the size of the content you are delivering, with the reasoning that smaller content can be delivered more quickly – improving the performance of your site or app.

 

But how does distance play a factor?

You’ve never heard of the Millennium Falcon?…It’s the ship that made the Kessel Run in less than twelve parsecs.” – Han Solo, Episode IV

Science and Sci-Fi aficionados have argued about this quote for decades, because (as we all know) a parsec is a distance – about 3.26 light-years.  Did the writers of Star Wars make a mistake, and assume that a parsec was a unit of time and run with the mixup?  The other prevailing theory is that Han found a shortcut.  If Han found a shortcut, can we find a shortcut for the data you are serving to your customers?

Data travels through networks at the speed of light, and that’s pretty darn fast.  But even at the speed of light, a trip across the Atlantic Ocean will add 56 ms to each round trip.  Any long distance trek through a cable will add a significant delay to the delivery of your content.  Add in enough round trips to load an image, and your customers “across the pond” will see a significant delay to the image appearing on their screen.  The added distance is actually slowing down your content from being delivered.

But maybe there is a faster way.  Maybe (just like Han), there is a shortcut that will reduce the distance your content has to travel, allowing it to arrive to your customers with less delay.

The Data Shortcut

Content Delivery Networks (CDNs) are services that host from your server on the ‘edge’ of the network.  Even if your servers are in New York City, the CDN will host up to date content for you in London (and Chicago, LA, Singapore, Sydney, etc.) – removing 56ms from each round trip, and speeding the delivery of your content.  For any developer worried about the performance of their content – using a CDN to get the data to the ‘edge’ of the network is a no-brainer.

Delivery of Books: The Maine Library System

In many ways, a library system is like a CDN – there are multiple locations around an area, and copies of books exist on different nodes of the system where customers can pick them up.  If the desired book is not at the closest node, one can be delivered to that node.

Last week, I was recommended a book by a co-worker.  I was intrigued, so I went to the Maine library website to see if copies were available.  I was really happy to see that not only did the system have 10 copies, but most were available. I knew that if I placed a hold, it would be pulled from a library shelf and transported to my library right away.

Screen Shot 2017-09-16 at 9.34.30 AM.png

I took this screenshot when my hold was listed as “In Transit.”  So, like a traceroute, I can tell which library the book is coming from – Calais F.L.

How Long Will It Take To Arrive?

I know my book is coming, and it’ll be ready for pickup soon. I am relatively new to Maine, and I had no idea where this library was.  And because the distance the book has to travel is directly related to how long it will take to arrive, I mapped it.

Screen Shot 2017-09-19 at 11.20.28 PM.png

It turns out, you can see Canada from the Calais Free Library.  With a good arm, you could probably throw a rock to Canada.  I’m in Southern Maine – 250 miles away.  If speed of book delivery is an important metric – this library seems like a poor choice to serve the book from.

Out of curiosity, I created a map of my library (in green), and all the other libraries with an available copy of my book:

Screen Shot 2017-09-19 at 11.21.40 PM.png

It is pretty clear in this case that every other copy of this book in Maine libraries would arrive to my local library faster than the copy from Calais.  Most of the other copies are closer to me physically, and on a more direct route (I-95) to my library. Distance is really playing a factor in the arrival time of my book.

As a performance engineer, this system is certainly not optimized for speed.  The fastest delivery for my book would have been from ANY of the other libraries in the system.  When you are excited to read a new book, you want it as quickly as possible, and in this case, I was very aware that the system was not optimized for that speed.

Why This All Matters

If your mobile app or website does not use a CDN, your customers may be disappointed by the performance of your application (like I am on the delivery of my book).  So always test your app, and benchmark everything.  Try your site with a  CDN and see if the content is delivered to your endpoints faster.

 

 

Note:  The book is “Weapons of math destruction : how big data increases inequality and threatens democracy” and it arrived at the library today.  I’m going to go grab it tomorrow!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s