[Dovecot] Backing Up

mikkel at euro123.dk mikkel at euro123.dk
Thu Oct 30 21:41:03 EET 2008


> On Oct 30, 2008, at 2:35 PM, mikkel at euro123.dk wrote:
>> Maildir is nice compared to mbox but it really isn’t optimal. In days
>> where IOPS is the most difficult resource to get into your server (and
>> dovecot already using close to nothing in terms of CPU time and
>> memory)
>> having one file per e-mail is less than sub-optimal especially when a
>> large amount of users just downloads the whole mailbox using POP3
>> (not to
>> mention backing up Maildirs).
>
>    It seems to me that a database like Postgres or MySQL would be the
> best bet.
>

That's a matter of opinion. Moving mail storage to a database would
probably be the last thing I would ever do (I'm not saying it's not the
right thing for some people. I'm just not one of them).
I'm using mysql for storing the users database but that’s another story.

Adding a database is one additional level of complexity. One more program
to govern. In my opinion it's nice to know that as long as the disk is
readable nothing can go completely wrong.

The database in my case would be roughly 400 GB holding some 60 million
records.
Just imagine if one single byte got written to the wrong place. Power
outage, OS crash, software bug or whatever could easily result in this (I
regularly experience mysql tables that crash on their own from heavy use).
Having to run a repair on a table of that size whilst all users are eager
to get to their data must be a nightmare of proportions.

Just imagine backing the thing up, exporting 60.000.000 SQL queries.
Not to say importing them again if something should go really wrong.
Actually I'n not even sure it would be faster. When the index files grow
to several gigabytes they kind of loose their purpose.


Maildir is very resilient to various errors. It is virtually impossible to
corrupt a maildir (at least I've never experienced anything).
Also you can backup up the thing without worrying about anything accessing
it at the same time.
Mbox less so but still a lot better than having one huge database.

Dbox would be the ultimate compromise between crash resilience and a low
number of files (not to mention the enormous potential for speed gains).

Regards, Mikkel




More information about the dovecot mailing list