I have implemented something similar to this before (in MS Sql Server) using a self-referencing configuration table. Each entry would specify system, parent system, and setting name/value. This allows for flexibility around what settings are saved (rather than having a column for background, column for threads, etc). You can calculate the settings for a given system using a recursive CTE, as long as the number of levels doesn't exceed the maximum recursion depth. As a place to start:
CREATE TABLE Configuration (
SystemId varchar(30),
ParentSystemId varchar(30),
Name varchar(30),
Value varchar(30)
)
And to retrieve the configuration for a system:
;WITH SystemConfig (Id, ParentId, Name, Value, Rank) AS (
SELECT SystemId, ParentSystemId, Name, Value, 1
FROM Configuration C
WHERE SystemId = @SystemId
UNION ALL
SELECT D.SystemId, D.ParentSystemId, D.Name, D.Value, Rank + 1
FROM Configuration D
INNER JOIN SystemConfig S ON S.ParentId = D.SystemId
)
SELECT DISTINCT K.Name, V.Value
FROM SystemConfig K
CROSS APPLY (
SELECT TOP 1 Value
FROM SystemConfig G
WHERE K.Name = G.Name
ORDER BY Rank
) V
Demo SQL Fiddle
I can't say whether this is the most efficient way in SQL, and I've never attempted a NoSql solution, but this gets the job done and with reasonable indexing performs well.