Using Outlet ORM with more than one database

21 views
Skip to first unread message

Prelude

unread,
May 23, 2011, 5:20:48 AM5/23/11
to Outlet ORM
Hello!

Can somebody tell me if it is possible to use Outlet ORM with more
than one database at a time? I mean, using an instance of Outlet
configured to the structure of a database and another instance
configured to the structure of another database?

My scenario is the following: I have a "master" database and many
"networks" databases that rely on the same Entity-Relationship
diagram. The "master" database has a table named "networks" that
cointain records that identify "networks" and then, when I select a
network I get the ID from the primary key of this table and load the
according database that is named after this ID. The same as having a
relationship between tables but with this design I make the same but
using a database instead. The reason to have this is to improve
performance when fetching data and to isolate the "networks" related
data.

I tried to create two instances of Outlet but when I load the second
table it gives me an error saying OutletException is already loaded.

I'll appreciate feedback on this.

Many thanks to all.

Best regards,
Hugo Teixeira

Luís Otávio

unread,
May 24, 2011, 7:22:25 PM5/24/11
to outle...@googlegroups.com
Hello Hugo!
 
Sorry by the delay...
 
Today we don't have a way to do that... =/
You can try to, but only if the databases are located on the same server, to concat the database name on the table name (db.table)... I've never tryed...
 
We have to implement that on Outlet, its an important feature!
 
Best reguards,
 
Luís


--
You received this message because you are subscribed to the Google Groups "Outlet ORM" group.
To post to this group, send email to outle...@googlegroups.com.
To unsubscribe from this group, send email to outlet-orm+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/outlet-orm?hl=en.


Rasmus Schultz

unread,
May 25, 2011, 8:21:20 AM5/25/11
to Outlet ORM
Hugo,

Just out of curiosity - and more a question about your design than
Outlet as such. Seems like it would take a lot of maintenance, setting
up a new database for every client or user. How come you don't simply
prefix your table-names with the client or user name, and group them
together that way?

It seems like that would be a much easier infrastructure to maintain,
particularly in terms of creating new databases, but probably also
running backups, etc.

Just a thought :-)

You didn't mention which DBMS you're using, but in terms of
performance, MySQL uses a table-per-file pattern, so you have nothing
to gain by "clustering" your table schema into separate databases. If
anything, it's probably slower to maintain connections to many
different databases instead of just one.

Of course, I don't know any of the other requirements for your
project, and you may have other design considerations - physical drive
space, political reasons, etc... Just thought I'd mention it
though :-)

- Rasmus


On May 24, 7:22 pm, Luís Otávio <lcobu...@gmail.com> wrote:
> Hello Hugo!
>
> Sorry by the delay...
>
> Today we don't have a way to do that... =/
> You can try to, but only if the databases are located on the same server, to
> concat the database name on the table name (db.table)... I've never tryed...
>
> We have to implement that on Outlet, its an important feature!
>
> Best reguards,
>
Reply all
Reply to author
Forward
0 new messages