On Wed, 2006-08-16 at 11:25 +1000, Jake Anderson wrote: > End of response and start of general ramble > > I'm not a C coder (just yet) but i have done a fair bit of programming > and database work and I'm looking to help, I am moving from windows to > Linux and liking it ;->. I like the email in database idea, I can see > it scaling a long way, (with a manager program) and providing good fault > tolerance for HA apps.
Yes and no. If you're running a mail server with a Maildir backend, such as Dovecot, then HA and replication is a filesystem issue. Debating HA and replication in terms of filesystems vs. databases is a fun argument that goes nowhere ;-) Use what works best for your skillset and in your environment is what it comes down to. > The other advantage to the stored procedure model is you can write > procedures and give the users access to them in the database directly > rather than going through IMAP if somebody wants to write an extension > then the mail client can bypass the IMAP handler totally. Geo Carncross has been advocating the security model needed for this type of access. He'd like to see each user account represented as a database account. Granted he's also talking about SQLite most of the time, this concept could be used for MySQL and PostgreSQL -- you throw the door open for users to log right into their account right from the SQL shell and they can mess around to their heart's content, only able to see or break their own email. This is fun to think about, but it's a bad idea. Keep the database behind a closed door. > Some general thoughts on email + database. > I see it ending up such that each user has their own DB and that can be > replicated to/on other servers (managed by a manager program). So to add > capacity to your mail server get any old PC, stick mysql/postgres + > helper program on it and tell the manager program to use it. Manager > program talks to helper on the node and monitors its load, if its load > is below the average load for the rest of the servers then the manager > replicates a db over to it (starting with high load users) then tells > the smtp/imap front ends to use that new server. Each users database > should be kept on 2 servers minimum for redundancy. Manager program > keeps everything in synch and handles databases/nodes coming back from > offline mode. > With the right IMAP front end on it you should be able to get fault > tolerance in everything and hopefully pretty much linear scaling. Take a look on the wiki for Geo Carncross' work on doing the separate databases with SQLite. No work yet on clustering -- that's coming in the next development cycle (Geo's cluster spec is also on the wiki). Aaron
