Facebook’s Hydra
Configuration is always essential for any programming language. Spring’s configuration is the best and perfect solution for Java. In Python, there is no comparable solution. Facebook’s Hydra is another attempt to provide a solution based on YAML.
Configuration in software is to externalize settings so that users can alternate software behaviors. However, tackling only configuration is not enough to serve the purpose because configuration penetrates into internal structure, i.e., it has to know internal components in order to configure. Spring uses beans for universal representation of components and configuration. The bean structure provides grouping of specifications, like plastic bags for grocery shopping. I don’t see similar structure in Hydra, need more time to investigate.
Spring uses XML for bean structures. For universal treatment, it uses XML for configuration beans as well as component beans. This fact results that many folks do not like it because they prefer compilable code for component dependency. However, the new solution based on YAML, such as Spring Boot, is not my favorite either. First, there is only one key-value pair per line and so the settings are really long. Second, many of the settings for different components have to be in one file, because we can’t include one YAML in another. Last, YAML can not be used for component configuration. Though this is arguable since component configuration is not property configuration, it would be convenient if there is an uniform way to treat both configurations.
Software applications are trees of components. configuration settings can sit on any tree nodes/components. We may have many application level configurations, such as dev, uat, and prod. In each application configuration, we may choose to override some of the default configurations. Spring uses XML file order for overriding, Spring Boot uses profiles. Both can override many settings from a file, in a manageable/grouping fashion. Hydra does this from command line switches. This is convenient for small numbers of overriding, but will be messy for many.
We need a better YAML, YYAML.
本文探讨了软件配置管理的重要性,对比了Spring和Facebook的Hydra在配置解决方案上的不同。Spring通过XML和YAML提供全面的组件配置,而Hydra基于YAML,但在配置的灵活性和深度上有所欠缺。
1万+

被折叠的 条评论
为什么被折叠?



