Tips for Scaling a Web App

Winged sphinx from Darius' palace at Susa. Gla...
Image via Wikipedia

One of the nice problems to have as a startup grows is scaling the web app. Scaling the web app encompasses not only the back-end infrastructure but also the user interface components as well. We like to take the approach of providing oxygen (client usage) to the new features and improvements as quickly as possible and iterate from there, resulting in scaling rework once the need arises.

Here are a few tips to keep in mind when scaling a web app on the front-end and back-end:

  • Consider caching the values of any SQL COUNT() calls as new columns in the database updated asynchronously on a schedule (we’ve encountered this many times resulting in performance hits until they are corrected)
  • Be wary of database-level full-text searching or advanced searches of structured information as specialized indexers like Sphinx and Lucene are much better suited
  • Any user interaction that takes more than five seconds should put in a background job that triggers a message to the user when complete
  • Consider the user experience when something like a drop down or chooser has a large number of fields (e.g. once a drop down has more than 15 choices have it change to a type-ahead selector or some other input type)
  • Implement an aggressive archiving plan early of for any data that isn’t critical and can accumulate over time as it is harder to take things away later as opposed to providing more (e.g. how much time certain data is available before it is purged)

These are just a few of the items to be cognizant of when scaling the front and back-end of a web app.

What else? What are some other tips for scaling?

Comments

3 responses to “Tips for Scaling a Web App”

  1. […] updated asynchronously on a schedule (we’ve encountered this … Follow this link: Tips for Scaling a Web App « 10000 Startup Hours – David Cummings Posted in Uncategorized Tags: calls-as-new, count, database, new-columns, online tips, sql, […]

  2. Charles Brian Quinn Avatar

    With computing becoming a commodity due to cloud computing advances, an easy way to scale a web app is to literally just “throw hardware” at the problem. Not to be trite about it, but this is relatively easy and cheap to do. Developers are expensive, hardware is not, these days. A developer may cost $100 an hour, but an Amazon Extra-Large Instance (15 GB of memory, 8 “cpus”) at the time of this writing is $0.68 an hour.

    As you mentioned, having a scaling problem is always a good thing. I’ve never heard a client of ours say: “wow, we’ve got all these customers paying us all this money for our service, I wish that instead of launching sooner, and scaling later, that we would have solved all our scaling problems first, instead.” Ask the guys at Twitter if they would have preferred to launch 6 months to a year later without any scaling problems, or if they would have preferred to launch first, and the scale later.

    If you have to do scaling activities, always perform some metrics first. Never make an improvement or “change” to a web app without some type of metric, so you can say: “that new de-normalized count column addition now causes the dashboard to load 20% faster.” Plenty of tools out there like (shameless self-promotional plug) Scout http://scoutapp.com/ and I believe (plug for your product) Rigor http://rigor.com/ can do performance analytics to help guide changes.

    Great post, David, thanks!

    1. David Cummings Avatar
      David Cummings

      Thanks Charles. Great stuff!

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.