I'm trying to do an application it need to connecting *multiple *databases, 
therefore how can i configure the database? itzi using *master and slave 
concept *?

* master and slave concept*
DB=Sequel.connect('mysql2://master_server/database',   
 :servers=>{:read_only=>proc{|db| {:host=>db.get_slave_host}}})
 def DB.get_slave_host
  @current_slave_host ||= -1
  "slave_server#{(@current_slave_host+=1)%4}"
end
 def DB.get_master_host
  @current_master_host ||= -1
  "master_server#{(@current_master_host+=1)%4}"
end

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to