Would love to understand better how to deploy Rails with fly and still benefit from multi-region/failover/scaling
p.s. horrible nitpick, but I think it’s SECRET_KEY_BASE :)
Would love to understand better how to deploy Rails with fly and still benefit from multi-region/failover/scaling
p.s. horrible nitpick, but I think it’s SECRET_KEY_BASE :)
We have a Gem to make it almost transparent: https://github.com/superfly/fly-ruby
Replication lag is handled too in the Ruby library we pin requests to the for a few seconds. In our Elixir library, we actually monitor the read replica directly and reroute writes until it's caught up.
What about redis / sidekiq btw? :)
We use sidekiq + Fly in a single region with the primary database, and then write to the Redis from other regions asynchronously. It's a good time in Ruby world, I think Ruby 3 will simplify a lot of the weird background work people do.
Ruby 3 will definitely help us solve the problem of gets that do writes for stats or history, since those things can be done async. You can do a little of it now just by spawning a thread and writing the the writable Postgres in the background.