Legend:

Unmodified

Added

Removed

Modified

YumDB

v1

v2

12

12

}}}

13

13

14

Each keyname is a file the contents of which are the values.

14

Each keyname is a file and the contents of that file are the values.

15

'''Note''' since 3.2.28 hardlinks are allowed between different keys, this saves on load time and storage but means that if you try to change the data using a text editor it'll probably change more than you want it to.

16

17

=== Why not a "real" database ===

18

19

The two main operations that yum uses the yumdb for are:

20

21

* Given an installed package XYZ-2-1.noarch, get the value of yumdb key FOO. (Eg. yumdb get from_repo yum).

22

* Given an installed package XYZ-2-1.noarch, set the value of yumdb key FOO to BAR. (Eg. yumdb set from_repo special yum).

23

24

...using the filesystem allows both those operations to be fast and atomic. It is unlikely to be significantly better to use any other approach for the two main uses, however the most common suggestions "sqlite" and a key/value store (like "libdb*") fail at least one of those tests.

25

Using the filesystem makes it easy to:

26

27

* Keep all the yum code simple.

28

* Have isolation. Eg. Something goes wrong and the "reason" key for package XYZ is broken, nothing else should be affected.

29

* Have a knowledgeable sysadmin fix any problems.

30

* Have interoperability (it's trivial to to the get/set operations from any language without having to use the yum API -- although we still don't recommend it).

31

32

There are two minor downsides to using the filesystem:

33

34

* Searching is not fast (Eg. yumdb search from_repo updates-testing). The main thing to realize here is that no yum tool currently needs to perform operations like this.

35

* Load all keys of XYZ from all installed packages. The only usecase here is loading the checksum data to calculate rpmdb-versions, on install/etc. ... however we need a separate index for this anyway, as we when need to know this information quickly we don't want to load the packages at all.

15

36

16

37

== Commonly stored information ==

19

40

* command_line: command line used to install this pkg

20

41

* releasever: $releasever of the system at the time the pkg was installed (so you can look for pkgs which have lingered across release updates)

42

* installed_by (3.2.28): The loginuid of the user who first installed this package (can be non-existant). This doesn't cross Obsoletes.

43

* changed_by (3.2.28): The loginuid of the user who last installed this package (can be non-existant).