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.