Stefan Marinov's Wiki

"Exploration through intelligent machinery."

User Tools

Site Tools


en:scaling_webapps

Scaling Web Applications

This page outlines a few important points to consider when you want to scale your web application.

First and foremost, make sure that your code is clean and lean. Make sure that you are aware of all the bottlenecks your application is facing and that you have fixed all the problems which you found that stem from your programming. Services like New Relic can be of great help here.

Then, you should consider offloading big media uploads (like images and video), or various other resources, to an external CDN. You are free to use services like CloudFlare for your landing page, or where the most traffic gets burnt in general. However, please bear in mind that with the latter you get what you pay for (i.e. not much). A somewhat better solution currently is something like Amazon CloudFront, or even Akamai for really high-end services.

You may also consider using an HTTP load balancer or a proxy. For instance, nginx and HAproxy are capable of doing that quite well.

A crucial part that many people do wrongly in this stage is to push directly in production. Please, please first make sure that you perform as thorough performance tests as possible in order to prove your product prior to exposing it to your users. Initially, you should do that internally, and after that maybe even hire external contractors to verify (or disprove) the results you came up with.

Another thing that works great in practice is to evolve your architecture by breaking your program logic and APIs into multiple components. This makes upgrading and load balancing a lot easier. Delegating data away in more chunks is even possible (and often done) while maintaining the core database on secure servers in a trusted location.

So, to sum up, simply focus on improving how software gets written in your team and how it actually runs after being deployed, and don't just be looking at scaling the back-end as the solution to all your problems. It's a great thing to do when it's actually necessary, but in most cases people face a lot more serious problems without realising it, and some of them were discussed above.

However, when you've done everything above, you can (and actually should) start looking at the more widely used webhosting providers for large and important webapplications. Some of them currently are Hetzner, OVH, Amazon ELB, and many others.

en/scaling_webapps.txt · Last modified: 2015-07-28 16:03 by Stefan Marinov