John Siracusa <[EMAIL PROTECTED]> writes:
> Did you ask about this before, or was it someone else?  When it was asked
> earlier, I had a simple answer which I now seem to have forgotten... :)

I think it was someone else, though it's not impossible I asked before
and forgot.

It is, ultimately, the one thing that has kept me using all my
home-grown stuff, because my applications need that level of
scalability.

> I can imagine a new feature or RDBO subclass that formalizes this,
> but I'd like it to be generic.  I'm not sure how that'd look.  Maybe
> a mapping of actions to dbs?  Like save() in foo db, load() from bar
> db, maybe even insert() in blah db, update() in blag db.

Well, the only scenario I have used is where lookup queries the slave
and everything else happens on the master (since, presumably, your
multi-master setups "just work").

However, a moment's thought brings to mind the question of partitioned
data storage---users with names a-d go on server 1, e-j on server 2,
etc---which could be done if save() or load() looked at the primary
key and directed traffic appropriately.

Hmm.  The method you outlined in your message of swapping DB handles
dynamically didn't seem all that arduous.  Perhaps just the tiniest
bit of infrastructure could help.

I guess I'm thinking along the lines of a hook for each operation
where you could install that would get called with a reference of the
object at hand and could inspect the object to its heart's content to
determine what database to run it against?

Then people could do things like:

sub save_hook {
  my ($self) = shift;

  if ($op eq "get") {
    $self->db (My::DB->new ('slave');
  } else {
    if ($self->isa ('Partitioned table')) {
      $self->db (My::DB->new ($self->lookup_pkey)); # mastera, masterb, 
masterc, etc
    } else {
      $self->db (My::DB->new ('master');
    }   
  }
}

Or something along those lines.  But that's a totally off-the-cuff,
haven't-really-examined-RDBO notion.  It might be utterly infeasible.

Mike
-- 
I'm afraid of Americans -- David Bowie


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to