4 ms·
2 questions: 1) What do they do with the Pinterest-generated ID? Do they store it with each row in addition to the local ID? 2) Why randomly select a shard? S
by jnankin 14y ago
2 questions:
1) What do they do with the Pinterest-generated ID? Do they store it with each row in addition to the local ID?
2) Why randomly select a shard? Shouldn't you do this based on DB size across all boxes, or at least based on physical space left across all boxes?
- jnankin 14y agoOops, 1 is directly mentioned in the talk.
- yashh 14y agoWe decompose 64 bit ids to shard_id, type and local_id. We connect to the shard go to the table and read the local_id. We randomly select a shard for a new user only. Ofcourse we capacity plan this and open new shards and even out users eventually.