Adding .db support to pkg_tools
koitsu at freebsd.org
Mon May 12 15:47:53 UTC 2008
On Mon, May 12, 2008 at 05:12:56PM +0200, Anders Nore wrote:
> On Sun, 11 May 2008 21:07:41 +0200, Jos Backus <jos at catnook.com> wrote:
>> On Sun, May 11, 2008 at 06:38:25AM -0700, Garrett Cooper wrote:
>>> +1. BDB is quite easy to corrupt...
>> If we're going to use a binary file format, please consider using SQLite
>> instead. It has the right license, a nice API (transactions!) and is
>> enough for yum to use it for a similar purpose.
> One of the reasons for using BDB is that it is in the base system, SQLite
> however is not.
Interesting discussion, and there's some irony in it (SQLite uses a very
BDB-like a storage medium, despite being a relational database system).
SQLite's license is compatible/friendly, its API is decent, the source
is fairly small and binary footprint (disk and memory both) are small,
and it includes tools for dumping databases to ASCII so developers
aren't forced to write DB dumping tools and users don't have to resort
to using hexdump.
A few things worth pointing out:
With regards to DB1.x being easily corrupted, this is true, and I have
heard claims of it from a couple developer-folk I worked with many years
ago at Best Internet. On the other hand, SQLite appears to have a
history of this as well, although those bugs have been fixed each and
Secondly, the following FAQ entry and documentation from Mozilla is of
concern, specifically the last paragraph of the FAQ entry, since there
is ongoing work in the ports collection to support parallel building,
which would surely use fork() or locks):
Thirdly, there is the concern of disk space. There are a substantial
number of users who have FreeBSD on embedded systems or systems with
little or no space, who use binary packages (pkg_add -r), which of
course still makes use of /var/db/pkg. SQLite DBs grow over time, and
don't shrink in size unless you use auto-vacuum mode or execute the
Fourthly, it doesn't sound as if storage SQLite databases on an NFS
mount is a good idea, and I've a feeling some people have /var NFS
mounted (diskless systems for example):
Finally, there's the concern about the SQLite file format changing.
Sometimes they're backwards-compatible, other times not.
Just stuff to consider.
| Jeremy Chadwick jdc at parodius.com |
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP: 4BD6C0CB |
More information about the freebsd-hackers