Open borisroman opened 3 months ago
Technically it would be easy to replace the sonyflake id generator with any desired generator as long as it covers the interface.
type Generator interface {
Next() (string, error)
}
I will move this to the Backlog as if there is interest in it people can react on the issue. Contributions are welcome as well, not quite sure if it's a good first issue, but should not be that much work to implement.
@stebenz Thanks for the comment!
I've provided an implementation in #8306. However, before I rebase and adjust that PR, #8693 needs to be merged first.
Preflight Checklist
Describe your problem
Introduction
Zitadel, an open-source authentication and authorization platform, currently employs an ID generation interface with a single implementation based on Sonyflake . While Sonyflake offers several advantages in terms of distributed ID generation, we propose adding a second ID generator based on UUIDv7 to enhance integration capabilities into systems which are fully UUID-based.
Current ID Generation: Sonyflake
Sonyflake is a distributed unique ID generator inspired by Twitter's Snowflake. It focuses on lifetime and performance in environments with multiple hosts and cores.
Proposal
We would like to integrate another ID generator into Zitadel to enhance the platform's flexibility and integration capabilities. While Sonyflake's robust multi-machine support and extended ID lifetime are advantageous, many of our implementations do not require such extensive distribution. UUIDv7's time-sortable and globally unique IDs offer performant database indexing, precise timestamping, and simplified operations without the need for translation tables. This addition will cater to a broader range of use cases.
Why?
Higher Integration Capability: UUID-based resources integrate seamlessly into our existing technology stack, eliminating the need for translation tables.
Monotonic Capabilities: Like Sonyflake, UUIDv7 offers monotonic capabilities, ensuring the time-order of generated IDs.
Simplified Operations: The unique and time-sortable nature of UUIDv7 simplifies operations in databases and distributed systems, reducing complexity and overhead.
Open for Discussion
We propose the integration of UUIDv7 as an additional ID generator in Zitadel to enhance flexibility and meet diverse needs. This proposal is open for discussion, and we invite feedback and suggestions from the community to ensure the best possible outcome.
Thank you for considering this proposal. We look forward to your input.
Describe your ideal solution
As a developer I would like to have a UUID-based ids for resources.
Version
2.56.0
Environment
Self-hosted
Additional Context
No response