Loose coupling separates components through limited, stable interfaces so they can change independently. In storage APIs, retrieving data and processing resources remain distinct concerns, preserving flexibility under change. section 23.3.2 section 23.3.3
Apply the pattern by:
- Giving input and output configurations separate interfaces. section 23.3.3
- Modeling retrieval and export needs separately: S3 inputs use globs, while S3 destinations use prefixes. section 23.3.2
- Reusing storage sources and destinations across multiple resource types. section 23.3.3
S3 import and export
A DataSource can describe an S3 bucket and glob such as a file-selection pattern. A separate DataDestination can describe the bucket and an exports/ prefix. Although the interfaces overlap, keeping them distinct avoids forcing import and export behavior into one contract. section 23.3.2
Listing 23.4 Example using S3 as a data destination
interface DataDestination {
type: string;
}
interface S3DataDestination extends DataDestination {
type: 's3';
bucket: string;
prefix: string; #1
}
Inspect the destination interface showing how export configuration expresses an S3 prefix independently from input selection. section 23.3.2
















