MySQL 主/从与 Castle Activerecord
我有一个现有的 Web 应用程序,使用 Castle Activerecord 与单个 MySQL 数据库进行交互。数据库最近被重新配置为复制到多个从站。
如何配置 Castle Activerecord 以直接写入 MySQL Master 并读取 MySQL Slave,或者是否有其他方法在此设置中透明地实现主/从操作?
I have an existing web application using Castle Activerecord to interact with a single MySQL database. The Database has recently been reconfigured to replicate to a number of Slaves.
How do you configure Castle Activerecord to direct writes to the MySQL Master and reads to the MySQL Slaves or are there other ways of achieving Master/Slave operation transparently in this setup?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从来没有这样做过,但我认为这种事情最好在数据库驱动程序级别处理。事实上, Connector/J 有一个特定的ReplicationDriver 用于此目的。 Connector/NET 文档 有对复制的相当模糊的引用:
I have never done this, but I think this kind of things are better handled at the DB-driver level. Indeed, Connector/J has a specific ReplicationDriver for this purpose. The Connector/NET documentation has a rather vague reference to replication: