A data layer encapsulates access to database technology behind a stable interface. Services depend on repository functions rather than cloud- or vendor-specific database APIs, reducing rewrite effort when infrastructure changes. section 2.3.3
A practical data-layer design:
- Provides datastore implementations for supported database technologies. section 2.3.3
- Exposes a common datastore interface to the repository layer. section 2.3.3
- Uses automated fitness functions to enforce permitted layer dependencies and assess architectural adherence. section 2.3.3
Cloud and database migration
A service can move between GCP and another cloud, or change from AWS RDS for PostgreSQL to Aurora Serverless for MySQL, by rebuilding with a different datastore library instead of rewriting service and repository code. section 2.3.3





