将通过 HTTP 接收到的数据更快地存储到数据库(或文件系统)中

发布于 2024-12-22 00:45:48 字数 549 浏览 0 评论 0原文

我需要非常快速地存储通过 HTTP 收集的二进制数据。

我有一个客户端通过 HTTP 向服务器发送数据,服务器将数据存储到数据库表中。成分:Java 1.5、Tomcat 5.5、Hibernate 3.0、SQL Server、jTDS JDBC 驱动程序。

我不想让客户等待,所以我分离了任何业务逻辑,只是将内容排队以供稍后处理。

如何让数据存储更加高效?

我是否可以获得一些时间:

  • 使用不同的版本(例如“使用 tomcat 6”或“使用 Java 7”)?
  • 更改配置(例如“在 Tomcat 中禁用调试模式”或“使用 -Dblazingfast”Java 选项)?
  • 交换组件(即“使用 JBoss,而不是 Tomcat”)?
  • 使用不同的编程技术(例如“使用 while 循环而不是 for 循环”)

我应该使用缓存作为 ehcache 吗?我应该放弃 Hibernate 并使用 JDBC 吗?是否有足够可配置的东西可以用来代替我的自定义 servlet?

预先感谢,任何提示表示赞赏。

I need to store binary data gathered via HTTP very fast.

I have a client sending data via HTTP to a server that stores the stuff into a database table. Ingredients: Java 1.5, Tomcat 5.5, Hibernate 3.0, SQL Server, jTDS JDBC drivers.

I do not want the clients to wait, so I'm detaching any business logic and just queuing up the stuff for later processing.

How can I make the data storing more efficient?

Do I gain some time:

  • using different versions (es. "use tomcat 6" or "use Java 7")?
  • changing configurations (es. "disable debug mode in Tomcat" or "use the -Dblazingfast" Java option)?
  • swapping components (es "use JBoss, not Tomcat")?
  • using different programming tecniques (es. "use while loops instead of for loops")

Shall I use a cache as ehcache? Shall I ditch Hibernate and use JDBC? Is there anything configurable enough that I can use instead of my custom servlet?

Thanks in advance, any hint appreciated.

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

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

发布评论

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

评论(1

面犯桃花 2024-12-29 00:45:48

如果写入磁盘没问题,那么您可以按照此处的建议进行操作。顺便说一句,我本能地认为字节数组应该比 String 处理得更快。

If writing to disk is OK then you could do as suggested here. On a side note, instinctively I think byte array should be faster to handle than a String.

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