HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
twitter-archive
snowflake
Scala2010–2026
twitter-archive / snowflake · Archived

snowflake

Snowflake is a network service for generating unique ID numbers at high scale with some simple guarantees.

22Distinct people
23Mentions
0Explicit recommenders
7.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Snowflake is a network service for generating unique ID numbers at high scale with some simple guarantees.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year23 dated mentions

Observed mentions: 2010-09-19 02:12:44 UTC to 2026-05-11 22:53:15 UTC.

02462010-01-01 00:00:00 UTC to 2011-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments20102011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20102010-01-01 00:00:00 UTC2011-01-01 00:00:00 UTC514
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC000
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC606
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC202
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC303
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC202
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC000
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
We have retired the initial release of Snowflake and working on open sourcing the next version based on Twitter-server, in a form that can run anywhere without requiring Twitter's own infrastructure services. The initial version, released in 2010, was based on Apache Thrift and it predated Finagle, our building block for RPC services at Twitter. The Snowflake we're using internally is a full rewrite and heavily relies on existing infrastructure at Twitter to run. We cannot commit to a date but we're doing our best to add necessary features to make Snowflake fit for many environments outside of Twitter. Source code is still in the repository and is reachable from snowflake-2010 tag. We won't be accepting pull requests or responding to issues for the retired release.
Read the full README on GitHub

What Hacker News says

23 sources
There is source code available for it (although the repo's retired): https://github.com/twitter-archive/snowflake/blob/b3f6a3c6ca... Basically one big server had a number of threads each requesting the next value in the sequence on that machine. The sequence only had to be unique to that machine and was just a counter of how many tweets since <last whole millisecond>. Tweets per millisecond per server was probably never a huge number, so they were able to share the 10 bits between datacenter id and that counter.
In Tell me why this UUID pattern is stupid
"Small Twitter clone" can be taken two ways, and this one, I think, is the less interesting of the two. (Not to denigrate the project for what it is; it's a good idea.) On a one-machine scale, Twitter can be a single Postgres table, or a single ElasticSearch index. At the scale they actually are, it's really a whole lot more. I'd really love a tutorial—or possibly a whole book—that instead took you through setting up the sort of distributed system that is required to make a Twitter clone run at a Twitter-like scale. Either through IaaS APIs, or on your own with something like OpenStack DevStack. It could probably start where this tutorial ends—with a one-node system running a Twitter-backend-alike monolith. And then each chapter would increase the scale, introduce a problem the scale causes, and then walk you through adding in an addition
Read the rest
al component: a message queue; a fragment cache; app-level health checks; a search indexing cluster; distributed logging + request tracing; geographic sharding; multi-master DB replication—in order to solve that scaling problem. There would also be scale-points that would require changes in the business logic: making IDs globally unique and sortable ala https://github.com/twitter/snowflake; deprecating but keeping around old APIs as new ones are added; "Ball of Mud" refactorings; isolated Enterprise clusters of the app; etc. Bonus points if later chapters actually go back and rip out solutions that were introduced in earlier chapters—not because they were mistakes, but just because they were right for 10^3/s but not 10^6/s. And bonus bonus points if they assume an SLA that requires that such switchovers occur without downtime.
In Show HN: Learn how to build a small Twitter clone in 7 days
For internal purposes, a 64 bit GUID will be sufficient. Look how Twitter uses Snowflake - https://github.com/twitter/snowflake - that's a scalable way to generate unique IDs which won't ever be revealed to the user. For default user names, I quite like how gfycat does it - http://gfycat.com/about - AdjectiveAdjectiveAnimal - so a user is given a default name like "ReluctantCandidWombat". Fun, unique, hard to iterate, and hopefully provides an incentive to the user to change it later.
In Ask HN: How do we pick an user ID while building a social-platform?
A topic I rarely see (at least in depth, or in discussion) in stories/blogs about APIs is ID generation, i.e. best practices for creating access_token, resource ID and especially handling collisions. The Flickr blog post [1], which featured a simple implementation of a ticket server, is so far one of the easiest and most secure to use. Personally I don't feel comfortable using "hash of i++", "hash of ...", "i++", as they all "fall apart" when you need ids of different specifications (e.g. a 8-char ID, a 24-char token ID). Anyone have two cents on this? I have a difficult time imagining that larger APIs just "live with" the chance of collision (even though it can be very low) - they must mitigate it somehow, right? combined probability (such as the nonce check and tokens on oauth1 requests)? Actual ticket servers (e.g. [2], [3]) either int
Read the rest
roduce added complexity (and possibly latency) or needs a secondary code base. Regardless, the issue of scaling and latency is rarely touched upon, so if anyone have some input here, I'd greatly appreciate it. EDIT: I've found two interesting links on the problem, [4] [5] (snippit'ed here [6]). [1] http://code.flickr.net/2010/02/08/ticket-servers-distributed... [2] https://github.com/twitter/snowflake [3] https://github.com/boundary/flake [4] http://boundary.com/blog/2012/01/12/flake-a-decentralized-k-... [5] https://blog.twitter.com/2010/announcing-snowflake [6] https://github.com/antirez/redis/pull/295#issuecomment-46734...
In Best Practices for Designing a Pragmatic RESTful API
I imagine many things use Unix time or a similarly flat calendar internally (Twitter's Snowflake[0] uses a custom scale), it's the translation into the Gregorian (/Jewish/Mayan/etc) calendar and time scale where the bugs come from. Can't count on 31540000 seconds being a year, time zones, etc. At the same time, the human brain doesn't seem particularly well-suited to breaking down Unix time into meaningful and reliably consistent scales, so I don't see time getting much easier barring some revolutionary timekeeping system. [0] https://github.com/twitter/snowflake
In iOS 6: Do Not Disturb mode stays on after scheduled time
Maybe you have deep enough experience with Node to avoid the thin ice, but my experience has been one of sparsely-featured and buggy libraries when compared to their counterparts in Python, Java, etc. All languages need time to grow up, but for now we use Node as a pinch-hitter in our stack (I created a Snowflake server with great results) Honestly, Facebook has a lot of frontend code. I don't think Rails is a bad choice for that. My experience with large systems is that they're usually not homogenous. There's no reason they couldn't implement the Rest API components outside of Ruby if that was their biggest obstacle to success. Though I'm not sure it is, because even though you've obviously given this issue some thought, you didn't really articulate who was put off by their use of Rails? Edit: To avoid confusion, Snowflake as in https://
Read the rest
github.com/twitter/snowflake, not "snowflake schema".
In App.net funded with $500,000.
Can you explain what it means to "check the data"? The point here is that, for the last year, Twitter has NOT been generating sequential IDs. Just look at the source code[1]. They save a few low bits for the worker ID, data center, and worker-specific sequence. The highest bits are the timestamp bits. Maybe you can correct me if my assumptions based on the code are wrong, but my guess is you'll magically find that Twitter's highest ID grows linearly with time. Then you're just randomly sampling within this maximum timestamp. At this point you're assuming that Twitter sees a constant rate of signups wrt time, which I highly doubt. [1] https://github.com/twitter/snowflake/blob/master/src/main/sc...
In Some Fresh Twitter Stats (as of July 2012, Dataset Included)

Showing the 15 most recent of 23 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.