FreeBSD and PostgreSQL

Posted by Daniel Lyons Fri, 29 Sep 2006 06:52:59 GMT

Bill and I had quite a bit of downtime today, due to two problems:

  1. Gentoo isn’t maintained as well as it used to be, and permitted Bill to update a package (OpenLDAP) which has no backwards compatibility regarding the database format.
  2. When you use LDAP, even if everything speaks PAM (which it does), it winds up linked against LDAP.

We’re thinking about migrating two things:

  1. The whole system away from LDAP, probably to PostgreSQL or (shudder) regular flat files.
  2. The OS from Gentoo to FreeBSD.

I personally would like to see both changes made, since I think FreeBSD is stabler and more well-maintained. However I think keeping ports up-to-date in FreeBSD is somewhat harder than keeping Gentoo up-to-date, but I’m not really sure why I feel that way; I guess going back to my early experiences with 4.6 and 5.0 which had a wonkier package system.

I also have learned something important about LDAP: it’s a total fucking sham. I remember this was my initial opinion of it, and I spent a couple years at Matterform thinking maybe it is a good idea because everything can utilize it, but, though that is true, I simply don’t need it, ever, and it is bulky, slow, inefficient with CPU, disk and RAM, and very fragile. Most of the benefits of it can be realized with PAM and PostgreSQL. In fact, the only benefits you don’t get are:

  1. Software browsing of the directory (Apple’s AddressBook and Mozilla Mail can do this)
  2. Simple replication via slurpd (though Slony-I can replicate PostgreSQL in a similar single master/many slave configuration)

The rest of it can be emulated via PAM and nsswitch. There’s a sysauth project for PostgreSQL which does both and they’re both post-1.0.

And if you still believe the horseshit about LDAP being better than a database, here are two little factoids to correct you:

  1. TinyLDAP is 7 times faster than indexed OpenLDAP directory, and more than 37 times faster than a default install of OpenLDAP, which has no indices.
  2. My 1.5 page SQL query from work, which PostgreSQL’s query optimizer says should cost 10,000 “points”, is delivered in a fraction of a second.

When a directory asshole tells you directories are optimized for reading and databases are not, you can mention that. I also find it incredibly annoying that the OpenLDAP people insist that you’re not comparing OpenLDAP to PostgreSQL fairly unless you put a lot of time and effort into tweaking OpenLDAP. Then and only then do you see similar performance to out-of-the-box PostgreSQL. Of course, PostgreSQL being a database, you can also tweak the hell out of its performance.

Screw the maintsream.

Tags , , ,  | 1 comment