简体   繁体   中英

Rails Observers on multiple servers

I wonder whether there is a method that I could fire observation (Model observers) on multiple rails servers ? Any help is highly appreciated

Depends on what you call observation, I assume it's model observers?

The point is each of your servers are isolated, so you can't share data easily without playing with Thread safety and Mutex objects; or shared temporary database table.

An easy way to have a central notification of model activity would be to use a (or a cluster of) redis server. Redis can be monitored by a Rail central process so when any of your server post an event in Redis, you Rail central process is notified right away.

http://redis.io/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM