Sharding has nothing to do with the size of identifiers.
The right way to handle this: don't worry about it.
A 32-bit int has enough values ββthat you could add one line per second for more than 100 years without expiration.
And if that was not enough, with a 64-bit int you could add 1 billion lines per second and last more than 500 years.
So basically: don't worry about it. Choose an int size based on how many lines you expect from 100 and then move on.
Re sharding:
This is just a way to split a database into multiple servers, using the rule to decide which server should receive the data. The rules vary depending on what you store and how many servers you have.
source share