mysqlruby-on-railsdatabaseherokucleardb

ClearDB auto-increment


I'm using ClearDB to host the MySQL database of my Ruby on Rails application. Today I observed that the id's of the tables, are jumping on steps of 10, starting on 1: 1, 11, 21, 31, 41.. I searched, and found this:

"I'd guess that your auto_increment_increment is set to something else than 1 because of replication. With replicated tables one cannot use 1 because of potential key collisions."

And on the ClearDB forum I found the same answer.. Ok, but the problem is: if id jumps 10 by 10, won't it increases very fast achieving the integer limit of 11 digits very fast? What happens if this situation occurs? The id's go to 2, 12, 22, 32, 42, starting on 2, then on 3..??

Does someone here that uses ClearDB can answer me, please?


Solution

  • The ID will not wrap around it would conflict with their leader to leader replication scheme.

    It does shorten the Id sequence but only by one digit. If your going to have more than 9,999,999,999 rows, then ClearBD is not the plan for you. As your going to hit a lot of their other limits before the row limit.