Storing messages partly in database.