# DSDB (domain-specific database)?

**URL:** <https://www.ruby-forum.com/t/dsdb-domain-specific-database/145452>\
**Category:** Rails\
**Created:** [August 9, 2008, 9:24pm UTC](https://www.ruby-forum.com/t/dsdb-domain-specific-database/145452 "2008-08-09T21:24:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [August 9, 2008, 9:24pm UTC](https://www.ruby-forum.com/t/dsdb-domain-specific-database/145452/1 "2008-08-09T21:24:29Z")

</div>

Greetings!

I’ve begun working on a Ruby library that will process XML files known  
as CCRs (an ASTM standard). I’m at what feels like a major decision  
point and I could use some help thinking through the alternatives. Any  
feedback is much appreciated. So here goes …

I want the library to be useful both within a Rails app and in a  
standalone Ruby app. I want it to be useful both with and without using  
a database. I want to make it really easy to move the CCR contents from  
the XML file into a database and vice-versa. One person has suggested I  
approach this by writing an ActiveRecord adapter that treats the XML  
file itself as a domain-specific database. Importing the content of the  
XML file into MySQL, for example, could then be as easy as …

ccr = Xml\_Ccr.find(1) # get the content from the XML file / DSDB. ccr  
is now a set of associated AR objects  
ar\_ccr = Mysql\_Ccr.new(ccr) # create a new AR object based on the MySQL  
db  
ar\_ccr.save # save the records to the MySQL db

I could use some help getting my head around this DSDB notion. Is it  
doable? Does it make sense? Anybody got any experience with something  
like this? Or could point me to any readings that might help?

TIA,  
Bill
