I recently tried moving to a master/slave setup using the slave as a read 
only. We're using Postgres 9.3. The configuration was easy enough, but I'm 
noticing what I'm pretty sure is replication lag given the errors coming 
back.

For the purposes of our application, what I would like to is be able to set 
certain controller actions or situations to use the read only server (or 
servers in the future) and others that have to handle writes and sometimes 
combined reads to go to the master. Can I encapsulate things in a block or 
set a variable in certain contexts. I know I can force a server in a 
dataset with #server but I know there are going to be some contexts where 
I'd be easier just to wrap things in a block.

Aaaand... as I typed this it appears that 
Database#synchronize(<server_name>) { ... } would do the trick. Would I be 
correct in this?

-- 
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 https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to