Read-Only Mode For Better Rails Downtime

22-Oct-2020 1252
Recently I was looking to upgrade the Postgres version on an application I’ve been working on. This would require a small amount of downtime, likely about 10 minutes.The default solution I’d reach for in these cases would be to go into Heroku’s maintenance mode, which serves an HTML maintenance page with a 503 Service Unavailable status code. This works but makes the application entirely unusable during the upgrade, and I was hoping to find a better solution. In this particular case, I also wanted to be able to provide JSON responses as the application mainly provides an API for a mobile app.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle