Live data from Hacker News

Show HN: Comfygure – A small CLI to manage application configurations

marmelab.com

31–33 of 33 posts

Re: Show HN: Comfygure – A small CLI to manage application configurations

#31

I have the feeling that most developers these days suffer from too much tooling in every area. And would be 2 to 10 times more productive without it. Most friends that I watch doing their deployment would be way more productive by simply using rsync for file changes and raw database queries when the DB needs a change.

I wanted to post this earlier but hit the posting limit, so, here it is, with apologies for the delay forced upon me:

Tooling is literally just tools. You can have good ones and bad ones and either use them well or use them poorly. A deployment tool like Capistrano or deploybot is a tool, but so is a shell script that runs rsync the the same way each time it's invoked.

An automated deployment process that involves either zero or minimal human work, (e.g. 'click a button' or 'push to branch X in dvcs') means you get repeatability, and with that comes reliability. How many deploys will be messed up if someone is manually running rsync, because they forgot to exclude some files/dirs, or because they had a trailing slash in a path and things got put 1 directory level too deep?

For DB migrations in particular, I think you're alluding to not using a language/framework/model based migration (e.g. `rails db:migrate`) but instead to use just plain SQL. The difference for me here is whether you're suggesting they literally run the SQL required by hand (e.g. remembering/deducing which migration is required themselves, and either running an SQL file or typing the SQL into an interactive SQL session) or just that plain SQL should be used.

I have positive and negative thoughts about framework/model generated schemas. I think having the model system automatically generate/update schemas based on the model's properties, works fine for a dev environment, but for anything like testing/staging/prod environments, I believe the "best" solution is stored SQL files (preferably in the VCS itself) that are applied automatically by a tool. Those SQL files could be generated as an SQL 'diff' after running the Model generator if you wish, or they could just as easily be hand-written queries. Either way they should be reviewed as with the rest of the code anyway, so their origin is less important than their content.

And yes, I am somewhat "biased" in this: I've written a PHP framework that (amongst other things) will perform model-generated schema changes, and I've written a shell tool (written in shell) that will automatically apply DB migrations and rollbacks from a series of `{up,down}.sql` files.

As explained above, I see the former as a development tool, and the latter as a deployment tool.

Re: Show HN: Comfygure – A small CLI to manage application configurations

#32
post #27

Does it have any features to handle inheritance / composition of configurations? We usually have a slew of different environments that are mostly the same except for one or two parameters. I would like to find a solution that has the ability to control common parameters in one place without having to code the inheritance into every language / setting where the config is accessed. In general it seems like simply stori…

We initially thought to migrate versions from staging to production with a sort of composition, but we didn't implement that because there was a high risk of mixing credentials between environments.

That said, you can easily copy a config from one env to another and update that new config in no time.

comfy get env1 > tmp.json; comfy setall env2 tmp.json; comfy set env2

Re: Show HN: Comfygure – A small CLI to manage application configurations

#33

I just wish there was more of a standard for for configuration files. Aren't all config files at some level going to be tree like structures? I know it is impossible for everyone to agree on one format, like yaml vs json, vs xml etc. but maybe there could be a common library and standard that could allow each application to load it's configuration from any of these types of files? That way if one organization or dist…

IMO most configuration should just be environment variables. How you get them there is up to you, but exporting env vars from a config file shouldn't be a super hard task.

Having said that, if your organisation chooses to use YAML, personally a better choice would be to just burn the place to the ground.

Post reply on HN