1

Requirement : JAVA desktop mail client which could connect to existing gmail,y! mail a/c & will allow receive/send mails, support offline view of mails, plus with more features as & when it comes. i am using Java Mail Api's

Underlying Mail Storage: I have decided to use HSQLDB with Hibernate. Email content can have attachments , HTML , so i decided to use LONGVARBINARY type to store the email Body & attachments.

Please let me know whether this approach is good & will it give me good performance when it comes to retrieval. Also give me some pointers on how to store java email objects in HSQLDB into LONGVARBINARY type & how to dereference it to get the actual data. ??

2)I am confused over this because , with Approach 1 , i will end up storing all mail contents somehow on my local disk to enable offline viewing. And imagine if i have 1GB of mails >

4

1 回答 1

1

如果您使用基于文件的方法(这并不排除您使用数据库),您可以在不使用时压缩和解压缩用于持久性的文件。由于您将存储简单的文本,因此压缩可能会很大,如果您在明智地选择时间进行压缩,速度下降也不会那么糟糕。地狱,你甚至可以让它成为一个选择。

这里要考虑的最重要的事情(对我来说)是搜索时间。您希望用户能够搜索什么?如果搜索很重要,我可能会使用数据库。我最初解决这个问题的方法是将主题和标题信息(日期、发件人、收件人等)存储在单独的列中,然后将整个电子邮件对象序列化为二进制数据列(可能是压缩的)。这会使全文搜索花费更长的时间,但无论如何这是意料之中的,对吧?

于 2009-03-25T18:18:39.857 回答