Cloud Fundamentals (AWS)

Managed Databases and Serverless

35 мин

RDS: managed PostgreSQL

RDS runs PostgreSQL (or MySQL, MariaDB, SQL Server) for you: installation, patching, backups and failover. Your job shrinks to schema, queries, roles and sizing. Everything from the Database Administration track still applies; RDS just automates the server parts.

Settings to get right at creation:

Setting Recommendation
Subnet group private data subnets only
Public access No
Security group allow 5432 from the app's security group only
Multi-AZ on for production: a standby in another AZ with automatic failover
Backups automated, with PITR; retention 7 to 35 days
Encryption on (cannot be enabled later without a migration)
Deletion protection on
Parameter group custom, so you can tune settings like log_min_duration_statement

RDS Proxy pools connections in front of the database, which matters a great deal for Lambda functions that would otherwise open a connection per invocation.

Store the database password in Secrets Manager, which can rotate it automatically, rather than in plain environment variables.

Aurora

Aurora is AWS's PostgreSQL-compatible engine with storage replicated across three AZs and fast replicas. Aurora Serverless v2 scales capacity automatically, useful for spiky or unpredictable load.

Lambda: functions on demand

def handler(event, context):
    name = event.get("queryStringParameters", {}).get("name", "world")
    return {"statusCode": 200, "body": f"Hello {name}"}

Lambda runs your function when an event happens: an HTTP request (through a function URL or API Gateway), a file landing in S3, a message on a queue or a schedule (EventBridge). You pay per request and per millisecond, and nothing when idle.

Good fits: image resizing after upload, webhooks, scheduled jobs, glue between services, APIs with spiky traffic.

Watch out for:

  • Cold starts: the first request after idle takes longer.
  • Limits: 15-minute maximum runtime, payload size limits.
  • Connections: many concurrent functions can exhaust database connections; use RDS Proxy.
  • Observability: logs are spread across invocations; use structured logging and CloudWatch Logs Insights.

Queues and events

SQS queues decouple work: the web app puts "send welcome email" on a queue and returns immediately; a worker processes it, retrying on failure, with a dead-letter queue for messages that keep failing. SNS fans one message out to many subscribers. EventBridge routes events between services and runs schedules.

Check yourself

  • Which RDS settings cannot easily be changed after creation?
  • Why does Lambda need RDS Proxy more than a normal server does?
  • What does a dead-letter queue hold?

Ваш прогресс сохраняется только в этом браузере.

Отправить на проверку (10 баллов)