哪个嵌入式DB用Java编写的简单键/值存储? [英] Which embedded DB written in Java for a simple key/value store?

查看:159
本文介绍了哪个嵌入式DB用Java编写的简单键/值存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近问了一个关于Neo4j的问题,我工作,似乎不错。它是可嵌入的,它是用Java编写的,并且没有太多的依赖关系。



但是它是一个图形DB,我不知道这是一个好主意,不要使用它作为一个简单的键/值存储。



基本上我有一个大的地图,在Java中会是这样:

  Map< Integer,Map< String,String>> 

我在主地图中有几千万个条目,每个条目包含自己一个地图/属性/值。 内部地图相对较小:约20个条目。



我需要一种方法来保存从运行webapp到另一个地图。



使用Neo4j,我做的是为每个ID(整数)创建一个节点,然后为内部映射中的每个条目设置一个属性。从我早期的测试看,它似乎工作,但我不知道这是一个很好的办法继续。



你会使用哪个嵌入式数据库,用Java? p>

要求是:

/ li>
  • embeddable(所以没有太大的东西)



  • 开源


  • 易于备份(我需要能够在服务器正在运行时)




  • 我的术语可能有点错误,帮助我/纠正我。对于我的地图地图,最适合是一个键/值对数据库对吗?



    我有点失去了键/值对之间的区别DB,文档数据库,大表,图表DB等。



    我也喜欢如果使用一个图形数据库像Neo4J为我的需要认为性能真的不会是一个问题,看到相对少量的条目,我会有)。



    当然我可以只是坚持我自己的地图的地图,但我真的不想重塑任何车轮在这里。我想重用一个经过试验和测试的数据库...



    (*)我不想要的SQL的原因是,我将永远有这个地图地图并且内部地图将不断发展,所以我不想要太结构化的东西。

    解决方案

    Google的 LevelDB 到Java的两个端口:





    嵌入式Java数据库的完整列表:




    I recently asked a question about Neo4j, which I got working and which seems nice. It's embeddable and it's written in Java and there aren't (too) many dependencies.

    However it's a graph DB and I don't know if it's a good idea or not to use it as a simply key/value store.

    Basically I've got a big map, which in Java would look like this:

    Map<Integer,Map<String,String>>
    

    I've got a few tens of millions of entries in the main map and each entry contains itself a map of property/values. The "inner" map is relatively small: about 20 entries.

    I need a way to persist that map from on run of the webapp to the other.

    Using Neo4j, what I did is create one node for every ID (integer) and then put one property for each entry inside the inner map. From my early testing it seems to work but I'm not sure it's a good way to proceed.

    Which embeddable DB, written in Java, would you use?

    The requirements are:

    • written in Java

    • embeddable (so nothing too big)

    • not SQL (*)

    • open source

    • easy to backup (I need to be able to make "live" backups, while the server is running)

    My terminology may be a bit wrong too, so feel free to help me / correct me. For my "map of maps", the best fit would be a key/value pair DB right?

    I'm a bit lost as the difference between key/value pairs DB, Document DBs, big tables, graph DBs, etc.

    I'd also like if it's a good idea to use a graph DB like Neo4J for my need (I think performance really ain't going to be an issue seen the relatively small amount of entries I'll have).

    Of course I could simply persist my map of maps myself but I really don't want to reinvent any wheel here. I want to reuse a tried and tested DB...

    (*) The reason I do not want SQL is that I'll always have this "map of maps" and that the inner map is going to constantly evolve, so I don't want something too structured.

    解决方案

    There seem to be a couple of ports of Google's LevelDB into Java:

    Then there is a whole list of embedded Java databases here:

    这篇关于哪个嵌入式DB用Java编写的简单键/值存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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