OpenWrt Forum Archive

Topic: sql based config

The content of this topic has been archived on 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello all,
In a meeting with other people working on a mesh router project with me, one fellow had the suggestion that sqlite be used as a repository of configuration information as opposed to numerous configuration text files. I dismissed it at the time, because I thought of SQL servers as being heavy and difficult, but the more I have read about sqlite the more I am convinced that it is possible to use this lightweight db server to contain the configuration of various services on an embedded platform. I know, however, that implementation would be a fair amount of work. Yet I'd like to propose it as an option to the UCI, because I think it is more efficient and ultimately, more robust.

I'd be interested in hearing what other people have to say, particularly those who manage the ports of various projects with complex configuration files, in OpenWRT.

Hmm, maybe there can be SQL (sqlite) support added to UCI instead of config files by writing a plugin for UCI. I don't know...

Bob Keyes wrote:

Yet I'd like to propose it as an option to the UCI, because I think it is more efficient <snip>

How is it more efficient? The libsqlite2 package weighs in at 140KB or more depending on the platform, tack on an extra 30KB or more for libsqlite3; libuci and uci combined consume 19-21KB. SQL makes sense for many kinds of data, and I am a big fan of SQLite, but it doesn't make sense for simple key-value pairs of configuration data on embedded platforms with such limited storage space.

It depends on how much storage you have vs. cpu power available. I guess I should have pointed out that I am using Avila boards and other systems without many limitations on the amount of flash memory available.

The discussion might have continued from here.