educative.io

Educative

Data Sharding - How is the combine sharding diffrent from a random id

How is the combine sharding of the epoc time and a sequence diffrent from using a completly random ID for the tweet id? I don’t see what value it brings to use the epoc time in the id other then to simplify the randomization of the Id.

I only see us doing 2 types of requests to the tweets table, get tweet by id and get tweets by user so while we would need creation time later for timeline generation and such, it would not be at the request time. (Given that i have not read the facebook newsfeed question yet)

If what i am saying above is correct (Please correct me if i am wrong), i think the section should be updated as this just causes unnecessary confusion. We have auto incrementing services already, this should be able to provide us with unique id’s which has been discussed before (Example by adding epoch to an auto incremented number).