Three random digits may not be sufficient to prevent collisions, and detecting duplicates only at insertion time (using a primary key) could be too late. What happens if the system clock drifts? What if you have multiple application servers without perfectly synchronized clocks? Maybe better something like Snowflake ID with less presition on the time but with a node/thread ID and a sequence number per node/thread rather than a small random