Skip to content

A toolchain for CouchDB Lounge

One of our biggest issues with CouchDB is currently the lack of compaction of our database, and by lack of, I don't mean that CouchDB doesn't support it, I mean that we are unable to actually run it.

Compaction in a nutshell

Compaction in a nutshell is pretty cool.

As you know, CouchDB is not very space-efficient. For once, CouchDB saves revisions of all documents. Which means, whenever you update a document a new revision is saved. You can rollback any time, or expose it as a nifty feature in your application — regardless, those revisions are kept around until your database is compacted.

Think about it in terms of IMAP - emails are not deleted until you hit that magic "compact" button which 99% of all people who use IMAP don't know what it's for anyway.

Another thing is that whenever new documents are written to CouchDB and bulk mode is not used, it'll save them in a way which is not very efficient either. In terms of actual storage and indexing (so rumour has it).

Compaction woes

Since everything is simple with CouchDB, compaction is a simple process in CouchDB too. Yay!

When compaction is started, CouchDB will create a new database file where it stores the data in a very optimized way (I will not detail on this, go read a science book or google if you are really interested in this!). When the compaction process finished, CouchDB will exchange your old database file with the new database file.

The woes start with that e.g. when you have 700 GB uncompacted data, you will probably need another 400 GB for compaction to finish because it will create a second database file.

The second issue is that when you have constant writing on your database, the compaction process will actually never finish. It kind of sucks and for those people who aim to provide close to 100% availability, this is extremely painful to learn.

Das Kleingedruckte

Zum Thema, "Was bedeutet eigentlich Flatrate", hier die Vorstellung meines Anbieters.

Ich wollte es zuerst unter "Abzocke" verbloggen, aber eigentlich ist das schon wieder so komisch, dass ich dann davon abgesehen habe. Hier die Fußnote bzw. das Kleingedruckte meines Mobilanbieter (mobilcom-debitel), zum Thema Datenflatrate "[email protected] Flat". Die interessanten Passagen hab ich hervorgehoben.

Gilt bei Abschluss der mobilcom-debitel Datenoption [email protected] Flat - Try&Buy, mtl. Grundpreis € 9,95 (erster Monat Grundpreis frei), 24 Monate Mindestlaufzeit. Der Vertrag kann innerhalb von 30 Tagen nach Vertragsschluss gekündigt werden (Kündigung wird wirksam zum 30. Tag nach Vertragsschluss). Erfolgt keine Kündigung innerhalb von 30 Tagen, beträgt die Mindestlaufzeit der Option 24 Monate. Das Inklusivvolumen gilt für nationalen Datenverkehr über den WEB- und WAP-APN. Nach Erreichen von 300 MB (Vodafone), 250 MB (Eplus), 200 MB (o2) Datenvolumen/Monat wird die Datenübertragung auf GPRS-Geschwindigkeit reduziert. WLAN, VPN, VoIP, Instant Messaging sind ausgeschlossen und werden nach dem zugrunde liegendem Tarif berechnet. Im T-Mobile Netz sind zudem Business-Software-Zugriff, Filesharing / FTP, iTunes, Multiplayer-Onlinegames, Internet-Radio bzw. Internet-TV, Client-basierte E-Mail Nutzung ausgeschlossen und werden mit 0,09 € / Minute abgerechnet. Nicht nutzbar mit BlackBerry, iPhone, T-Mobile G1/G2. Die Option unterstützt nur das Surfen mit einem geeigneten Mobiltelefon ohne angeschlossenen Computer. Die Laufzeit der Option verlängert sich automatisch um 12 Monate, wenn nicht 3 Monate vor Ablauf gekündigt wird. Ein Wechsel der Datenoption ist nur zum Ende der Mindestlaufzeit möglich.

… und das macht richtig Lust und Laune diese Zusatzoption abzuschliessen. Und Kunde bin ich bei diesem Laden seit 10.12.1999.