Git Based Application Configuration
Konfigraf is a Git-based configuration service that provides management for
application configuration/settings. Konfigraf is built as Postgres extension
which provides functions for reading and writing arbitrary files to Git
repositories which are backed by Postgres tables rather than a file store.
Why Should You Use Konfigraf?
"Configuration" is a broad term, in the context of software applications
it can have several meanings:
-
Static settings stored in application source code which are intended
to give developers a central place to manage constants that are used in code.
These are usually present in the form of a yaml, json, or xml file located at
the root of a project's source code. Konfigraf is not intended for management
of static configuration.
-
Environment variables usually provided as environment variables or as
files in volumes mounted to a container to provide the application necessary
information about the context in which it running. Konfigraf is not indended
for environment information. Though it could be used in such a context, since
these settings are nearly always applied during the initial provisioning phase
of an application's lifecycle a simplier solution is likely a better fit. The
term configuration as code is used to describe a strategy of environment
configuration management in which this configuration is stored under a source
control repository like Git.
-
Application configuration is data usually created by the application at
runtime, usually by users of an application via an interactive user interface.
This data is generally stored in a database designed by the developer then
subsequently loaded when performing operations to alter the application's runtime
behavior. This is the use case that Konfigraf was designed to support.
Storing application configuration in a simple CRUD accessed database has a number of
drawbacks. If this configuration is used as an input to control flow or branch logic,
and particularly as complexity increases and for systems for which distinct
"administration" and "user" functions play a significant role,
this can easily become a sort of application code which is present only in production
and has no source control applied.
Ideally in these cases we'd like to have something like Git to keep a log of changes,
perform change diff reports, and perhaps even move changes into other environments for
testing. Unfortunately fulling implementing such a system for an application's runtime
configuration is a substatial project in and of itself. Konfigraf is designed to bridge
this gap, allowing configuration to be stored in a conventional database but using a more
appropriate model.