Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rfc(SSOT): Add Single Source of Truth (SSOT) configuration system #4935

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

big-r81
Copy link
Contributor

@big-r81 big-r81 commented Jan 1, 2024

Initial ideas of a Single Source Of Truth config system for CouchDB.

@rnewson
Copy link
Member

rnewson commented Jan 3, 2024

Before we get too deep into this I'd like to see us tidy up what we currently have. Specifically;

move code defaults to priv config files:

Like stats_descriptions.cfg, for each application create a file called config_defaults.cfg. This file could look like;

src/couch/priv/config_defaults.cfg:

#{
  max_dbs_open => #{
    default => 500,
    description => <<"Maximum number of .couch files to open at once. ...">>
  }
}

These files would replace the commented out items in default.ini. An endpoint could be added to return this data (but not allow them to be modified).

config:get/2 would be enhanced to retrieve the default from these config files (if present, undefined if not) and all uses of config:get/3 would be removed, so that the only copy of the default value for a given config item is in the config_defaults.cfg.

This means default.ini is empty except for things like database_dir with an actual install-specific value (whether from dev/run or a package install. Arguably it could be eliminated entirely and all of those settings could be in local.ini.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants