3 ms·
The article says outright that the user IDs are not a reliable scheme for measuring growth, so I'm failing to see the relevance. <speculation> It appears that
by andr 17y ago
The article says outright that the user IDs are not a reliable scheme for measuring growth, so I'm failing to see the relevance.
<speculation>
It appears that they are doing a partitioned autoincrement for their user IDs. For example, if you have 10 servers, you give every server a unique seed between 0 and 9 and have them increment the IDs by 10. So server 1 would produce IDs 0,10,20, etc. Server 2 would give you 1,11,21, etc. This allows you to easily use autoincrements in a sharded environment and to find the shard by looking at the modulo of the ID.
The trick is that you'd usually assign seeds for all servers in the cluster and at least half of them would usually be read slaves (which can become masters if needed). So the real number of users is at least 1/2 of the max user ID. You would also use more partitions than the number of servers you have right now, so that you don't have to readjust existing servers as your cluster grows.
This, of course, is pure speculation.