Untitled Lesson
Skill Matrix
UNLOCK NODES BY LEARNING NEW TAGS.
For which of these scenarios does local disk storage generally remain a legitimate, appropriate choice, rather than cloud object storage?
💻 Code Challenge | +75 XP
Design a StorageAdapter interface with save() and get() methods, implement both a LocalStorageAdapter and a stub S3StorageAdapter, and demonstrate business logic that depends only on the interface, not a specific implementation.
A team assumed cloud object storage was always the correct choice and migrated a low-volume, single-instance internal tool to S3, only to find the added complexity and cost weren't justified by their actual usage pattern. Reorder the steps to reassess this decision properly.
Task: Reorder the blocks in logical sequence to solve the problem.
A.D.A. Interface
Adaptive Didactic Assistant

Pascual Vila
Frontend Instructor // Code Syllabus
The Error //
Assuming cloud object storage is always the correct default choice regardless of actual deployment characteristics
// Not automatically wrong for every context:
// A single-instance internal tool with persistent disk
// might be genuinely well-served by local storage's simplicityThe Solution //
While cloud storage is the right default for most production, multi-replica web applications, a single-instance deployment with genuinely persistent disk, a local development environment, or purely temporary file needs can be entirely legitimate contexts where local storage's simplicity is a real, justified advantage rather than a shortcut.
The Error //
Building direct, hardcoded local file system calls throughout an application's business logic instead of behind an abstraction
// Wrong: hardcoded local fs calls scattered throughout business logic
await fs.writeFile(localPath, data);
// Correct: abstracted behind an interface, swappable later
await storageAdapter.save(key, data); // could be local OR cloud underneathThe Solution //
This makes migrating from local to cloud storage later (or vice versa) require touching every place file storage is used directly, rather than swapping one adapter implementation. A storage adapter interface, following the same principle as the Repository Pattern, keeps this flexibility available.