single vs multiple database instances
Think of Zimbra mailbox server's use of mysql as an embedded database,
ie, each mailbox server has its own database instance. Contrast this
with applications that require one humongous database instance on a
Two main advantages of the embedded-databse-per-mailbox-server
- Database scalability, wrt data size and load, is less of an issue.
Hardware is cheaper. Remember email is write heavy on the
database (more reads than writes with email, but write heavy
compared to other types of applications).
- Maintaining integrity between message files, search index, and
database becomes a problem that is local to a box, and therefore
The disadvantage of many mailbox instances is: database servers have
to be babied, and if you have many it's that much more work. I argue
that they have to be babied most of the time because they are huge -
for some applications you must have one database, but for mail - you
don't HAVE to.
The trend now is towards clustering, and for good reason. A cluster
where data can be paritioned is the best kind of cluster. Users are
inherently partitionable (er, a set of users are - can't partition a
single user - literally or in ZCS :). So why throw a big database
instance in the mix.
That having been said, if you want to try and run Zimbra with single
database instance, a good place to start is:
- see what the zmmyinit script does to bless and initiliaze a
database - watch out for those GRANT statements - we only grant
permissions to localhost. Double check the generated my.cnf
- zmlocalconfig -e mysql_bind_address=<mysqlhost> mysql_port=<port>
(Look in DbPool.java to see how these local config settings are
used). tomcat restart will be required - zmcontrol might not like
mysql not being there, so can not restart with that.