I once made a messaging system for a company and i found the fastest way was just to use boring old flat test files. This saves accessing a massive database which accumulates so much data. A couple of text files are much smaller and are faster to access.
What kind of messaging system are you building?
skripty