On Tue, 2007-06-05 at 23:03 +1000, Jake Anderson wrote: > > Now that I've written all that, I am sure that should happen in the > > database, in the replication code. It's just not likely to happen any > > time soon :-\ > > > > Aaron > > > You mean that it should be taken care of by stored procedures and the > like? That sounds really quite hard ;->
The algorithms are out there and well-known, and databases already have replication code intended for full-sync between nodes. > I'd do it this way. The "cluster management" is basically a separate > program can be written in something nice like python as its just a > director so absolute performance isn't required. Then all your "clients" > need to do is to know when they are going to save stuff to the database > which ones to save it too. This table could be kept up to date and > synched by the python director (i say python because its something i am > learning and can contribute with ;->). So it shouldn't be too bad. That could certainly work. > The system already must have some concept of users? Otherwise how does > it know who to accept mail for? So basically the change becomes > something like this. Thinking some more, with foreign keys, the database can keep track of which rows in which tables should have 'affinity' to be distributed out out to the same nodes in the database cluster. > Check the table for the current "entity" (alias/user/whatever) and get a > list of places that needs to be written. > Wrap the existing writing functions with some sort of "super > transaction" function. > Send out the SQL writes. > If any write fails then rollback all transactions that were started. Getting transactions right is another thing we have to work on. There is no support for nested transactions, only savepoints, and we're not yet savepoint aware throughout the code. > For a read check the table and see which host is preferred for that > entity to read from. (The python director will keep the tables updated > to load balance etc) This is how memcache works -- then if you check out the Chord distributed cache, it adds the logic for determining which host has your data, something that memcache intentionally leaves to the application to figure out. > The other option is to have the director queried per transaction on > where stuff should be written but I can see downsides to that. If the > director fails the whole system spits, if it fails and all the tables > are just left sitting there well the system keeps working and all is well. > > > I did at one stage post a method of getting this kind of scaling without > modifying the code. Basically a perdition proxy splits stuff off per > user to specific dbmail hosts. Your DB servers run multiple instances of > the DB server of your choice. Then the database hosts replicate one > other database. IE server A replicates B, B replicates C and C > replicates A. (all the replication is done by the second db on each > host.) so 3 systems gives you the performance of 2 systems and the > reliability of 2 systems (RAID 5) This is pretty much the recommended HA setup, see the paper on dbmail.eu. > Its a lot of mucking about to configure though. If you could just tell > the director "here is a new database install, it has MySQL (usr, pwd) go > and make that work" it'd be nice ;-> Do you also have a map to find the Holy Grail? :-P > Hmm adding to that thought. I wonder if its possible to somehow network > configure a dbmail front end. The big thing at the moment seems to be > the ability to dynamically add power to any task that needs it. (In the > big end of town) > Through virtualisation or whatever "switch on" a bunch more webservers > when they are needed. If a dbmail/spamassain/whatever vmware/xen image > was created that would just wakeup talk to the server to get its config > and start processing emails it might do well. If we passed enough configuration information on the command line for the process to connect to the database and read the rest of its configuration information, then we could spin up machines with just a dbmail binary and no configuration file. It might be an interesting thing to do, but it's easy enough to distribute configuration files. Oh, here's an idea: add a command line option to pass the node identifier, and add another level of structure to the config file format so that a single config file could hold information for many nodes. I'm not sure if this is any more useful than just making a bunch of config files and passing '-f /etc/dbmail/nodename.conf'. Aaron _______________________________________________ Dbmail-dev mailing list [email protected] http://twister.fastxs.net/mailman/listinfo/dbmail-dev
