是否应该在没有磁盘容器的情况下使用 Berkeley DB XML?

发布于 2024-09-08 10:22:08 字数 710 浏览 4 评论 0原文

我正在考虑使用 BDB XML,作为内存应用程序数据存储。它是类似XML的数据,具有定义记录和数据记录,我提供了类似XPath的数据访问查询。它运行良好,除了内存溢出问题,这种问题在某些情况下发生是无法避免的(因此,只需避免内存溢出),并且仍然需要数据进行进一步处理(因此,无法获取数据)尚未输出流)。因此,我打算使用分隔文件或 XMl 文件将数据缓存到磁盘,同时尝试 BOOST 序列化。就在那时,我想到使用一些嵌入式数据库,它可以为我提供磁盘缓存(需要时),在磁盘缓存上加密(在某些情况下,我仍然对磁盘进行一些加密的 XML 缓存,但它们与内存溢出无关) )。现在,我需要:

  • 没有性能下降和可靠性
  • 在需要时(或当数据集达到限制时)对内存中数据进行加密的磁盘缓存
  • 按需加密的磁盘缓存
  • 数据访问的 XPath 兼容性(访问不需要知道是否数据位于磁盘的内存中)
  • 不想创建磁盘上的数据库容器(在 BDB XML 的情况下),因为执行完成后不需要它,删除通常会产生一些费用。
  • 解决方案需要独立于平台

,所以我应该使用 BDB XML 吗?它是最突出的解决方案,提供 C++ API(我的应用程序是独立于平台的 C++),它提供 XPath 2.0 用于访问(它需要),但我想在其中逐个节点构建 XML,并且主要是逐个节点访问并希望在没有显式磁盘容器的情况下使用它,该容器需要在执行期间经常清除并在之后删除,但需要它不使用比指定缓冲区更多的内存,并在需要时使用磁盘。

I am considering to use BDB XML, as in memory application data store. It is XML like data with definition records and data records, i have provided XPath like quiring for data access. Its running well except for a memory overflow problem, that occurs in some cases which can't be avoided (so, just ant to avoid mem-overflow), and data is still needed for further processing (so, it can't be got to output stream yet). So, i was going to cache data to disk using delimited or XMl files, also was trying BOOST serialization. And thats when i thought of using some embedded db which can give me on-disk caching (when needed), encrypted on disk caching (i still do some encrypted XML caching to disk in certain cases but they are not related to the memory overflow thing). Now, I need:

  • No performance degradation and reliability
  • encrypted on-disk caching of in-memory data when needed (or when dataset reaches a limit)
  • on demand encrypted on-disk caching
  • XPath compatibility for data access (access should not need to know whether data is in-memory of on-disk)
  • Don't want to create on-disk db container (in case of BDB XML) as its not needed after execution is complete, deletions will often if and might have some toll.
  • Solution needs to be platform independent

so, should i use BDB XML ? it is most prominent solution and provides C++ API (my application is in platform independent C++), it provided XPath 2.0 for access (its needed), but i want to build and XML in it node by node and mostly access node by node and want to use it without an explicit on-disk container which is needed to be cleared out often during exec and deleted afterwards, but need it to not use more memory than specified buffer and use disk when needed.

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

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

发布评论

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

评论(1

不再见 2024-09-15 10:22:08

否。请查看 Joel 的“回到基础知识” 专栏。

从根本上来说,BDB-XML 是一种生成和使用 XML 的好方法,而 XML 又是一种交换数据的好方法。但 XML 不适用于内存中使用,因此 BDB-XML 甚至不应该纳入考虑范围。

No. Check Joel's "back to Basics" column.

Fundamentally, BDB-XML is a good way to produce and consume XML, and XML in turn is a good way to exchange data. But XML is not intended for in-memory use, and thus BDB-XML shouldn't even enter the consideration.

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