Rails Octopus Gem - Master-Slave Replication connection behaviour when slave is down

。_饼干妹妹 提交于 2019-12-05 07:31:10

As I read in this blog post a powered-off or unresponsive slave may cause application failures because Octopus' default behavior is to write all data to the Master and read all data from the Slaves (as data written to the Master is than replicated to all connected Slaves). As stated on the Octopus wiki, "Multiple slaves" section reading in a multiple slave environment is done using round robin so it's always retrieving data from a slave per default.

Also taken from above mentioned blog: as a fallback mechanism you should read data from the Master directly (using .using(:master)) if none of the Slave nodes is available or data has not been fully replicated to the slaves yet. It may also be an option to cache changes/results application-wise to prevent repeated reads from the database nodes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!