Recently made a short URL service di81.com

Source: Internet
Author: User

recently made a short web site service: di81.com

There is a demand in the project, the long web site needs to be shortened to short URLs, the results by SMS, and other channels to push to the customer. Just started to use the online ready-made services directly, and then on a weekend suddenly preface want to achieve a unique long URL (text) shortened service.

As a result of the socket service, there are some impressions of the package arrangement of the packet, so the short URL service My first reaction is to design the data storage format, I do not use the database, but the use of 2 files to achieve:

Url.db stores the long URL text submitted by the user, Url.idx stores the data index, records the location (Begin) and length of each commit data (length), and some accompanying information (hits,datetime). Because each time you add a long URL, the two files are append, so even if the two files are large (for example, several gigabytes), there is not much IO pressure.

Recently made a short URL service di81.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.