-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leaf key generator implementation for Apache ShardingSphere #1775
Comments
assign to me? @terrymanu |
Cannot assign issue if your account is not in apache LDAP. |
@tristaZero. @terrymanu. I'd like to take the issue. Could you make an explanation of the new feature? Is it means creating a new generator which implements ShardingKeyGenerator in 'org.apache.shardingsphere.core.keygen.impl' package? |
Yes, you can reference https://tech.meituan.com/MT_Leaf.html |
@terrymanu. I've read the reference. There are two kinds of generators in the leaf. One is leaf-segment and another is leaf-snowflake. I'd like to start with leaf-segment. The leaf-segment algorithm needs a third component to recode the latest id segment. The third component could be a database or zookeeper. I prefer to choose zookeeper to recode the latest id segment. Because, if id segments stored in a database, a conflit may happen when the table name of id segment is the same as another table of service. Another reason for using zookeeper, is that the zookeeper is necessary for leaf-snowflake. So, do you have any suggestion for me? |
Start from leaf-segment and use zookeeper t store for id segment is good idea. |
@terrymanu. Thank you. I've got it. |
Is a bad idea! |
@Yaccc, why? |
@terrymanu. These days I've been reading through the source code of the key generator and registry center related. I'd like to discuss with you at the plan of coding leaf generator.
|
@wgy8283335 Thank you for pay attention on this issue.
I prefer the agree your point, because reg module is for orchestration only, not for sharding-core, so just copy some core codes to leaf plugin is fine.
Yes, it should use new parameters, and we can put them to properties to let leaf plugin to read them. |
Modifying API of generating gobally unique ID, and providing alternatives of gobally unique ID generator for users now is ongoing.
To meet users' different needs and make the module of globally unique ID key generator more powerful, we plan to implement Leaf key generator for ShardingSphere.
Welcome @Zhaodong Xie, the author of Leaf, to contribute to Apache ShardingSphere. He will be in charge of Leaf key generator implementation for Apache ShardingSphere.
[1] https://tech.meituan.com/MT_Leaf.html
The text was updated successfully, but these errors were encountered: