Switching /etc/*.db from bdb to tinycdb

Baptiste Daroussin bapt at FreeBSD.org
Wed May 2 11:41:19 UTC 2012


Hi,

I plan to work on switching all the /etc/*.db files from bdb 1.85 to cdb (using
the tinycdb implementation)

Reason for doing that:
1/ we use the *.db files as a constant database on recreating them using
*_mkdb(8) commands
2/ bdb 1.85 database are endianness dependant which can cause problem if I want
pkgng to be able to create users when cross installing packages (like adding
packages in a mips eb chroot environment on an amd64 host)
3/ the tinycdb API is clean and easy to use (I find it easier and cleaner to
deal with it)
4/ tinycdb is public domain so not problem for us to use it.

On the side effects, I'm not sure this is relevant but tinycdb is also faster to
read then bdb 1.85.

How do I plan to do it.

I plan to import the read part or tinycdb into libc and the write part into
libutil (to avoid cluttering libc).

Why importing to libc? to allow all the get*ent to parse the /etc/*.db files.

How to implment it? slowly with backward compatibility:
for each kind of files: try to open with cdb, if fail fall back to bdb.

I plan to rewrite all the *_mkdb for make them use cdb.

Link for tinycdb:
http://www.corpit.ru/mjt/tinycdb.html

Any opinion, ideas, advices on this?

regards,
Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20120502/d0c0a377/attachment.pgp


More information about the freebsd-arch mailing list