← From Zero to Deployed Alle LektionenAll lessons Setup ModelleModels

Phase 1 · Grundlagen

07 · Cloud

Du kannst erklären, was „die Cloud“ ist und was du dort mietest, um eine App zu betreiben.

Phase 1 · Foundations

07 · Cloud

You can explain what "the cloud" is and what you rent there to run an app.

Damit deine App für andere erreichbar ist, muss sie auf einem Computer laufen, der immer online ist. Genau das mietest du in der Cloud — pro Minute, ohne eigene Hardware.

Die Idee

Die Cloud ist der Computer von jemand anderem — nur professionell, in großen Rechenzentren, die du mietest. Du kaufst keine Server, du mietest genau so viel, wie du gerade brauchst.

Instagram besitzt keine tausend Rechner im Keller. Es mietet Rechenleistung, die bei Andrang wächst (Silvesterabend, Millionen Fotos) und danach wieder schrumpft. Genau diese Elastizität macht die Cloud so nützlich.

So funktioniert es

Du mietest im Kern drei Dinge:

Vorteile: sofort verfügbar (Server in Minuten statt Wochen), skalierbar (wächst bei Andrang, schrumpft bei Ruhe), und jemand anderes kümmert sich um Strom, Kühlung, Hardware, Sicherheits-Updates.

In diesem Kurs ist das Ziel Google Cloud (GCP). Wir betreiben das Instagram-Backend auf Cloud Run (führt Container aus) und speichern die Beiträge in Cloud SQL (verwaltete Datenbank).

flowchart LR
    U[Nutzer] -->|HTTPS| CR[Cloud Run
dein Container] CR --> SQL[(Cloud SQL
Beiträge)] CR --> BLOB[Cloud Storage
Fotos]

So steuerst du es

Cloud Run ist serverless: es skaliert automatisch, auch auf null, wenn niemand da ist — du zahlst nur laufende Nutzung. Cloud SQL ist eine verwaltete Datenbank (Backups, Updates inklusive). Abgerechnet wird wie Strom: der Zähler läuft, solange etwas an ist.

Kosten sind hier konzeptionell wichtig: Neue GCP-Konten bekommen 300 $ Startguthaben für 90 Tage. Cloud Run ruht bei Nichtnutzung nahe null; man richtet einen Budget-Alarm ein und räumt nach Experimenten mit terraform destroy auf.

So sagst du es dem Agenten:

„Wir deployen auf Google Cloud: Cloud Run für den Container, Cloud SQL für die Beiträge. Richte das entsprechend ein.“

„Erkläre mir kurz, welche Kosten entstehen können und wie ich sie klein halte.“

„Sorge dafür, dass der Dienst auf null skalieren kann, damit er im Leerlauf fast nichts kostet.“

Typische Fehler: teure, dauerhaft laufende Ressourcen wählen; Budget-Alarm vergessen; oder nach dem Test nichts abräumen.

Kurz-Check

  1. Welche drei Dinge mietest du grob in der Cloud?
  2. Was heißt „serverless“ bei Cloud Run?
  3. Wo laufen bei uns Container und Datenbank?
Antworten anzeigen
  1. Compute (Rechenleistung), Storage (Speicher/Datenbank), Netzwerk (öffentliche Adresse).
  2. Es skaliert automatisch bis auf null; du zahlst nur, wenn Code wirklich läuft.
  3. Der Container auf Cloud Run, die Beiträge in Cloud SQL (Fotos in Cloud Storage).

For your app to be reachable by others, it has to run on a computer that is always online. That is exactly what you rent in the cloud — by the minute, without your own hardware.

The idea

The cloud is someone else's computer — just professional, in large data centers you rent from. You do not buy servers; you rent exactly as much as you need right now.

Instagram does not own a thousand machines in a basement. It rents compute that grows under load (New Year's Eve, millions of photos) and shrinks afterwards. That elasticity is what makes the cloud so useful.

How it works

You rent three things at heart:

Benefits: available instantly (servers in minutes, not weeks), scalable (grows under load, shrinks when quiet), and someone else handles power, cooling, hardware, security updates.

In this course the target is Google Cloud (GCP). We run the Instagram backend on Cloud Run (runs containers) and store the posts in Cloud SQL (a managed database).

flowchart LR
    U[User] -->|HTTPS| CR[Cloud Run
your container] CR --> SQL[(Cloud SQL
posts)] CR --> BLOB[Cloud Storage
photos]

How you steer it

Cloud Run is serverless: it scales automatically, even to zero when nobody is there — you pay only for actual usage. Cloud SQL is a managed database (backups, updates included). Billing works like electricity: the meter runs while something is on.

Cost matters conceptually here: new GCP accounts get $300 of credit for 90 days. Cloud Run idles near zero when unused; you set a budget alert and clean up after experiments with terraform destroy.

How to tell the agent:

"We deploy on Google Cloud: Cloud Run for the container, Cloud SQL for the posts. Set that up accordingly."

"Briefly explain what costs can arise and how I keep them small."

"Make sure the service can scale to zero so it costs almost nothing while idle."

Common mistakes: choosing expensive, always-on resources; forgetting the budget alert; or not tearing anything down after a test.

Quick check

  1. What three things do you rent in the cloud, roughly?
  2. What does "serverless" mean for Cloud Run?
  3. Where do our container and database run?
Show answers
  1. Compute (processing), storage (database/files), networking (public address).
  2. It scales automatically to zero; you pay only when code actually runs.
  3. The container on Cloud Run, the posts in Cloud SQL (photos in Cloud Storage).