Fanfou.com/statuses/xmvsu3smr8s
This is a typical URL, I would like to know how the following random letter string is generated? exists in the database? Do you want to query the database for duplicates when you build it?
Reply content:
Fanfou.com/statuses/xmvsu3smr8s
This is a typical URL, I would like to know how the following random letter string is generated? exists in the database? Do you want to query the database for duplicates when you build it?
Reference Weibo 62-binary
Twitter's tweet ID contains timestamps, server numbers, and serial numbers.
Https://dev.twitter.com/docs/twitter-ids-json-and-snowflake
Why is Snowflake?
Snowflake is a service we'll be the using to generate unique Tweet IDs. These Tweet IDs is unique 64bit unsigned integers, which, instead of being sequential like the current IDs, is based on Time. The full ID is composed of a timestamp, a worker number, and a sequence number.
Tweet IDs can be sorted directly by number, so timestamps should be arranged in the front section, so the clocks of each server must be kept in sync.
Rice no ID algorithm is not public, should be similar to the idea.
I guess the background with pure numbers to make sure uniqueness, and then through a certain algorithm, shown as: xmvsu3smr8s, in fact, in the background data table, there may be a pure number of ID field.