Horizontale und vertikale Skalierung
Verstehen Sie die beiden grundlegenden Möglichkeiten, die Kapazität einer API zu erhöhen – Hochskalieren oder Erweitern – und wie Sie anhand von Kosten, Grenzen und Architektur zwischen ihnen wählen.
Horizontale und vertikale Skalierung ist eine kostenlose API Rate Limiting & Scalability Patterns-Lektion auf CoddyKit. Dies ist Lektion 4 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des API Rate Limiting & Scalability Patterns-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der API Rate Limiting & Scalability Patterns-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
Two Ways to Grow
When an API runs out of capacity you have two levers:
- Vertical scaling (scale up) — make the machine bigger
- Horizontal scaling (scale out) — add more machines
Each has very different cost and reliability profiles.
Vertical Scaling Explained
Vertical scaling means upgrading a single server: more CPU cores, more RAM, faster disks.
It is simple — no code changes — but you eventually hit the largest instance available, and that one box is a single point of failure.
Horizontal Scaling Explained
Horizontal scaling adds more identical servers behind a load balancer. Traffic spreads across the fleet.
- No hard ceiling — add nodes as needed
- One node failing does not take down the service
The Cost Curve
Vertical scaling cost rises steeply — top-tier hardware carries a premium. Horizontal scaling uses many commodity nodes, which is usually cheaper per unit of capacity at large scale.
Statelessness Enables Scale-Out
To scale out, any node must handle any request. That requires stateless services — no session data stored on the instance.
Push session and state to a shared store (Redis, a database) so nodes stay interchangeable.
// session in a shared store, not local memory
await redis.set('session:' + id, data, 'EX', 3600)Auto-Scaling Groups
Cloud platforms add or remove nodes automatically based on metrics like CPU or request rate.
You define a min, max, and a target metric; the platform keeps the fleet sized to load.
min_instances: 2
max_instances: 20
target_cpu_percent: 60When Vertical Still Wins
Scaling up is the right call when:
- The workload is hard to distribute (a single large in-memory dataset)
- You need a quick fix before re-architecting
- Licensing is per-node and a bigger box is cheaper
Diminishing Returns
Adding nodes is not free scaling — shared resources (a single database, a lock) become the new bottleneck. This is why scaling the data tier often matters more than the app tier.
Combining Both
Real systems mix strategies: right-size each node (a bit of vertical) then run many of them (horizontal). The goal is the best cost per request at your reliability target.
Measuring Before Scaling
Never scale blindly. Profile first to find the real constraint — CPU, memory, I/O, or a downstream dependency. Scaling the wrong dimension wastes money and hides the true bottleneck.
Scaling and Cost Awareness
Capacity is not free. A fleet sized for peak sits idle at night, burning money. Combine auto-scaling with right-sizing and consider spot or reserved capacity to match spend to real demand.
Quick Check
Check your understanding of scaling directions.
Recap
You compared scaling strategies:
- Vertical — bigger box, simple, but capped and a single point of failure
- Horizontal — more boxes, resilient, needs statelessness
- Auto-scaling sizes the fleet to load
- Always measure the real bottleneck first
Lerne API Rate Limiting & Scalability Patterns mit einem KI-Tutor — kostenlos
Schreibe und führe echten Code in deinem Browser aus, bekomme sofortige Hilfe von einem 24/7 KI-Tutor und setze dein Lernen im Web oder in der App fort.
- Kurse
- 12
- Lektionen
- 48
Häufig gestellte Fragen
Ist die Lektion „Horizontale und vertikale Skalierung“ kostenlos?
Ja — der vollständige Text von „Horizontale und vertikale Skalierung“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des API Rate Limiting & Scalability Patterns-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der API Rate Limiting & Scalability Patterns-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Horizontale und vertikale Skalierung“?
Verstehen Sie die beiden grundlegenden Möglichkeiten, die Kapazität einer API zu erhöhen – Hochskalieren oder Erweitern – und wie Sie anhand von Kosten, Grenzen und Architektur zwischen ihnen wählen. Du übst API Rate Limiting & Scalability Patterns mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um API Rate Limiting & Scalability Patterns zu starten?
Keine Vorkenntnisse erforderlich. API Rate Limiting & Scalability Patterns auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 4 von 4.
Wie lange dauert die Lektion „Horizontale und vertikale Skalierung“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser API Rate Limiting & Scalability Patterns-Lektion Code schreiben und ausführen?
Ja. Jede API Rate Limiting & Scalability Patterns-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- API-Skalierbarkeit verstehen
- Wichtige Skalierbarkeitsmetriken
- Zustandslose und zustandsbehaftete API-Architektur
- Horizontale und vertikale Skalierung