What if my nid reaches the maximum allowed value of MySql int type

I have made a drupal.org site search that ends up Here. And also i found Integer Types (Exact Value). In an app that i am about to build is a contact manager for students. Which is supposed to pull gmail, fb contacts in future. My plan is to make each contact a node. Is it a good idea to keep each contact as separate node? Can you suggest any other brilliant mechanism to handle this?

I am worried about the overflow of nid as i made a test run using may own gmail id, which ends up in a 1025 new nodes.

I am using typical Drupal 7.14 installation.

  • 1
    I checked to see that nid in node table is of type int(10). That means we can have 10! number of nodes. I don't think that your requirement might extend that value...
    – AjitS
    May 30, 2012 at 10:46
  • @indrock 10! number of nodes means ? 10K ?
    – niksmac
    May 30, 2012 at 10:47
  • 1
    According to my Mac's calculator 10! = 3,628,800
    – Clive
    May 30, 2012 at 11:00
  • 2
    @NikhilMohan : look for my comment above :-) Actually for normal int type, you'll have values from 0 to 2^32 − 1 or 4294967295 that is something above 4 billion. I'm doubtful that your database would go beyond that.
    – AjitS
    May 30, 2012 at 12:57
  • 3
    See here : max unsigned int is 4,294,967,295. No need for complicated maths : just RTFM :D.
    – Countzero
    May 30, 2012 at 13:21

1 Answer 1


If nid reaches the maximum your site will no longer be able to create new nodes as there will be SQL errors whenever Drupal tries to insert a new nid.

Chances are though, that drupal.org will hit this limit before you do, regardless of what you're doing to your site in any useful real-world application.

If drupal.org gets anywhere close to 4 billion nodes, there definitely will be a workaround readily available for you.

  • Upvote for creativity in the answer.
    – Gokul N K
    Sep 25, 2013 at 11:00
  • @NikhilM would you consider marking my answer as correct? Feb 9, 2014 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.