Skip to content

Commit

Permalink
factor presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
andyxning committed Apr 15, 2016
1 parent 7b5a880 commit 26c883a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![](logo.png)
![](logo.png)
![](https://img.shields.io/badge/version-1.0.0-blue.svg)
### Introduction
----
Expand Down Expand Up @@ -138,6 +138,7 @@ max_open_conns = 8
#### Capacity
----
We use an Mysql `unsigned bigint` type to store the sequence id. According to the [Mysql doc](http://dev.mysql.com/doc/refman/5.7/en/integer-types.html) we can get `18446744073709551616` different integers. However, according to [Golang doc about `LastInsertId`](https://golang.org/pkg/database/sql/driver/#RowsAffected.LastInsertId) the returned auto increment integer can only be `int64` which will make the sequence smaller than `uint64`. Even through, we can still get `9223372036854775808` different integers and this will be large enough for most service.

Supposing that we consume `100,000,000` short urls one day, then the sequence id can last for `2 ** 63 / 100000000 / 365 = 252695124` years.

#### Grant
Expand Down

0 comments on commit 26c883a

Please sign in to comment.