简体   繁体   中英

issues with deploying rails servers to multiple hosts

I've heard often that deploying a traditional monolithic Rails app (ie no internal Web API, no message queue, no Redis/memcached server) to multiple servers can produce a bunch of bugs that are very hard to debug but I'm having a hard time coming up with some concrete examples despite a few hours of googling

Some obvious issues that I can think of are:

Observers - likely will not work properly as the observation is only propagated on one server and not all of them (assuming there is no Message Queue)

Sessions - would probably need to store these in the database which would need it's own host

Caches - any sweepers would have issues propagating invalidations between servers.

Anyone else care to contribute? I'd really appreciate any articles others may have come across or just general wisdom :)

Observers are just code callbacks. They run on each process, on each server.

Sessions have defaulted to the cookie store for the last few years. So multiple servers are no problem. If you don't have enough space in your cookie then I suggest you may be doing something wrong.

Cache invalidation is indeed a problem. But it always is. One solution is to break your cache out into a standalone service. Sites like Facebook have giant farms of memcache

I think scaling and clustering is always a hard problem. But this seems to be an old argument against rails. If anything the last few years have seen rails shine in this respect. With ec2, nosql, and server automation becoming quite a norm in the community.

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