A distributed unique ID generator using Sonyflake algorithm with Base58 encoding for compact string IDs.
Indigo is a Go library that generates distributed unique identifiers using the Sonyflake algorithm and encodes them as Base58 strings. It solves the problem of creating globally unique, compact IDs across distributed systems without centralized coordination. The resulting IDs are URL-safe and have a maximum length of 11 characters.
Go developers building distributed systems, microservices, or applications that require unique identifiers across multiple instances or services.
Developers choose Indigo for its simple API, thread-safe implementation, and predictable output characteristics. It provides a production-ready alternative to rolling custom ID generation logic while offering encoder customization.
A distributed unique ID generator of using Sonyflake and encoded by Base58
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Sonyflake algorithm to generate 64-bit IDs with timestamp, machine ID, and sequence components, ensuring global uniqueness across distributed systems without coordination, as detailed in the README's key features.
Encodes IDs into Base58 strings that are URL-safe, avoid ambiguous characters, and have a fixed maximum length of 11 characters, making them ideal for web applications and APIs.
Safe for concurrent use in multiple goroutines, demonstrated in the usage example with sync.WaitGroup, allowing reliable ID generation in high-concurrency Go applications.
Allows replacement of the default Base58 encoder with alternative encoding schemes, providing flexibility for different use cases, as mentioned in the README's features.
Tied to the Sonyflake algorithm, which may not suit systems needing different ID structures (e.g., UUIDs) or higher frequency generation beyond its 16-bit sequence limit.
Requires configuration of start time and machine ID, which can be cumbersome in environments without stable machine identifiers or precise time synchronization, adding overhead compared to plug-and-play solutions.
Benchmark shows approximately 39,191 nanoseconds per operation, which might be slower than simpler ID generators like UUID, potentially impacting high-throughput applications.