1 dconf is a simple key/value storage system that is heavily optimised for
2 reading. This makes it an ideal system for storing user preferences
3 (which are read 1000s of times for each time the user changes one). It
4 was created with this usecase in mind.
6 All preferences are stored in a single large binary file. Layering of
7 preferences is possible using multiple files (ie: for site defaults).
8 Lock-down is also supported. The binary file for the defaults can
9 optionally be compiled from a set of plain text keyfiles.
11 dconf has a partial client/server architecture. It uses D-Bus. The
12 server is only involved in writes (and is not activated in the user
13 session until the user modifies a preference). The service is
14 stateless and can exit freely at any time (and is therefore robust
15 against crashes). The list of paths that each process is watching is
16 stored within the D-Bus daemon itself (as D-Bus signal match rules).
18 Reads are performed by direct access (via mmap) to the on-disk database
19 which is essentially a hashtable. For this reason, dconf reads
20 typically involve zero system calls and are comparable to a hashtable
21 lookup in terms of speed. Practically speaking, in simple non-layered
22 setups, dconf is less than 10 times slower than GHashTable.
24 Writes are assumed only to happen in response to explicit user
25 interaction (like clicking on a checkbox in a preferences dialog) and
26 are therefore not optimised at all. On some file systems, dconf-service
27 will call fsync() for every write, which can introduce a latency of up
28 to 100ms. This latency is hidden by the client libraries through a
29 clever "fast" mechanism that records the outstanding changes locally (so
30 they can be read back immediately) until the service signals that a
33 dconf mostly targets Free Software operating systems. It will
34 theoretically run on Mac OS but there isn't much point to that (since
35 Mac OS applications want to store preferences in plist files). It is
36 not possible to use dconf on Windows because of the inability to rename
37 over a file that's still in use (which is what the dconf-service does on
40 The dconf API is not particularly friendly. Because of this and the
41 lack of portability, you almost certainly want to use some sort of
42 wrapper API around it. The wrapper API used by Gtk+ and GNOME
43 applications is GSettings, which is included as part of GLib. GSettings
44 has backends for Windows (using the registry) and Mac OS (using property
45 lists) as well as its dconf backend and is the proper API to use for
46 graphical applications.
48 dconf itself attempts to maintain a rather low profile with respect to
49 dependencies. For the most part, there is only a dependency on GLib.
51 With the exception of the bin/ and editor/ directories, dconf is written
52 in C using libglib. This is a very strong dependency due to the fact
53 that dconf's type system is GVariant.
55 The dconf-service has a dependency on libgio, as do the client libraries
56 that make use of GDBus (and the utilities that make use of those
59 The standard client library is libdconf (in client/). If you can't use
60 GSettings then you should probably want to use this next.
62 There is also a libdbus-1 based library. It does not depend on libgio,
63 but still depends on libglib. It is not recommended to use this library
64 unless you have a legacy dependency on libdbus-1 (such as in Qt
67 bin/ and editor/ are written in Vala. The Vala compiler is not required
68 to compile tarball releases but is required for building out of git.
70 The editor also has a dependency on Gtk+ 3 and libxml2. The libxml2
71 dependency should disappear at some point in the near future. In any
72 case, building the editor is optional (and can be switched off using
75 Installing dconf follows the typical automake dance:
77 ./configure (or autogen.sh from git)
81 If you plan to contribute to dconf, please see the HACKING file.