As far as the data model is concerned, we need two types of objects:
- An object for database instances
- An object for database sections
# Database sections
For the database sections, we need to store the following information:
- The master database instance
- read-only state (true/false)
- read-only message
- depool threshold (an integer, minimum number of instances pooled)
so our data model will be:
```
# Key: db_sections/sN
master: <string>
read-only: <boolean>
ro-reason: <string>
min_slaves: <integer>
```
# Database instances
For the database instances, we need the following:
- The hostname to connect to
- The ip corresponding to that hostname
- for each section defined for this instance:
** The pooled status, boolean
** A coefficient between 0 and 1 that will multiply the weights
** The weight in the main group, as an integer
** For each group configured, the relative weight as an integer
so our data model will be:
```
# key: db_eqiad/instance_label
hostname: <string>
host_ip: <ipaddress>
port: <integer>
sections:
- section: sX <should be defined as a section model
pooled: <boolean>
weight_multiplier: <integer, between 0 and 1>
weight: <integer>
groups:
- group: <string, fixed values>
weight: <integer>