Ask a Jedi: Multiple DSNs in ColdFusion Applications

I was a bit surprised by this question as it never occurred to me it that someone would even ask it, but heck, that was the reason for the Ask a Jedi series so maybe others are wondering as well. Audra asks:

Is it possible to create a ColdFusion application with 2 DSNs? Both database sources would have to be updated from the application. It's not the ideal situation, but we have two very large access databases, in which we have considered combining similar fields/tables. However, there are so many dependent functions and variables that the transition with have to contain many phases. And it would be best, in this particular situation, to work with two datasources.

The answer is yes, of course. There is no correlation between ColdFusion applications and how many datasources can be used. Obviously you don’t want to use too many. I’d say 90% of my applications used only one databases, and the rest used two or three. Typically these were old databases that we were not allowed to upgrade. Typically they were also very segregated databases that had content specific to only one small section of the site. But the short answer is yes, you can use as many DSNs as you want in an application.

Now - you may be restricted by your ISP. You probably want to check for then when shopping for a ColdFusion host. A decent one should give you at least five I’d say.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments