Key Terms
| Term | In one line |
|---|---|
| Registry discovery | Plugins declare themselves in a central manifest — explicit, auditable |
| Convention discovery | Found by location/naming — zero config, weaker governance |
| Service discovery | Entry points / service loaders — the packaging-system-native approach |
| Annotation discovery | Decorators register at import time — ergonomic, but import order matters |
| SemVer | MAJOR breaks, MINOR adds compatibly, PATCH fixes — the contract with plugin authors |
| Shadow mode | New version runs on live traffic, its output is discarded and compared |
| Canary | Small traffic percentage, ramped: 5% → 25% → 50% → 100% |
| Blue-green | Full parallel environment, instant switch, instant rollback |
Numbers That Matter
| Figure | Value | Where it bites |
|---|---|---|
| Canary ramp | 5% → 25% → 50% → 100% | Watch error rate, latency and quality metrics at each step |
| Risk exposure | Shadow ≈ zero · flag = very low, per-segment · blue-green = low, instant rollback · canary = low, increasing | The comparison table to reproduce |
| API versioning | URL · header · query param · content negotiation | URL versioning wins on debuggability, loses on proliferation |
Decision Rules
- Backward compatibility rules: adding an optional field is safe; adding a required one is not. Removing or renaming anything is a MAJOR. Changing the meaning of an existing field without renaming it is the worst break, because nothing fails loudly.
- Registry discovery for enterprise, convention for internal velocity. If you need to answer “what’s installed and who approved it,” you need a registry.
- Define contracts explicitly — ABCs in Python, protobuf for cross-language, OpenAPI/JSON Schema for HTTP. An implicit contract is one you’ll break accidentally.
- Shadow mode is the right first step for AI features specifically, because quality regressions aren’t visible in error rates. Run the new version on live traffic, compare outputs offline, ship nothing to users.
- Feature flags for per-segment exposure, canary for gradual blast-radius control, blue-green when rollback speed matters most. These compose — a canary behind a flag is normal.
- Support N-1 during migration. Provide a migration guide per major version, auto-migration tooling for config, and run side-by-side comparison before forcing the cut.
- Rollback must be tested, not assumed. A rollback path nobody has exercised is a hypothesis.
Say This Out Loud
“For AI features specifically I’d start with shadow mode rather than a canary. The problem with a canary on an AI feature is that the signals you’re watching — error rate and latency — stay green during a quality regression. In shadow mode the new version runs against live traffic, users never see its output, and I compare it offline against the current version and the golden set. Once quality is proven, then I canary for the operational risk.”
“My backward-compatibility rule is that adding an optional field is safe, adding a required one isn’t, and quietly changing what an existing field means is the worst break of all — because nothing errors, consumers just start being subtly wrong. That’s a major version bump even though the schema looks unchanged.”
“I’d use registry-based discovery in an enterprise context. Convention-based discovery is lovely for velocity, but the first time compliance asks what’s installed, who approved it, and what permissions it holds, you need a manifest with answers rather than a directory scan.”