Using base64 encoding, a 6 letter long key would result in 64^6 = ~68.7 billion possible strings A reasonable question would be, what should be the length of the short key? 6, 8 or 10 characters. This encoding could be base36 () or base62 () and if we add ‘-’ and ‘.’ we can use base64 encoding. The hash can then be encoded for displaying. We can compute a unique hash (e.g., MD5 or SHA256, etc.) of the given URL. We can generate the unique url offline and use it. Generating unique numbers using Zookeeper. The third one works but is expensive Total unique combinations Second one is possible if our datastore provides the feature. In the first once there can be a Race Condition. A NoSQL choice would also be easier to scale.ģ way to generate a Tiny Url without collision. ShortURL, plugin, WordPress, plugins, joshua schachter, tr.im, bit.What kind of database should we use? Since we anticipate storing billions of rows, and we don’t need to use relationships between objects – a NoSQL key-value store like DynamoDB, Cassandra or Riak is a better choice. I’ve used this plugin for months, with nothing but joy in its cleverness and usability. You’re not limited to shortening your own URLs, although that’s mainly how I use it you can also shorten third-party URLs, turning your site into a miny TinyURL. It provides simple statistics, telling you how many times a link has been clicked, sets up redirects automatically, allows you to choose a custom link style, and more. The Short URL Plugin for WordPress installs automatically. There is no way for us to monetize URL shortening - users won’t pay for it - and we just can’t justify further development since Twitter has all but annointed bit.ly the market winner. No business we approached wanted to purchase tr.im for even a minor amount. Tr.im is now in the process of discontinuing service, effective immediately…. Rolling your own mini-URLs lessens the chance that your carefully cultivated links will rot if the third-party URL shortening site goes down or goes out of business, as is happening to tr.im, a URL shortener that is pulling the plug because it could neither monetize nor sell its service. Likewise, /x/49 redirects to yesterday’s big post, “ Write When Inspired.” Thus I use /x/48 instead of a much longer URL to notify my friends on Twitter about a new comment on an oldish thread. I’ve done some of that here, via the ShortURL plug-in for WordPress. One of Joshua’s recommendations to minimize some of the harm is that websites do their own URL shortening instead of relying on middlemen. There’s more, and you should read it all. Each is harmed to some extent by URL shortening. There are three other parties in the ecosystem of a link: the publisher (the site the link points to), the transit (places where that shortened link is used, such as Twitter or Typepad), and the clicker (the person who ultimately follows the shortened links). With a shortening service, you’re adding something that acts like a third DNS resolver, except one that is assembled out of unvetted PHP and MySQL, without the benevolent oversight of luminaries like Dan Kaminsky and St. A regular hyperlink implicates a browser, its DNS resolver, the publisher’s DNS server, and the publisher’s website. Hortening services add another layer of indirection to an already creaky system. The prescient post concludes that, despite their benefits, such services ultimately harm the web, decreasing clarity while increasing the odds of linkrot and spam: (Missing from Joshua’s account of their utility is the benefit URL shorteners can provide when sharing an otherwise obscenely long link on the printed page.) In April of 2009, in a post every web designer, publisher, or business person should read, Joshua Schachter told how URL shortening services like TinyURL and Bit.ly came to be, and why the latest ones were so addictive.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |