Automatic sharding and resharidng