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 に答える