The Facebook User 2.1billion Bug

We all remember the Y2K bug back in the millennium when the clocks changed from ’99 to ’00. The Y2K bug (although it never did really materialise) resulted from computer programmers storing years as two-digit numbers. 99 was the biggest possible value, and after that, the year reset itself to 00.

Bitscuits
Creative Commons License photo: barnoid

A similar bug is the Year 2038 bug. In computing, times are often stored as the number of seconds which have passed since midnight on the 1st January 1970. This allows time to be stored as a single integer in computers. At the moment, times tend to be stored as 32-bit integers. For signed 32-bit integers, only values between −2,147,483,648 to +2,147,483,647 can be stored. Hence, computers with 32-bit times cannot store any date more than 2,147,483,647 seconds after 1st January 1970. That occurs on Tuesday, 19 January 2038. We’ve still got 29 years to prepare for that eventuality, but we’re going to see a bit of a taste of the 32-bit integer bug with Facebook soon.

Facebook user IDs are often stored as 32-bit integers – thats a problem when there are more than 2.1 billion users on Facebook. In a message to Facebook Application developers, Facebook wrote on their platform status page:

With the addition of features like internationalization and Facebook Connect, we have seen a significant increase in user growth and engagement. As a result of this growth, we’ll start to issue uids greater than 2^32 in a few months. We wanted to remind developers that uids should be stored using 64-bit integers, as documented at http://wiki.developers.facebook.com/index.php/User_id. Since all current uids passed to applications are less than 2^32, developers may have inferred a 32-bit uid format. We are making this announcement so that any such developers have time to migrate code and databases before the first 64-bit uid is sent to applications.

Partytunnel
Creative Commons License photo: cosmonautirussi

Essentially, we’re being warned that users who sign up to Facebook after the date which Facebook hits 2.1 billion could find themselves running into issues accessing sites and applications which integrate with Facebook. I’m not sure how close to 2.1 billion Facebook are – one of my friends who signed up a month or two ago had a user ID of 1.64 billion. I’m not sure how quickly Facebook is gaining users and when they’ll hit 2.1 billion but Facebook have told us developers that we need to upgrade our applications now to ensure that they work for everybody.

My User ID is in the range of 710 million which is still larger than 84% of my friends; indicating I was a bit late to Facebook. I don’t know of anybody with a user ID smaller than 500 million. I wonder if small Facebook IDs will become one of those future status symbols.

2 thoughts on “The Facebook User 2.1billion Bug

  1. Don’t wish to be flippant – but shouldn’t approx 8 to 10% of the world’s population have an id less than 500 M – assuming user ids started somewhere around 0? Put another way – shouldn’t approx one quarter of all user ids in current circulation be below that threshold?

    The fact that you can’t find anyone with such a number would point to the ids not being zero based – and therefor the story about 2Billion plus users looks like marketing hype – targetted at the blogsphere.

    Seriously – one third of the world’s population on Facebook? I doubt one third of the UK are on there – never mind factoring in the lack of internet access for much ( most ?? ) of the world’s population.

    Has to be marketing hype. If they were truly worried about running out of userids they’d simply wipe ‘dead’ accounts and re-cycle the account numbers.

  2. The article assumes that facebook userids started from 1 and increment by 1 with each new user.
    That is not the case.

    (so a userid of 1.64 bn doesn’t actually mean that there are that many users in the database)

Leave a Reply

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