在不使用关系数据库的情况下用Java存储和检索对象的简单方法? [英] Easy way to store and retrieve objects in Java without using a relational DB?

查看:96
本文介绍了在不使用关系数据库的情况下用Java存储和检索对象的简单方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您知道不使用Hibernate之类的关系数据库/ORM来使用Java 存储和检索对象的简便"方法吗?

Do you know of an "easy" way to store and retrieve objects in Java without using a relational DB / ORM like Hibernate?

[请注意,我没有为此目的考虑串行化,因为它不允许在对象图的中间检索任意对象.由于DB4O的限制性许可,我也不考虑使用DB4O.谢谢.]

简单"(Easy)的含义:不必处理诸如键/值对之类的底层细节即可重建对象图(例如BerkeleyDB或传统缓存).这同样适用于从面向文档或列的数据库(CouchDB,HBase,...,甚至是Lucene)重建对象.

"Easy" meaning: not having to handle low-level details such as key/value pairs to rebuild an object graph (as with BerkeleyDB or traditional caches). The same applies for rebuilding objects from a document- or column-oriented DB (CouchDB, HBase, ..., even Lucene).

也许有一些有趣的项目在我不知道的存储系统和对象模型(例如ORM对于RDBMS)之间提供了一层集成.

Perhaps there are interesting projects out there that provide a layer of integration between the mentioned storage systems and the object model (like ORM would be for RDBMSs) that I am not aware of.

有人成功地在生产中使用了它们,还是尝试了关系数据库以外的持久性策略? RDF商店如何?

Anyone successfully using those in production, or experimenting with persistence strategies other than relational DBs? How about RDF stores?

更新:我碰到了一篇非常有趣的文章:

Update: I came across a very interesting article: A list of distributed key-value stores

推荐答案

我想我已经找到了解决我问题的答案.

I guess I have found a sort of answer to my question.

当您一向以关系,规范化和联接的方式来考虑数据时,要获得面向文档的范例心态并不是一件容易的事.

Getting the document-oriented paradigm mindset is no easy task when you have always thought your data in terms of relationships, normalization and joins.

CouchDB 似乎很合适.它仍然可以充当键值存储,但是它强大的查询功能(映射/减少,查看归类),并发就绪和与语言无关的HTTP访问使其成为我的选择.

CouchDB seems to fit the bill. It still could act as a key-value store but its great querying capabilities (map/reduce, view collations), concurrency readiness and language-agnostic HTTP access makes it my choice.

只有小故障才需要正确定义和将JSON结构映射到对象,但是我相信我会为Java和Scala的关系模型提供一个简单的解决方案(并且担心以后会缓存,因为争用是从数据库移开).兵马俑可能仍然有用,但肯定不像RDBMS方案那样.

Only glitch is having to correclty define and map JSON structures to objects, but I'm confident I will come up with a simple solution for usage with relational models from Java and Scala (and worry about caching later on, as contention is moved away from the database). Terracotta could still be useful but certainly not as with an RDBMS scenario.

谢谢大家的投入.

这篇关于在不使用关系数据库的情况下用Java存储和检索对象的简单方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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