在应用程序中存储电子邮件的设计方法

发布于 2024-12-03 20:30:06 字数 218 浏览 2 评论 0原文

我想讨论我们需要实现的应用程序的设计方法。应用程序需要存储并稍后处理电子邮件。我们每天大约有 2000 封电子邮件,包括附件在内的平均大小约为 2MB,我们需要将它们存储 3 个月。

方法 1:

将电子邮件存储在文件系统上,并仅将路径插入数据库中。

方法 2:

将完整的电子邮件存储在数据库的 CLOB 字段中。

两种设计方法的优缺点在哪里?

I want to discuss design approaches for an application we need to implement. The application needs to store and later process emails. We have about 2000 emails a day, the average size including attachements is about 2MB and we need to store them for 3 month.

Approach 1:

Store the email on the filesystem and insert only the path in the database.

Approach 2:

Store the complete email in a CLOB field in the database.

Where are the advantages and disadvantages of both design approaches?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

手心的海 2024-12-10 20:30:06

我建议将其存储在数据库中,CLOB 很慢,但不会比将其从文件系统中取出慢太多。如果一切都集中在一处,您的灾难恢复故事就会变得更加容易。

如果您查询相关表的频率高于访问电子邮件内容的频率,我还会使用指向另一个表中的 CLOB 的指针。

I would recommend storing it in the database, CLOBs are slow but not too much slower than getting it off the file system. Your disaster recovery story becomes much easier if everything is in one place.

I'd also use a pointer to CLOBs in another table if you're querying the table in question more often than to access the email contents.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文