# Multiple Databases - Archive and Current Databases Question

**URL:** <https://www.ruby-forum.com/t/multiple-databases-archive-and-current-databases-question/130128>\
**Category:** Rails\
**Created:** [February 25, 2008, 5:02pm UTC](https://www.ruby-forum.com/t/multiple-databases-archive-and-current-databases-question/130128 "2008-02-25T17:02:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![newrubygirl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e274bd/32.png) [@newrubygirl](https://www.ruby-forum.com/u/newrubygirl)\
**Post date:** [February 25, 2008, 5:02pm UTC](https://www.ruby-forum.com/t/multiple-databases-archive-and-current-databases-question/130128/1 "2008-02-25T17:02:40Z")

</div>

I’ve got a few different databases - 2 that hold archive data and 1 that  
holds current working application data.

The 2 archive databases hold tables for quality assurance and are  
extremely large datasets, but they are not part of the working rails  
application. The way that it works is that I need to query data in the  
2 archive databases before I run a job in the rails app. If the 2  
queries don’t bring back the expected results, I don’t want to run the  
job.

What is the best way to set up the connections to run the queries in the  
2 archive databases prior to running a job in the rails app? Do I need  
to create separate models for the archive queries? If so, how do I make  
sure to tell my controller to run those before running the job? Or does  
this all fit into the model that runs the job with these queries running  
first? If so, how do I query the other 2 databases?

Thanks once again for the amazing help!
