The primary databases hosted by the REDIS database include APPL_DB, CONFIG_DB, STATE_DB, ASIC_DB, and COUNTERS_DB. Stock SONiC keeps the configuration in ConfigDB. ConfigDB uses a table-object schema, and config_db.json is a serialization of DB. The following example shows a Device Metadata table. The Device Metadata table has a single object named localhost. For example, the Device Metadata table contains hwsku, platform, and so on.
In the stock SONiC, ConfigDB is implemented as database 4 of local Redis. The config_db.json file contains the startup configurations. It is found in /etc/sonic/. When system boots, configurations are loaded from the config_db.json file into Redis. The config_db.json is in /etc/sonic/. The content in the config_db.json file is start-up config, and content in redisDB is running-config.
The configuration can be modified in the config_db.json file, and the config file can be loaded into the NOS. For example, the following configuration can be added into the config_db.json file for configuring VLAN 1003 on a switch running stock SONiC NOS, adding IP address, and adding interfaces to the VLAN.
Viewing the added configuration in the config_db.json file can be done using the Linux shell. See the following figure.
Note: For the configurations added to the config_db.json file to take effect in the redisDB, use the config load or config reload command to force load the JSON file into the database. Alternatively, users can reboot the device.