TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Flake: A Decentralized, K-Ordered Unique ID Generator in Erlang

64 点作者 d2fn超过 13 年前

8 条评论

mjb超过 13 年前
A couple of questions about this:<p>- Why [time, node id, seq] and not [time, seq, node id]? That would improve ordering if you have approximately equal load on each box.<p>- Isn't a 16 bit seq number overkill? Handing some of those bits to the unique ID would have made unique ID assignment easier. Duplicate MACs can and do exist (especially if you buy a lot of hardware from the same vendors).<p>- The quality of the ordering is going to be restricted by the quality of time synchronization within the cluster. Relying on NTP for this is OK, but experience suggests that a secondary monitoring system will be needed. Similarly, relying on monotonic time needs some care in system administration - care that could potentially be avoided with a different unique host ID assignment scheme.
评论 #3461866 未加载
评论 #3462294 未加载
评论 #3463444 未加载
rarrrrrr超过 13 年前
There's also Instagram's implementation in PostgreSQL:<p><a href="http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram" rel="nofollow">http://instagram-engineering.tumblr.com/post/10853187575/sha...</a>
d2fn超过 13 年前
Thanks for the interest and the feedback. I've updated the readme and added a roadmap as well as a faq after getting some good input over the last couple of days.<p><a href="https://github.com/boundary/flake" rel="nofollow">https://github.com/boundary/flake</a>
google-1超过 13 年前
This is quite similar to the BSON ObjectId specification used by MongoDB:<p><a href="http://www.mongodb.org/display/DOCS/Object+IDs#ObjectIDs-BSONObjectIDSpecification" rel="nofollow">http://www.mongodb.org/display/DOCS/Object+IDs#ObjectIDs-BSO...</a>
alpb超过 13 年前
For those interested, there is also Snowflake by Twitter on GitHub <a href="https://github.com/twitter/snowflake" rel="nofollow">https://github.com/twitter/snowflake</a>
评论 #3462023 未加载
rdtsc超过 13 年前
Why not use uuid1 then reorder its bits ?
Raphael超过 13 年前
Is it Erlang day already?
coolrhymes超过 13 年前
as mjb said, mac addresss can be cloned so not sure whats that buying we are using uuid1 which does more or like does what these guys are doing...
评论 #3462600 未加载