YouTube has had its own Bill Gates moment this week when it underestimated the number of times any one video would be watched. Just as Bill Gates believed we would never use more than 640k or RAM in a PC YouTube didn’t think a video would ever be watched more than 2.15 billion times.
Then Gangnum style happened to an unsuspecting world in July 2012 and 2 years later what seemed like plenty of space has turned out to be woefully inadequate, hell the first billion views happened in less than 6 months.
When designing a system such as YouTube there are design decisions that must be made, decisions that often require trade-offs. In this case for the counter of each video the designers decided that use a 32bit integer number (no decimal places), enough bits to maintain the view count they must have believed. The decision to use a 32bit number being a trade-off between the maximum number stored and the amount of data required to store it. Use more bits and it adds to traffic and storage requirements.
Not wanting to stop the world’s love affair with Korean pop YouTube got to work building a counter that could contain the Psy’s popularity, shifting to a 64bit number capable of counting up to 9,223,372,036,854,775,808 views when using an integer number.
Thankfully the world is safe once again, YouTube can keep counting and Psy can keep dancing. Now all we need to be sure of is that his bank account can contain the more the a million dollars the YouTube clip is thought to have generated.
Check out the Google+ message from YouTube to mark the occasion.