Facebook's Hydra

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值