Your company uses one Azure Database for PostgreSQL flexible server. Several development teams must decide how to organize their tables on this server. No team may provision an additional server.
Match each team's requirement to the way you should organize its objects. Each option can be used once, more than once, or not at all.
- Correct match: Separate schemas in one database.
Schemas inside one database allow related objects in different namespaces to reference each other through foreign keys. Separate databases would not work because queries cannot directly access objects in another database on the same server.
- Correct match: Separate schemas in one database.
Separate schemas in one database support queries that join data across namespaces. Separate databases would block the single-statement join because connections target one specific database.
- Correct match: Separate databases.
Each database is an isolated container selected when establishing a connection. Separate schemas provide namespaces within the same database and therefore do not provide separate database connection targets.
- Correct match: Default public schema in one database.
The application can keep its tables in public because it needs no additional organizational boundaries. Extra schemas or databases would introduce unnecessary structure.
Separate databases provide distinct connection targets and containers for application objects. Separate schemas organize objects within one database while allowing joins and foreign keys across namespaces. An application without separation requirements can use public in a single database.