sony/sonyflake

A distributed unique ID generator inspired by Twitter's Snowflake

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 54 minutes ago
Type:Library / SDKCategory(s):Core & Utility LibrariesLanguages & Runtimes
Added to GitGenius on September 15th, 2026
Created on May 29th, 2015
Open Issues & Pull Requests: 7 (+0)
GitHub issues: Enabled
Number of forks: 331
Total Stargazers: 4,413 (+0)
Total Subscribers: 53 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 23.8 hours
Mean response time: 29.8 days
90th percentile: 65.1 days
Tracked items: 10

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 4
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 610 days
Stale 30+ days: 4
Stale 90+ days: 4

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Sonyflake is a distributed unique ID generator inspired by Twitter's Snowflake.

Sonyflake addresses the need for generating unique IDs across distributed systems by allocating bits differently than Snowflake to optimize for lifetime and performance in multi-host environments. The default configuration uses 39 bits for time in 10-millisecond units, 8 bits for sequence numbers, and 16 bits for machine IDs. This bit assignment extends the ID lifetime to approximately 174 years and supports up to 65,536 machines, though it trades off per-instance generation rate, capping at 256 IDs per 10 milliseconds on a single instance. The tool allows customization of bit assignments and time units to adjust the balance between lifetime and generation rate according to specific needs.

Sonyflake suits projects requiring distributed ID generation across many hosts where extended lifetime matters more than maximum throughput per instance. It works well in cloud environments like AWS, where the tool provides utilities to derive machine IDs from EC2 instance metadata and private IP addresses. The configurable bit allocation makes it adaptable to scenarios where the default trade-offs do not match requirements. For applications needing higher generation rates on a single host, the tool supports running multiple instances in parallel using goroutines.

The project maintains active engagement with practical deployment scenarios, evidenced by dedicated support for AWS VPC and Docker environments through utility packages. The codebase includes example implementations demonstrating real-world usage patterns. Configuration flexibility is a core design principle, with all major parameters—sequence bits, machine ID bits, time unit, and start time—exposed for customization while maintaining validation to prevent invalid configurations.