# system-design

## Vertical scaling

> Increasing the resources of a single server/machine to handle a higher workload\
> aka. **scaling up**

Disadvantage :

* resource ($$$)
* practical limit on how much server can scaled

## Horizontal scaling

> Add more servers/machine to handle increased workload\
> aka. **scaling out**

**Shared session state** refers to maintaining consistent user session data across multiple instances of a distributed application or system.

**RAID (Redundant Array of Independent Disks)** is a technology that combines multiple physical hard drives into a single logical unit to improve performance, fault tolerance, and storage capacity in data storage systems.

**Session caching** stores user session data in a shared cache for improved performance and scalability in distributed systems.

## Load balancing

> Load balancing refers to the process of distributing incoming network traffic or computing tasks across multiple servers, resources, or computing nodes\
> to ensure efficient utilization of those resources and to prevent overload on any individual server.

![Untitled](/files/ylPpZUrSiGz7cCiRahgc)

## Caching

> Caching refers to the practice of storing frequently accessed or computationally expensive data in a temporary storage location called a cache

## Database replication

> **Data Replication:**\
> Copying and synchronizing data across multiple locations for redundancy, availability, and fault tolerance.

## Redundancy

> Practice of having backup or duplicate components, systems, or resources that are ready to take over in the event of a failure.

**Active : Passive :** One system handles traffic while another remains on standby for failover, used for availability and minimizing downtime. (passive takes over active when active is down)

**Active : Active :** Multiple systems share incoming workloads actively, used to maximize resource utilization and scalability while maintaining availability.

## Database partitioning


---

# 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://aloy.gitbook.io/notes/system-design/system-design.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.
