Browse the Ruby on Rails Community.

You are here: Forums Ask a Rails expert Dynamically reading from multi...

Replytotopic

Dynamically reading from multiple identically structured DBs...?

Posted in Forums : Ask a Rails expert

 
Profile

Authority 0
Posting Rating 70
Sign in to rate this post

Hi All,

I’m currently working with data from multiple existing databases. Each database contains identically structured (although different) data for various work sites. Basically each database is a collection of EVENT, TIMESTAMP, VALUE for various electrical work sites.

What I need to do is create a rails application that can dynamically access any of those “sites” to report data. I envision the following:

1) A main login/registration page that sends you to #2

2) A “Site List” page that basically lists available databases(as each DB is actually representative of the data from a single site) based on a required prefix so that the app can say for certain that it is a valid application database

3) Once a site is selected from #2 I can begin handing the data as if it were the “only” database around.

NOTE: I may desire to compare data from multiple “sites” on occasion so that is something I’d like to architect for if possible. Regardless, I need the most straightforward mechanism, or at least direction to some documentation on handling multiple databases in this capacity. I’ve seen many tutorials on “multiple connections”, but none that are quite as dynamic as what I’m looking for.

Thanks in advance.

 
Profile

Authority 0
Posting Rating 70
Sign in to rate this post

Apparently I can use “establish_connection” as I see fit.

Replytotopic

Other Recent Topics

Ask a Rails expert : nested application ApplicationController get called intead of children::ApplicationController

Ask a Rails expert : Best way to structure a database for a large/static dataset

Ask a Rails expert : Ruby Developer (ROR) - Scottish based (Remote working from within the UK)

Ask a Rails expert : Above Ground Pool Supplies

Ask a Rails expert : How to get url params in observer or model in Rails 3.1

Ask a Rails expert : What can persuade you to hire Junior Ruby devs with significant PHP experience?

Ask a Rails expert : What industry value does the Ruby or Rails Certification currently have?

Ask a Rails expert : Louis Vuitton Damier Azur Canvas specially sale ( www.salecheaplouisvuitton.com )

Ask a Rails expert : ·How to check errors/puts statements from ruby files which are under cronob

Ask a Rails expert : Louis Vuitton cheap Soft Sided Luggagespecial offer( www.salecheaplouisvuitton.com )

Formatting Help
  • *bold*       _italics_      
    bq. (quotes)
  • "DSC":http://www.dsc.net
  • * or # (lists)
or cancel