I think you should begin with Dovecot v1.1 code which makes it a lot easier. It has Cydir format that is really simple and serves as a pretty good example of how to implement a new backend.
Cydir is a mail_storage backend, but you'll probably need to also implement mailbox_list backend. Shouldn't be too difficult by looking at FS and Maildir++ backends I think.
By database do you mean SQL or something else? I've beginnings of SQL backend plugin already, but I don't remember if it was for v1.0 code or some version of v1.1. http://dovecot.org/patches/mail-sql.tar.gz
Timo,
Thanks for the information. I can't go too much into the project but yes, SQL is one of the stores. This will definitely be helpful. I will download the 1.1 codebase and also take a look at your mail-sql patch as a foundation for what I'm doing.
Gary