具有Java客户端的键值数据库 [英] Key-Value Database with Java client

查看:75
本文介绍了具有Java客户端的键值数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上想将哈希表存储在磁盘上,以便以后查询.我的程序是用Java编写的. 哈希表从字符串映射到列表.

I basically want to store a hashtable on disk so I can query it later. My program is written in Java. The hashtable maps from String to List.

那里有很多键值存储,但是经过大量研究/阅读后,不清楚哪个键值存储最适合我的目的.这对我很重要.

There are a lot of key-value stores out there, but after doing a lot of research/reading, its not clear which one is the best for my purposes. Here are some things that are important to me.

  1. 简单的键值存储,使您可以使用单个键来检索值.
  2. 记录良好的Java客户端.
  3. 数据集很小,不需要高级功能.再次,我希望它很简单.

我研究了Redis和MongoDB.两者看起来都很有希望,但对我而言并不理想. 任何信息将不胜感激.

I have looked into Redis and MongoDB. Both look promising but not ideal for my purposes. Any info would be appreciated.

推荐答案

在提供任何答案之前,我会先问自己为什么我需要将此哈希表存储在磁盘上,因为根据您的描述数据集是很小,因此我认为它可以放入内存.如果只是为了在重新启动应用程序后能够重用此结构,那么您可以使用任何一种格式来保留它.

Before providing any sort of answers, I'd start by asking myself why do I need to store this hashtable on disk as according to your description the data set is small and so I assume it can fit into memory. If it is just to be able to reuse this structure after restarting your application, then you can probably use any sort of format to persist it.

第二,您没有提供Redis或MongoDB不理想的任何原因.根据您(简短)的3个要求,我会说Redis可能是您最好的选择:

Second, you don't provide any reasons for Redis or MongoDB not being ideal. Based on your (short) 3 requirements, I would have said Redis is probably your best bet:

  • 好的Java客户端
  • 不仅可以存储列表,还支持对列表值进行操作(因此数据不是不透明的)

我可能想消除Redis的唯一原因是您正在寻找严格的ACID特性.如果这是您想要的,那么您可以看看BerkleyDB JE.已经存在了一段时间了,文档也不错.

The only reason I could suppose for eliminating Redis is that you are looking for strict ACID characteristics. If that's what you are looking for than you could probably take a look at BerkleyDB JE. It has been around for a while and the documentation is good.

这篇关于具有Java客户端的键值数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆