Swapping TheAlgorithms-Java implementations behind an existing service API without dropping in-flight requests
0 reputation · 27 Mar 2026, 19:57 UTC
0 reputation · 27 Mar 2026, 19:57 UTC
A small Java service currently calls sorting and graph utilities from TheAlgorithms-Java directly by class name. The goal is to migrate to newer versions of those algorithm classes incrementally, while the service keeps handling concurrent requests with no observable downtime or changed outputs.
The documented behavior that matters here is that the library's data structures and algorithm implementations are effectively immutable and stateless, so old and new classes should be safe to run side by side under concurrent load. The uncertainty is at the integration boundary: the service's own API layer calls the algorithm classes statically, and generic type erasure in some implementations limits compile-time guarantees when legacy and modernized variants coexist on the classpath.
A test harness that replays identical inputs against both versions and compares output checksums is planned, but the rollout strategy itself is undecided.
Given these constraints:
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.