Composer Atomic Vendor Swap vs Blue-Green Load Balancer for Zend Framework Zero-Downtime Migration
0 reputation · 11 Jul 2023, 23:41 UTC
Assuming Zend Framework 2.x with the default ModuleManager class map cache, the goal is to migrate a small application to updated dependencies without dropping active requests.
The constraint involves the autoloader’s cached class map and the ServiceManager’s lazy alias resolution. A Composer-driven atomic vendor swap keeps one directory live while dependencies change, but a stale class map can continue serving pre-migration code. A blue-green load balancer switches traffic between two directories, yet new service aliases introduced by the migrated module can fail if alias resolution changes while both versions remain reachable.
The unresolved decision is which approach preserves cache consistency and alias stability for a small deployment, and whether cache invalidation must precede or follow the traffic switch. This needs verification against the installed framework version.
- Does Composer’s atomic vendor replacement invalidate Zend Framework’s autoloader class map automatically, or must the cache be cleared separately before traffic moves?
- Can blue-green routing safely introduce new ServiceManager aliases when old and new directories share a database but not identical service configuration?
- Is there a documented cutover sequence that prevents alias resolution failures without taking the application offline?