第一种方法似乎更像是一种快速破解。检查辅助表时间戳几乎违背了缓存的目的。
第二种选择似乎是好的选择。这可以作为他们任务队列中的一个简单任务来实现,以更新他们自己的配置缓存。
更改多个服务的配置的主要问题是它们的依赖关系。
如果父服务以与其子服务不兼容的配置开始运行,您可能会遇到崩溃或未定义的行为。为了避免这种情况,必须实施同步。
One way is let parent service to update it's configuration and then issue configuration update commands to child services. After all child services are updated, parent would resume processing. Advantage of this approach would be that a simple management console could instruct only parent services about the configuration changes.
Other way is let management console handle dependent services. It would send a command to parent services to pause execution, update config and wait for resume command. In a mean time it would update all child services and instruct parents to resume. This way service dependencies would be more flexible and their configuration would be decoupled from their implementation. This would require a more advanced administration tool.