Question

I'm writing a URL shortener similar to tinyurl and I'm wondering how to keep track of URL's that are already shortened using my service? For example, tinyurl generates the same tiny URL for the same long URL regardless of who creates it. How can this be achieved that is scalable? Bitly also does this though they generate a new URL per person. However, they are able to track the aggregate (total # of) clicks for the long URL - How?

Thanks,

Was it helpful?

Solution

They store the URLs in their database, associated with the short URL(s). How else would it be done?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top