Compute and storageeasy0-2 years
An EC2 instance type comes with a fast local NVMe disk. A teammate proposes putting a self-managed PostgreSQL data directory on it 'for speed', and after a planned stop/start of the instance for a resize, a Redis cache on the same kind of disk comes back empty. Explain what happened, and which workload belongs on which kind of storage.
That local disk is instance store: physical storage on the host machine the instance happens to run on. Stopping an instance releases that host, so the data on the instance store is gone; a host hardware failure loses it too. EBS is network-attached storage on AWS's own storage servers: it persists independently of the instance, survives a stop, a termination (if configured to) or the host failing, can be detached and reattached, and can be snapshotted. The cache coming back empty is instance store doing what it is designed to do. The rule: a database's data directory goes on EBS; a cache nothing depends on, a scratch disk or temp space can use instance store, because losing it costs only a warm-up.
PreviousA new ECS service cannot reach its RDS PostgreSQL database: the Hikari pool logs `connect timed out` after several seconds. A colleague says 'the database must be down'. What does a timeout tell you that a 'connection refused' would not, and how should the security groups be written?Next A service on ECS reads an access key and secret from `application.properties` (injected from a CI variable) to talk to S3 and Secrets Manager. You are asked to 'harden' it. What should replace the key, how does the SDK find credentials with no configuration, and what does the policy on the new identity look like?