Debian Codegraph @

subprojects/gvdb/README.md

raw
1 GVDB
2 ====
3
4 GVDB (GVariant Database) is a simple database file format that stores a
5 mapping from strings to GVariant values in a way that is extremely
6 efficient for lookups.
7
8 The code is intended to be pulled into projects as a submodule/subproject,
9 and it is not shipped as a separately compiled library. It has no API
10 guarantees.
11
12 A GVDB database table is a single file. It is designed to be memory mapped
13 by one or more clients, with accesses to the stored data being fast. The
14 storage format has low size overheads, assuming the GVariant formats for
15 values do not require much padding or alignment.
16
17 Modifying a GVDB table requires writing out the whole file. This is
18 relatively slow. `gvdb_table_write_contents()` does this by writing out
19 the new file and atomically renaming it over the old one. This means
20 that any clients who have memory mapped the old file will need to reload
21 their memory mapping.
22
23 This means that if multiple clients are using a GVDB table, an external
24 process is needed to synchronise writes and to notify clients to reload
25 the table. `dconf-service` is an example of such a process.
26
27 <!--
28 SPDX-FileCopyrightText: 2021 Endless OS Foundation, LLC
29 SPDX-License-Identifier: LGPL-2.1-or-later
30 -->