9
9

More than 5 years have passed since last update.

Rubyで書かれたSnowFlakeライクなID生成器 `ChiliFlake`

Posted at

概要

ちょっとサービスを開発しているのですが、ID生成器について調べていたところ、こちらの資料に触発されて、SnowFlakeをRuby実装してみました

chiliflake-serverは、ChiliFlakeで生成したIDをTCP経由またはUNIX Domain Socket経由で取得できるサーバです

Rubyの他には何も要りません。たぶんJRubyでも動くでしょう。ただし、daemon化とか考えてませんので、foremanとかで動かしてください

UNIX Domain SocketとTCP socketのパフォーマンスの違いは、TCP localhostとUnix Domain Socketはどちらが速いのか? - Qiitaをご覧ください
Unix Domain Socketの方が性能いいです

名前の由来は、なんとなくお察しください

参考資料

あとがき

こんなことに時間を使っていて、いいのだろうか

9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9