Multiple Databases w/ RoR 4.2

35 views
Skip to first unread message

dwilde1

unread,
Dec 29, 2014, 2:40:17 PM12/29/14
to rubyonra...@googlegroups.com
Hi, all -

I'm prototyping a large application which will eventually have multiple open connections to MySQL and Neo4j data persist stores (aka databases). I would also like to maintain the existing development/test/prod switch behavior.

How can I configure this, or where would I start to patch?

Chrs Grgg

unread,
Dec 30, 2014, 1:36:10 AM12/30/14
to rubyonra...@googlegroups.com
If you want to have separate models for MySQL and Neo4j, look into the
Neo4j gem, https://github.com/neo4jrb/neo4j. It provides
ActiveRecord-like modules that let you build Neo4j models and work with
the database easily. It has a great community and development on the gem
is very active.

If you want to make it easy for ActiveRecord models to pull from Neo4j,
you can look into writing methods in your AR models that pull from Neo
using Neo4j-core, https://github.com/neo4jrb/neo4j-core. It requires a
lot more knowledge of the database, though, it's really just an API
wrapper with some helper methods to make certain basic tasks easier.

You can post on StackOverflow, open issues, or email any of the
maintainers if you need a hand.

--
Posted via http://www.ruby-forum.com/.

Don W.

unread,
Jan 7, 2015, 8:36:00 AM1/7/15
to rubyonra...@googlegroups.com
Thanks, Chris, I appreciate the support.

I've gotten further and now have the ActiveNode component from Neo4j
installed. I'm still working on getting multiple RDBMS connections
going, but I realized that what I can do is to have separate Rails
installs on distinct VMs for the portions of the code that need to use
distinct databases. I can use Ruby or C++ daemons to transfer data from
one RDBMS to another, and I can mash together UI components as needed in
the browser.
Reply all
Reply to author
Forward
0 new messages