ADR 007 · Accepted
Multi-Provider Strategy
Status
Accepted (2024-01)
Context
Supporting multiple providers requires:
Dynamic provider registration.
Priority-based selection.
Configuration per provider.
Fallback mechanisms.
Decision
Use tagged service collection with priority:
Provider selection:
Explicit provider in the per-call options.
Otherwise the active DB-backed default configuration's provider.
Otherwise getProvider(null) throws a ProviderException.
There is deliberately no "first provider by priority" fallback: the implicit default-provider fallback was removed in ADR-034, so provider selection is always explicit (per-call option or the active configuration).
Consequences
Positive:
● Easy provider registration.
● Clear priority system.
●● Supports custom providers.
● Automatic fallback.
Negative:
◑ Priority conflicts possible.
◑ All providers instantiated.
◑ Configuration complexity.
Net Score: +5.5 (Strong positive impact - flexible multi-provider support with minor overhead)