How to build an architecture that will handle high loads
Tags: appdev, softwaredev, techtalk, programming
Published: 2018-04-20 16:26:24

---
layout: post
title: "How to build an architecture that will handle high loads"
published: true
tags: app dev, software dev, tech talk, programming
cover_image: "https://thepracticaldev.s3.amazonaws.com/i/wit3hmjwr92a582hkxch.jpg"
---

When developing a software system, make sure it will be able to easily withstand high loads. Even if your project is rather small, in some moment you may need to scale. 

For example, if you run a marketing campaign and many users joined the system as a result, or a new additional feature unexpectedly brought a plenty of users, or you just expand your project. 

Certainly, if your plan is to create an Uber-like app or something like that (implying millions of users and millions of events per day, e.g., payments), you do need to focus on the scalability and high performance of your application. 


<b>Otherwise, you will definitely face the following problems:</b>

- Slow or endless page loading
- Random errors
- Disconnected connections from the web server
- Partial content loading (e.g., when there are no some images)
- Reduced user activity and customer losses


<b>A few words about high loads:</b>

- Highload begins when one physical server is unable and/or can't effectively process data
- If one instance serves 10,000 connections at the same time – it’s high load
Highload is about a simultaneous service of thousands and millions of users
- If you </span><a href="https://smartym.pro/blog/software-project-development-how-to-scale-your-application-with-amazon-web-services/"><span style="font-weight: 400;">deploy your application on Amazon Web Services</span></a><span style="font-weight: 400;">, </span><a href="https://azure.microsoft.com/"><span style="font-weight: 400;">Microsoft Azure</span></a><span style="font-weight: 400;">, or </span><a href="https://cloud.google.com/"><span style="font-weight: 400;">Google Cloud Platform</span></a><span style="font-weight: 400;">, you’re maintaining a high load architecture


<h2>Principles of creating apps that can handle high loads</h2>
 

<h4>Dynamics & Flexibility</h4>
 
When developing large-scale web applications, the main focus should be made on flexibility. Having a flexible architecture, you will be able to make changes and extensions much easier, which means reduced costs, time, and efforts. Keep in mind, that flexibility is the most important characteristic of any fast-growing software system.

 

<h4>Gradual project growth</h4>
 
It’s difficult to predict the audience size for the years to come, so it’s better to move focus to scalability. The same goes for the application architecture. Gradual solutions are the basis for successful software development.

If you're running a new application, it makes no sense to immediately provide an infrastructure that can handle millions of users and process millions of events a day. Use the cloud to host new projects, as it enables to make the server cost lowes and facilitates their management as well.

Also, many cloud hosting services provide private network services, allowing developers to safely use multiple servers in the cloud and make the system scaling.
 

<b>Scaling of any web application is a gradual process involving 4 steps:</b>

- Load analysis
- Determination of the areas most affected by the loads
- The transfer of these areas to individual nodes and their optimization
- Load analysis (again)



<b>Some tips</b>


Make sure that the application proportionally scales across servers as traffic flow grows. Stateless everything, </span><a href="https://en.wikipedia.org/wiki/Load_balancing_(computing)"><span style="font-weight: 400;">load balancing</span></a><span style="font-weight: 400;">, 90% cached, content delivery network, and so on – and you have a high load architecture.

However, cost-effectiveness is the key. Imagine that you have 100 thousands of users and one server. So, in order to obtain 120 thousands of users, you need to place another server. Quite complicated, isn’t it?

So, you should take one step behind and think – which part of the system causes a problem under load? If it’s a database, choose a high-scalable one before starting the project. Or take even several databases, for example, one for writes, one for reads (CQRS).

Defining and resolving performance issues in advance and without drastically increasing infrastructure costs – this is high load all about.


Find out <b></span><a href="https://smartym.pro/blog/high-load-architecture-how-to-develop-high-performance-scalable-applications/"><span style="font-weight: 400;">the ways of developing high-performance scalable architectures.</span></a><span style="font-weight: 400;"></b>