From 3ffd8c4254f75f2155603fb3f2ab38cddf4959c4 Mon Sep 17 00:00:00 2001 From: Yoshiyuki Mineo Date: Mon, 7 Oct 2019 16:40:37 +0900 Subject: [PATCH] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 747518e..760c50d 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,24 @@ Sonyflake [![Go Report Card](https://goreportcard.com/badge/github.com/sony/sonyflake)](https://goreportcard.com/report/github.com/sony/sonyflake) Sonyflake is a distributed unique ID generator inspired by [Twitter's Snowflake](https://blog.twitter.com/2010/announcing-snowflake). + +Sonyflake focuses on lifetime and performance on many host/core environment. +So it has a different bit assignment from Snowflake. A Sonyflake ID is composed of 39 bits for time in units of 10 msec 8 bits for a sequence number 16 bits for a machine id +As a result, Sonyflake has the following advantages and disadvantages: + +- The lifetime (174 years) is longer than that of Snowflake (69 years) +- It can work in more distributed machines (2^16) than Snowflake (2^10) +- It can generate 2^8 IDs per 10 msec at most in a single machine/thread (slower than Snowflake) + +However, if you want more generation rate in a single host, +you can easily run multiple Sonyflake ID generators concurrently using goroutines. + Installation ------------