I'm try to do an application using ruby sinatra + ruby sequel and it need 
to *connecting multiple databases*. So how can i configure multiple 
databases connection in ruby sequel or using master/slave concept?          

*master/slave concept*


*DB=Sequel.connect('mysql2://master_server/database',                      
                         :servers=>{                                        
                        :read_only=>proc{|db| {:host=>db.get_slave_host}}, 
                                                                   
:default=>proc{|db| {:host=>db.get_master_host}}                            
                                  }                                    )def 
DB.get_slave_host  @current_slave_host ||= -1  
"slave_server#{(@current_slave_host+=1)%4}"enddef 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