Skip to content
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

Whether SPI can be added for shardingjdbc driver to enable the community to expand more url support #22834

Open
Zhai6319 opened this issue Dec 12, 2022 · 11 comments

Comments

@Zhai6319
Copy link

Feature Request

Whether SPI can be added for shardingjdbc driver to enable the community to expand more url support

Hopes to provide SPI for org.apache.shardingsphere.driver

The community can expand relevant plug-ins
For example:
spring.datasource.url=jdbc:shardingsphere:classpath:xxx.yaml The classpath in this configuration can be configured as nacos, spring cloud config or other configuration centers
jdbc:shardingsphere:{nacos/spring-cloud-config/classpath}:{ip}:{port}:{username}:{password}:{namespace}:xxx.yaml
Then drive plug-ins to obtain different configurations

@zhaojinchao95
Copy link
Contributor

Sounds good, need more feedback and discuss.

@RaigorJiang
Copy link
Contributor

Is the effect similar to configuring these information in cluster mode of YAML ?

@zt9788
Copy link

zt9788 commented Dec 13, 2022

@zhaojinchao95 @RaigorJiang relevance issue #22790

@Zhai6319
Copy link
Author

Sounds good, need more feedback and discuss.

What information does metadata store?
Why do I use cluster mode
After starting the service once
Change the configuration again and restart. The changed configuration does not take effect
Whether this part of configuration data should not be registered as metadata
Should metadata be changed according to the latest configuration data

I always find cluster mode awkward to use
Nobody feels the same as me?

@Zhai6319
Copy link
Author

Regression

The client sdk provided by nacos provides relevant interfaces
The nacos configuration center also provides relevant http interfaces
I think you can get the relevant yaml configuration from the configuration center by changing the url format
After you get the yaml configuration, the following processing is the same
I believe that other configuration centers besides nacos also provide relevant interfaces

The url format can be consistent with other data source formats
jdbc:shardingsphere:nacos://127.0.0.1:8848/{namespace}?username={xxx}&password={xxx}&group={xxx}&dataId={xxx.yaml}

@zt9788
Copy link

zt9788 commented Dec 13, 2022

Sounds good, need more feedback and discuss.

What information does metadata store? Why do I use cluster mode After starting the service once Change the configuration again and restart. The changed configuration does not take effect Whether this part of configuration data should not be registered as metadata Should metadata be changed according to the latest configuration data

I always find cluster mode awkward to use Nobody feels the same as me?

If the service is deployed in containers, it is more difficult to configure

@wanghongbin73

This comment was marked as duplicate.

@RaigorJiang
Copy link
Contributor

Hi @wanghongbin73
Only English is accepted here, thank you!

@wanghongbin73
Copy link

The configuration method after ShardingSphere-jdbc 5.3 is too unfriendly for the current spring cloud method.
We use the config configuration center. The production environment and the test environment use the same image container. The yml of each environment is the pulled configuration center information.
However, according to the 5.3 configuration, sharding.yaml needs to be packaged into the jar package. The current project cannot be upgraded and the new project cannot adopt the new version

@RaigorJiang
Copy link
Contributor

@wanghongbin73
Thanks for the feedback, this question really needs to be considered.
There is also a reason for ShardingSphere to remove the previous Spring configuration, because the configuration method of SpringBoot has changed again, and adapting it will bring a lot of extra work to the ShardingSphere community.

@wanghongbin73
Copy link

@RaigorJiang
Thank the ShardingSphere community for its hard work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants