Skip to content

Commit

Permalink
docs: update doc and close some issues
Browse files Browse the repository at this point in the history
* close doocs#133 
* close doocs#134
  • Loading branch information
yanglbme authored Dec 15, 2019
1 parent dadb70f commit 3058218
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/high-concurrency/database-shard-global-id-generate.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
适合的场景:如果你是要随机生成个什么文件名、编号之类的,你可以用 UUID,但是作为主键是不能用 UUID 的。

```java
UUID.randomUUID().toString().replace(-”, “”) -> sfsdf23423rr234sfdaf
UUID.randomUUID().toString().replace("-", "") -> sfsdf23423rr234sfdaf
```

### 获取系统当前时间
Expand Down Expand Up @@ -168,4 +168,4 @@ public class IdWorker {

利用这个 snowflake 算法,你可以开发自己公司的服务,甚至对于机房 id 和机器 id,反正给你预留了 5 bit + 5 bit,你换成别的有业务含义的东西也可以的。

这个 snowflake 算法相对来说还是比较靠谱的,所以你要真是搞分布式 id 生成,如果是高并发啥的,那么用这个应该性能比较好,一般每秒几万并发的场景,也足够你用了。
这个 snowflake 算法相对来说还是比较靠谱的,所以你要真是搞分布式 id 生成,如果是高并发啥的,那么用这个应该性能比较好,一般每秒几万并发的场景,也足够你用了。

0 comments on commit 3058218

Please sign in to comment.