# Ruby ObjectDatabase is there any?

**URL:** <https://www.ruby-forum.com/t/ruby-objectdatabase-is-there-any/135048>\
**Category:** Ruby\
**Created:** [April 17, 2008, 1:18pm UTC](https://www.ruby-forum.com/t/ruby-objectdatabase-is-there-any/135048 "2008-04-17T13:18:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![axyd80](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/82dd89/32.png) [@axyd80](https://www.ruby-forum.com/u/axyd80)\
**Post date:** [April 17, 2008, 1:18pm UTC](https://www.ruby-forum.com/t/ruby-objectdatabase-is-there-any/135048/1 "2008-04-17T13:18:50Z")

</div>

Is there a real working Object Database(not ORM) written in Ruby or  
stable adapter to non-Ruby one?

I goggled for Ruby Object Database and found some projects, but haven’t  
found any real working solution.  
Mainly they just serialize objects and write it to disk with id. Not  
much usable.  
Also i found project trying to create adapter for db4o, but it’s in  
pre-alpha.

Maybe i missed something? Really hope i did 🙂

What i mean for real-working? As a sample pseudo code for the Java db4o  
database (very base feature, there are also a lot of functions):

class List;  
attr\_accessor :topics  
end

class Topic  
attr\_accessors :name, :text  
end

list = List.new  
list.topics \<\< Topic.new(‘fist’, ‘bla-bla’)  
list.topics \<\< Topic.new(‘second’, ‘bla-bla’)

db.put list

prototype = Topic.new(‘first’, nil) # Matcher for search  
topics = db.get prototype # topics contains all found topics

---

<div class="post-metadata">

**Author:** ![axyd80](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/82dd89/32.png) [@axyd80](https://www.ruby-forum.com/u/axyd80)\
**Post date:** [April 17, 2008, 1:25pm UTC](https://www.ruby-forum.com/t/ruby-objectdatabase-is-there-any/135048/2 "2008-04-17T13:25:05Z")

</div>

Right now i use a rough prototype (one of my friend told me that i’m  
crazy, when i show him what i did :))  
Anyway it’s just a prototype(with terrible performance) :).

I use eXist XML database with XPath support and objects-tree to XML  
mapping.

put: objects-tree =\> XML =\> eXist  
get: XPath =\> eXist =\> XML =\> objects-tree

Code for previous example with this scenario looks like:

db.get “//[@class = ‘Topic’ and @name = ‘first’]”
