Scaling a Ruby on Rails app on Heroku

28-Mar-2019 376
I have had to spend a considerable amount of time scaling Rails applications for things like major product launches to live TV events like SharkTank and Beyond The Tank and national TV marketing campaigns.From all that experience, the most effective way I have found to scale a web application is to do the following:Implement sufficient application performance monitoring (I use NewRelic)Gather data (ideally, load test until you scale out)Identify what the bottleneck wasFix the bottleneckšŸ” Repeat (until you hit a goal or run out of time)The reason why this is so effective is because it ensures that you spend your time fixing the actual constraint of your system.A great way to think about this come from the Theroy of Constraints:Any improvements made anywhere besides the bottleneck are an illusion. -Gene KimSo, in my experience, when scaling a Rails app the bottleneck typically falls into one of two large areas:The Database (Heroku Postgres in our case)The Rails ApplicationLetā€™s dive into each of those.
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