Subject | Re: saving email and its attachments to a BLOB field |
---|---|
Author | Adam |
Post date | 2005-06-14T06:37:44Z |
3) Store the subject line (and possibly the message body) in a
separate field from the attachments.
In fact, have a separate table for the attachments altogether.
EmailMessage
(
ID integer
Sender Varchar([something])
Subject Varchar([something]),
OtherHeaders([something])
Body Varchar([something])
)
EmailAttachment
(
ID integer,
MessageID integer,
AttachmentName VARCHAR([something]),
AttachmentIcon BLOB
Attachment BLOB
)
This means that you can efficiently get the name and Icon for each
attachment and only download the attachment when they double click
it. Alternatively, a background thread could retrieve the attachments
for the current message into a local cache ready for when they are
requested.
I am not aware of the size limits for BLOBs (they are there but you
are talking GB)
As long as the text appears instantly, it will seem fast to the user.
By the way, emails encode attachments generally in Base64, which is
pathetically verbose (but necessary). You can compress the emails
before storing them and the compression resource requirements will
very quickly be offset by the over the wire savings.
them. They can not be indexed, and are stored uncompressed.
Is there performance issue when retrieving
stored separately
Adam
separate field from the attachments.
In fact, have a separate table for the attachments altogether.
EmailMessage
(
ID integer
Sender Varchar([something])
Subject Varchar([something]),
OtherHeaders([something])
Body Varchar([something])
)
EmailAttachment
(
ID integer,
MessageID integer,
AttachmentName VARCHAR([something]),
AttachmentIcon BLOB
Attachment BLOB
)
This means that you can efficiently get the name and Icon for each
attachment and only download the attachment when they double click
it. Alternatively, a background thread could retrieve the attachments
for the current message into a local cache ready for when they are
requested.
I am not aware of the size limits for BLOBs (they are there but you
are talking GB)
As long as the text appears instantly, it will seem fast to the user.
By the way, emails encode attachments generally in Base64, which is
pathetically verbose (but necessary). You can compress the emails
before storing them and the compression resource requirements will
very quickly be offset by the over the wire savings.
> 1) one is to save email in a blob field of the Firebird database.database.
> 2) save email as .msg file, but keep the directory path in the
>field,
> For option 1), my concerns is the capacity, compatibility and
> reliability of the BLOB field. What is the size limit of a blob
> and can it store all different kind of attachments from emails, likeApart from the max size limitation, BLOBs do not care what you put in
> pictures and video clips?
them. They can not be indexed, and are stored uncompressed.
Is there performance issue when retrieving
> an email with large attachments?Of course. But this can be managed if the attachments and text are
stored separately
Adam