不想在数据库中存储属性
我的微服务中有一些属性。它们发生了很大的变化,所以我想将它们存储在微服务之外的某个地方,这样我就不必一次又一次地取消部署。一种解决方案是将它们存储在数据库中,但这样效率会较低。您能告诉我一个可以存储它们的解决方案吗?
基本上这个微服务被很多人使用。我希望在部署微服务时读取该文件一次(除非或直到文件发生某些更改)以最大程度地减少调用。
I have some properties in my microservice. They are changed a lot so I want to store them somewhere out of microservice so that I don't have to undeploy it again and again. One solution is to store them in database but it will be less efficient that way. Can you advise me a solution where I can store them?
Basically this microservice is used by a vast number of people. I want that file to be read ONCE when microservice is deployed (unless or until there is some change in the file) to minimize the calls.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

您应该使用 Spring Cloud Config ,它可以使用集中式服务器它公开了一个 Git Repo,您可以使用它来存储特定于环境的配置文件(application.properties)
You should use Spring Cloud Config which enables to use a centralized server which exposes a Git Repo which you can use to store environment specific configuration files (application.properties)