键->带有二进制附件的值存储

发布于 2024-08-10 23:02:41 字数 377 浏览 5 评论 0原文

一个额外的要求是附件可以存储为流,因为可能需要保存非常大的二进制文件。视频等。

我看过 Voldemort 和其他键值存储,但它们似乎都期望字节数组,这是完全不可能的。

这最好用 Java 编写,并且是可嵌入的。

用例是: 我编写了一个具有多个后端的 HTTP 缓存库。

我有一个基于内存的数据库(使用哈希图和字节数组)、Derby 数据库、带有文件附件的持久哈希图、带有文件附件的 EHCache。

我希望有一些东西不使用文件系统,或者如果使用的话,它对 API 来说是透明的。

我将标头和更多元信息存储在数据存储中。但我还需要存储 HTTP 响应的有效负载。

HTTP 响应负载可能非常大,这就是我需要使用流式传输的原因。

An extra requirement is that the attachments can be stored as a stream, as there might be potentially very large binaries that has to be saved. Videos etc.

I have looked at Voldemort and other key value stores, but they all seem to expect byte arrays, which is completely out of the question.

This should, preferrably, be written in Java, and be embeddable.

The use case is:
I have written a HTTP Cache library which has multiple backends.

I have a Memory based one (using hashmap and Byte arrays), Derby database, persistent hashmap with file attachment, EHCache with file attachment.

I was hoping there was something out there which didn't use the file system, or if it does, it's transparent from the API.

I am storing the Headers with some more meta information in a datastore. But I also need to store the payload of the HTTP response.

The HTTP response payload might be VERY big, thats why I need to use streaming.

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

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

发布评论

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

评论(1

苏辞 2024-08-17 23:02:41

为什么 byte[] 值是不可能的?任何对象图都可以序列化为字节数组!

您是否看过sleepycat 的 Berkeley DB(它是免费的)?

编辑 - 看过jhedding的评论后,似乎您需要存储太大而无法一次性放入单个 JVM 的数据。您是否:

  1. 检查过它是否不适合 64 位 JVM?
  2. 尝试过使用网络文件系统? (NAS 或其他)

Why is a byte[] value out of the question? Any object graph can be serialized into a byte array!

Have you looked at sleepycat's Berkeley DB (it's free)?

EDIT - having seen jhedding's comment, it seems like you need to store data which is too big to fit into a single JVM in one go. Have you:

  1. Checked that it won't fot into a 64-bit JVM?
  2. Tried using a network file system? (NAS or whatever)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文