It depends on the technology you are using. For example, in the PHP Symfony Project, settings are mainly stored in flat files (Json, xml ...).
I have worked on many large web applications for clients. A key / value table is usually used to store simple settings. If you need to save more than one value, you will have to serialize them, so this is a bit complicated.
Keep in mind encrypt sensitive data such as passwords (Sha256 + salt).
The best way is to create two tables. Table for storing settings as a key / value:
CREATE TABLE Settings ( Id INT NOT NULL PRIMARY KEY, Key NOT NULL NVARCHAR, Value NULL NVARCHAR EnvId INT NOT NULL );
Then you need an environment table.
CREATE TABLE Environment ( Id INT NOT NULL PRIMARY KEY, Key NOT NULL NVARCHAR, );
Do not forget the foreign key constraint.
In addition, you must create these tables in a separate schema. You can apply the security policy by filtering access.
Thus, you can work with many environments (dev, test, production, ....), you just need to activate one environment. For example, you can configure not to send emails in env development, but send them in development mode.
So, you are connecting to get the settings for the given environment. You can add Boolean to easily switch between environments.
If you use a file (it does not need a db connection), you can get something like this (Json):
Env: Dev: Email: ~ Prod: Email: contact@superwebsite.com