TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: opensource solution for URL shorter?

2 pointsby jacktangalmost 16 years ago
I always want to know what's the challenge of shorting long URL.

2 comments

digamber_kamatalmost 16 years ago
Since you just want to know the challenges and are not really concerned about "whether url shortening is a good thing" I will put one challenge here. I am sure there will be many more.<p>At a higher level there is nothing difficult. you have to only maintain a table with shortened code to actual url mapping and then use HTTP redirection requests to redirect the URL. But what should be the length of that shortened code ? Should it be fixed or variable ? How do you generate that shortened code? Can the same URL have different codes? Should we generate the code based on some hash stuff (in such a case looking up for duplicates will be simple) or should we just increment the last generated code ?<p>Once this is done let us say we create a table in mysql with code =&#62; URL mapping. The able type is MyISAM which supports only table level locking<p>If there happen to more writes on table than reads. The read operation becomes slow. Hence the table type needs to be InnoDB which supports row level locking.<p>These issues might be corner issues but they do exist and sometimes they can matter as well.
评论 #680566 未加载
dotcomaalmost 16 years ago
is it something interesting to do for a hacker?<p>who pays the bandwidth bills?<p>what do you get out of it?