# Backend Optimization

1. Content Delivery Network helps with accelerating web site delivery by caching its files in servers around the world and served content to users from the nearest server. All you need to do is update your DNS name servers to use Cloudfare.&#x20;

Benefits:

* Improve page load speed because it reduce latency and jumping between routers as cached content is served from nearest server
* Security (prevent scrapper, DDOS attack)
* Load balancing

2\. GZIP can optimize performance because it makes the files smaller and very easy to implement. For example in Express App, we have middleware called compression.

3\. Database Scaling principles:

* Identify inefficient queries
* Increase memory
* Vetical Scaling (Redis)
* Sharding (Separating database based on certain criteria)
* More Database (Distributed)
* Database type

4 Caching

5\. Load Balancer using NGINX, but usually provided by cloud provider like AWS out of the box


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://edsonha.gitbook.io/my-gitbook/junior-to-senior-1/performance/backend-optimization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
