Phoenix Comicon 2016 Attendees
Photo by The Green Arrow1, licensed CC-BY-SA 4.0.

What Do You Do if Your Website Gets Millions of Users Overnight?

Ten Ways to Prep for Success

Bill Karwin
The Pragmatic Programmers
4 min readJun 2, 2022

--

https://pragprog.com/newsletter/
https://pragprog.com/newsletter/

I was once asked in an interview: What’s the most common mistake made by database developers? I think the interviewer was expecting me to describe some special kind of SQL query that developers always get wrong.

I answered, “failure to plan for success.”

What I meant was: what happens when the app gets a lot of success and attention? How will you scale up to handle the traffic? How will you do backups or upgrades if the app is expected to function twenty-four hours a day with no time to do maintenance? Do you have a good system for system monitoring?

You might think it depends on what type of website you’re developing. A mobile game? A web service? A shrink-wrap software product? It doesn’t matter so much — many of the strategies are the same. Let’s assume for the sake of argument that it’s a mobile app that interacts with a back-end system via an API.

What are some of the things you need to do?

  1. Monitor traffic. I assume getting millions of users was part of the plan for this app, and that we have architected the application with the goal of handling heavy traffic, so it’s not going to crash and burn immediately. But keep an eye on it in case it does.
  2. Communicate. Let product managers know what has happened. They should prepare press releases, monitor social media mentions of your app, prepare your support team for a deluge of calls and emails, let the upper management know what to expect, and so on.
  3. Test payments. Make sure any payments made through the app are getting processed correctly, and keep monitoring that. The systems to run an app for that many users is going to get expensive, and we’ll need revenue.
  4. Monitor it. Make sure we have adequate monitoring systems to warn us if the load becomes too high. Establish a schedule to make sure some member of the DevOps team is paying attention to the monitoring at all times. Develop methods of estimating when the servers need to be scaled out.
  5. Secure it. Start a thorough code review for security flaws, especially the most common, SQL injection and cross-site scripting. Any app that has that many users is going to become a target for hackers very quickly. Also get prepared for DDoS attacks.
  6. Automate reports. Create automated reports of app usage for product managers. They’re bound to get excited and they’ll want to slice and dice the traffic fifty different ways. You won’t get any work done if you’re coding custom reports all day. Try to make a self-serve reporting interface, for example a New Relic dashboard.
  7. Plan for storage. Make sure we have enough storage space to store data for that many users. Forecast the growth rate of data and estimate how frequently we’ll have to provide more space.
  8. Watch performance. Monitor for performance bottlenecks that appear as the volume of data grows. For example, database queries that work adequately when querying 100 thousand rows, but not when querying 100 million rows.
  9. Manage expectations. Set expectations with sales and marketing, that your engineering team is going to be occupied keeping the site running for a while, so please don’t expect quick turnaround on development of new features.
  10. Get to work.

These ten items are not intended to be a complete list of everything you might need to do after your traffic grows a lot. The items in the list are just examples of things you should think about. Notice how many things you need to account for that are not part of the website code.

If you enjoyed this article, you might also like the first volume of Bill Karwin’s new SQL Antipatterns book, now in beta with The Pragmatic Bookshelf. You can save 35 percent with promo code bksap1_medium_2022 now through June 30, 2022. Promo codes are not valid on prior purchases.

--

--