Users want custom short URLs like bit.ly/my-brand. This creates challenges:
Collision handling: Check if alias exists before allowing. This is a simple database lookup.
Reserved words: Block profanity, brand names, and system routes like /api or /admin.
Pricing: Custom aliases are often premium features. Store a flag indicating custom vs generated.
The ID generation changes: if custom, use the provided string. If auto, use your counter or hash approach. Both map to the same redirect logic.