Welcome Guest, Not a member yet? Register   Sign In
Somewhat complex database setup required
#5

[eluser]dgreenhouse[/eluser]
[quote author="jedd" date="1248666257"]Howdi,

It's a shame that your technology decisions are being so grossly affected by previous bad business decisions, but on the upside there's plenty of stories around the forums from people who've happily connected to multiple databases using CI. Performance might be more of an issue for you if they're hosted a good way from each other (most of the questions I've seen are from people wanting to connect to DB's on the same LAN).

Something you didn't mention, and might not have considered -- and indeed might not be appropriate if you aren't using MySQL (I don't think you said what DB breed you're running) -- is using [url="http://forge.mysql.com/wiki/MySQL_Proxy"]MySQL Proxy[/url] as the sole 'virtual' database that your CI app will talk to. I've not played with this software yet, but what I've read suggests that it might be capable of front-ending your extant and new DB's, as you've described them, fairly seamlessly. Obviously it'll take you some time to assess what it's capable of, and whether the magic you need to perform with its configuration would be worth the effort.[/quote]

jedd,

Thanks for posting...

I can't say this was a bad business decision on the part of the client; it's just what they already had in place. Anyway, I think I've figured the direction to go in. I'll post back on the progress as I move forward so others can benefit.

BTW/ the database machines are physically close together and are connected by fiber. MySQL Proxy wouldn't work in this situation as I can't run what may be an unapproved binary package (I look into it later).

That's about it for now. I have to figure out if CI does some DB stuff while I have the main DBC switched out and making calls to the view. I wouldn't think so since you can run CI without a database.

Because of the complexity of the application, I considered using something else, but when I factored in the speed of CI, the simplicity of the API while still affording the use of some fairly solid framework code, I decided to stay.

Oh Ya... I'm switching DBC’s in my controllers and switching back before returning.
I've also extended the DB configuration array to include the credentials of the two additional DB's I need so the values were in one place.
(i.e.
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "host1";

$db['artwork']['hostname'] = "host2"; // Making calls separate from the API for now…

$db['gallery']['hostname'] = "host3";

)

I’ll be conducting some experiments to see how to use CI’s DB API while switched out, but I think that’s an area where I’d run into trouble. I can make it work by not letting CI know anything about the other DB, but I’d like to use CI’s infrastructure code. Obviously, I’ll have to dig deep into CI’s code base to see what it’s doing behind the scenes.

All the best...


Messages In This Thread
Somewhat complex database setup required - by El Forum - 07-25-2009, 08:57 AM
Somewhat complex database setup required - by El Forum - 07-25-2009, 01:15 PM
Somewhat complex database setup required - by El Forum - 07-25-2009, 02:11 PM
Somewhat complex database setup required - by El Forum - 07-26-2009, 04:44 PM
Somewhat complex database setup required - by El Forum - 07-26-2009, 07:56 PM
Somewhat complex database setup required - by El Forum - 07-26-2009, 08:11 PM
Somewhat complex database setup required - by El Forum - 07-26-2009, 08:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB