If a magento module "models" custom tables in the local Magento database, can it also be setup to "model" tables from an external database in parallel.

The config.xml global "models" tag appears to allow plural in it. So can I define a parallel 'external db connection' in resources and be able to use it with additional models, alongside the modelling of the custom tables in the local database.

Another way to rephrase this question is.. Can a magento module talk to tables in the local database and also in parallel talk to an external database using the ORM/ Model layer offered by Magento ?

                <!-- definition -->
            <rewrite><!-- definition --></rewrite>
        <(modulename)_setup><!-- definition --></(modulename)_setup>
        <(modulename)_read><!-- definition --></(modulename)_read>
        <(modulename)_write><!-- definition --></(modulename)_write>

1 Answer 1


If you don't find a solution to your problem the api functionality might work as an alternative. It's a fairly common usuage of magento so there is lot of support on here and stackoverflow. I think it could be a smoother task to develop as it should allow more flexibility with the external database in the event of changes to it and also alleviate some security risks of creating two connections inside Mage.

Some reading - Soap, Rest and Inchoo tutorial!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.