A universal, flexible, and high-performance distributed ID generator for Java applications.
CosId is a Java-based distributed ID generator that provides multiple algorithms like SnowflakeId and SegmentChainId for high-performance, scalable ID generation. It solves common issues such as machine ID allocation, clock backwards problems, and integrates seamlessly with databases and sharding frameworks.
Java developers building distributed systems, microservices, or applications requiring scalable and unique identifier generation, especially those using Spring Boot, ShardingSphere, or MyBatis.
Developers choose CosId for its exceptional performance (up to 127 million ops/s), flexibility in algorithm choice, and out-of-the-box integrations with popular Java ecosystems like ShardingSphere and MyBatis.
Universal, flexible, high-performance distributed ID generator. | 通用、灵活、高性能的分布式 ID 生成器
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
SegmentChainId achieves ~127 million ops/s in JMH benchmarks, making it one of the fastest Java ID generators available for high-throughput systems.
Offers multiple algorithms like SnowflakeId with configurable bit allocation and SegmentChainId for lock-free performance, catering to different scalability needs.
Provides plugins for ShardingSphere (e.g., COSID_INTERVAL sharding) and MyBatis for automatic ID generation, reducing boilerplate code in Java applications.
Includes ClockBackwardsSynchronizer to mitigate SnowflakeId clock issues with configurable thresholds, improving reliability in distributed environments.
Relies on external systems like Redis, JDBC databases, or ZooKeeper for machine ID and segment distribution, adding deployment and maintenance overhead.
The extensive YAML configuration with numerous tunable parameters (e.g., safe distance, prefetch period) can be overwhelming and error-prone for new users.
Different CosId versions are tightly coupled to specific Spring Boot releases (e.g., v2.x for Spring Boot 3.x), complicating upgrades and compatibility.