# high traffic site optimization

### Two main approaches to apply optimization

Here are two ways to try to optimize a website; we have **top-down** and **bottom-up**. in top-down approach people debate about which programming language is faster. They say **WordPress** is slow and **ReactJS** is faster; which is true.\
&#x20;**Python** is faster and **NodeJS**, yes true.\
&#x20;So the point is, for having a really fast website, just *a faster programming language* cannot help so much. For any website to function (be loaded) we have these four levels (layers):

1. code level (php, go, python, etc)
2. service level (Apache, Nginx, LiteSpeed, etc)
3. architecture level (HA, LB, etc)
4. infrastructure level (network, dedicated server, VM, containers, etc)

We tested and realized that the same code, but in different **DataCenter** has different speed. Just changing the DataCenter. So when we can apply optimization from *top to bottom* (which works) we can apply it from *bottom-to-up* which is more effective.

We are going to cover these four layers and provide solutions for each laster and improve overall performance of the website we have.

**NOTE**\
&#x20;SVGs are used to better demonstration.

Here is the ineffective approach (top-down)

![](https://979184657-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MKaBkdqmnMBpbQoN3jo%2F-MKdGr2SS9PjmbwLOxju%2F-MKdH-wAMILojBM0hRfV%2Fhigh-traffic-site-optimization.svg?alt=media\&token=0dc3ebe4-b625-42a5-ace4-5f2aa46e0f94)

and here is the effective approach (bottom-up)

![](https://979184657-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MKaBkdqmnMBpbQoN3jo%2F-MKdGr2SS9PjmbwLOxju%2F-MKdHM4URboY6CXF80n3%2Fhigh-traffic-site-optimization-2.svg?alt=media\&token=1159069b-4143-4e21-8eea-f6c26c1ca42f)
