RR 297 Scaling Web Applications
Scaling Web Applications
On today’s episode, Charles Max Wood, Jason Swett, Brian Hogan, and David Kimura discuss Scaling Web Applications. Tune in and learn more as each of them share their own experiences in scaling Ruby applications!
Ruby Applications Scaling Experience
As far as playing around with scaling Ruby applications is concerned, Brian (or David) has tried using elastic load balancer or his own HomeBrew HAProxy. He has also used Engine X for routing a single connection that comes in, balancing it with multiple web servers. He pointed out that scaling is somewhat tricky and there are a lot parts in it.In Jason's experience, he has done HAProxy, Engine X, Unicorns, Puma, and many others. Lately, he tried scaling using Docker and Rancher for infrastructure and using Rancher's load balancing service. What makes it more interesting is that you'd get all the fundings that come along with launching containers.
Go-to Priority List
Since scaling is a bit of tricky, Jason makes sure that he has a go-to list that serves as his guide in ranking his priorities. He begins with how to keep his infrastructure simple. He then starts looking at data base reviews, query optimizations, and from where he pulls his data from. He sees that if one does not go through the step-by-step process, especially in setting up a more complicated structure, much time and effort are wasted when the output is only at the bottleneck of the data base level. Jason often begins with fragment caching with RAILS because he knows he can save a lot of time and work.
Insights on Active Record
Active record is great in managing A-record. If you have to get and modify A-record, it does all the heavy lifting job. However, it's rotten when it comes to building up complex single queries. As you develop your RAILS application, take a look at the queries and figure out if those are good. Don't simply rely on the queries that RAILS writes for you. Sometimes, they're not going to be optimized for speed but rather for how they programmed. If you examine these details, it will save you a lot of time. You will more likely encounter accidents in starting up if you will not pay attention to important procedures.To the learn more about _Scaling Web Applications _download and listen to the entire episode. If you’re short on time, here are the highlights of Scaling Web Applications:Experiences in scaling Ruby Applications? (00:28) Importance of a go-to list? (3:19) Reminder for everyone on using Active Record? (5:27) On the number of servers in scaling? (10:32) Importance of understanding the life cycle of an application? (17:36) Running a CDN vs public folder as a location for placing static assets? (21:45) General rule on premature optimization? (24:53) Right time for optimization? (35:20)