简体   繁体   English

哪个是访问 berkeley db 的更好方法

[英]Which is better way for accessing berkeley db

I am using two package 1) Berkeley db Java Edition using BASE API 2)Berkeley DB Java Edition Using DPL (Direct Persistence Layer) I am using two package 1) Berkeley db Java Edition using BASE API 2)Berkeley DB Java Edition Using DPL (Direct Persistence Layer)

if the performance is the issue then which is better way如果性能是问题,那么哪个是更好的方法

DPL is basically the base API with BDBs built-in custom binding/serialization on top. DPL 基本上是基础 API,顶部内置 BDB 自定义绑定/序列化。

This means that performance will depend on where the data you store is coming from.这意味着性能将取决于您存储的数据的来源。 If it is coming from Java objects and you want to use the base API, it's unlikely that you'll find a quicker serialization process than BDBs.如果它来自 Java 对象并且您想使用基础 API,那么您不太可能找到比 BDB 更快的序列化过程。 (Although not impossible and you can always construct one for specific cases.) (尽管并非不可能,您始终可以针对特定情况构建一个。)

If the data you want to store is already in a serialized format, or just not in the form of POJOs, you might be better off with the base API.如果您要存储的数据已经是序列化格式,或者只是不是 POJO 的形式,那么使用基本 API 可能会更好。

Either way, the official recommendation is that unless you have a very good reason not to use it, you sdhould use DPL.不管怎样,官方的建议是除非你有很好的理由不使用它,否则你应该使用 DPL。 And generally speaking the perfomance of databases depends on the number of times disk access is needed and that isn't affected much by the API you use.一般而言,数据库的性能取决于需要访问磁盘的次数,而这受您使用的 API 的影响不大。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM