Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
rbroggi committed Jul 16, 2024
1 parent f6592c5 commit 7021197
Show file tree
Hide file tree
Showing 5 changed files with 1,043 additions and 17 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Dynamic configuration

This repo implements a dynamic configuration repository. It leverages [mongodb change-streams](https://www.mongodb.com/docs/manual/changeStreams/)
to stream changes that happens in a configuration collection into the local configuration repository.
![](doc/img.png)

This library implements a hot-reloadable configuration repository. It leverages [mongodb change-streams](https://www.mongodb.com/docs/manual/changeStreams/)
to stream changes that happen in a configuration collection into the local configuration repository.

This pattern can be used in distributed systems for feature-flag activations/deactivations and for distributed
eventually-consistent hot-reloadable configuration changes.
Expand All @@ -11,14 +13,15 @@ A typical usecase is a kubernetes replicaset with multiple pods - upon configura
* default values are not persisted, they are local-only. This allows you to change default values
when rolling out new configuration versions.

The provided configuration must support `json` field tags for serialization.
The user-provided configuration must support `json` field tags for serialization/deserialization.

## Design

* Auditable - the lib aims at keeping historical information about configuration changes - this is achieved at the price of
* Auditable: the lib aims at keeping historical information about configuration changes - this is achieved at the price of
a higher storage usage as each configuration change translates to a new document in the collection containing all configuration
fields.
* Immutable - the configurations are versioned and immutable - every update is reflected as a new document.
* Immutable: the configurations are versioned and immutable - every update is reflected as a new document.
* Eventually-consistent: a configuration change will be replicated to the other local repositories eventually.

## Usage

Expand All @@ -32,5 +35,5 @@ checkout the [example](./example/main.go).

```shell
make dependencies_up
make
make tests
```
Loading

0 comments on commit 7021197

Please sign in to comment.