Use Cases

1, shortening : take a URL => return a much shorter URL

2, redirection : take a short URL => redirect to the original URL

3, custom URL : http://goo.gl/Trump2016

4, High availability

5, Analytics :

6, Automatic link removal

7, Manual link removal : e.g. porngraphy

8, UI vs. API, see http://goo.gl

Constraints:

make some guess about the volume

1, new URLs per month : 100 million   => because twitter daily tweets:

2, request per month : 1 billion =>

3, 10% for shortening and 90% for redirection

4, Requests per second : 400+ (40 : shortens, 360 : redirects)

5, 500 bytes per URL

6, 6 bytes per hash

Abstract Design:

1, Application service layer - services the requests

* shortening service

* redirection service

2, Data storage layer - keeps track of the hash<->URL mapping

* Acts like a big hash table

Bottlenecks:

1, traffic - how much, estimation, probably not the problem

2, data volume - quickly look up and insertion

3, how to split (scale)

URL shortening service的更多相关文章

  1. Design Tiny URL

    Part 1: 前言: 最近看了一些关于短址(short URL)方面的一些博客,有些博客说到一些好的东西,但是,也不是很全,所以,这篇博客算是对其它博客的一个总结吧. 介绍: 短址,顾名思义,就是把 ...

  2. [LeetCode] Design TinyURL 设计精简URL地址

    Note: For the coding companion problem, please see: Encode and Decode TinyURL. How would you design ...

  3. [LeetCode] Encode and Decode TinyURL 编码和解码精简URL地址

    Note: This is a companion problem to the System Design problem: Design TinyURL. TinyURL is a URL sho ...

  4. 535. Encode and Decode TinyURL 长短URL

    [抄题]: TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problem ...

  5. GO语言的开源库

    Indexes and search engines These sites provide indexes and search engines for Go packages: godoc.org ...

  6. leetcode bugfree note

    463. Island Perimeterhttps://leetcode.com/problems/island-perimeter/就是逐一遍历所有的cell,用分离的cell总的的边数减去重叠的 ...

  7. javascript,HTML,PHP,ASP做301跳转代码 SEO优化设置

    URL HTTP Redirection URL http redirection is an automatic URL change operation from one URL to anoth ...

  8. Go语言(golang)开源项目大全

    转http://www.open-open.com/lib/view/open1396063913278.html内容目录Astronomy构建工具缓存云计算命令行选项解析器命令行工具压缩配置文件解析 ...

  9. [转]Go语言(golang)开源项目大全

    内容目录 Astronomy 构建工具 缓存 云计算 命令行选项解析器 命令行工具 压缩 配置文件解析器 控制台用户界面 加密 数据处理 数据结构 数据库和存储 开发工具 分布式/网格计算 文档 编辑 ...

随机推荐

  1. IIS7.5 配置ASP+ACCESS使用环境(转)

    Win7默认不安装IIS7.5. 安装的步骤为:开始-控制面板-程序-打开或关闭Windows功能-Internet信息服务.IIS7.5安装时需要注意的是,如果需要ASP.ASP.NET等的支持,是 ...

  2. LanguageImage尺寸

    iPhone Portrait iOS 8-Retina HD 5.5 (1242×2208) @3xiPhone Portrait iOS 8-Retina HD 4.7 (750×1334) @2 ...

  3. Linux的经常使用命令(1) - 指定执行级别

    命令:init [0123456] 执行级别 0:关机 1:单用户 2:多用户状态没有网络服务 3:多用户状态有网络服务 4:系统未使用保留给用户 5:图形界面 6:系统重新启动 经常使用执行级别是3 ...

  4. IOS简单的渐变绘制

    本文转载至 http://www.cnblogs.com/flychen/archive/2012/09/18/2690264.html 前几个星期项目中的音乐列表左边要添加阴影,做成平滑的效果.如图 ...

  5. memcached 搭建

     linux 下memcached 的搭建 memcached 下载地址:http://www.danga.com/memcached/dist/ libevent 下载地址:http://libev ...

  6. mysql双机热备+heartbeat集群+自动故障转移

    环境说明:本环境由两台mysql 数据库和heartbeat 组成,一台的ip 为 192.168.10.197,一台为192.168.10.198,对外提供服务的vip 为192.168.10.20 ...

  7. Hibernate连接池设置

    在公司第一次做项目放到服务器上测试,发现每隔一段时间不用数据库就连接不上了(以前学过连接池,很久没用就忘了),在myeclipse上的时候没发现,网上搜索才发现是hibernate连接池配置问题. 1 ...

  8. squid代理缓存服务器

    参考文章 http://www.cnblogs.com/mchina/p/3812190.html ;

  9. 我的Android进阶之旅------>Android使用正则表达式匹配扫描指定目录下的所有媒体文件(音乐、图像、视频文件)

    今天使用正则表达式匹配指定目录下的所有媒体文件,下面将这份代码简化了,可以收藏下来,当作工具类. package match; import java.io.File; import java.uti ...

  10. subline 的常用命令

    zsh 配置 编辑zsh 命令 vim .zshrc alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/b ...