multi-pod destinations, generic load metric, hash member records #3
Merged
Conversation
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Breaking 0.2.0 overhaul. No backwards-compatible layer.
A destination is now served by a set of pods (1:N), not a single binding. Member records are hashes that carry both the address and an opaque integer load metric. Locks get their own Valkey record so transaction-bound calls route correctly when a destination is fanned out. The registry sits behind an LRU+TTL cache. Helpers are rewritten on top of the new API.
The library is now domain-neutral: identifiers and field names no longer assume databases. The PostgreSQL case is preserved as a worked example in the design doc.
Also: Apache 2.0 LICENSE +
publishConfig.access: publicso the package can be released to npm as OSS, and a genericcoordinator-pattern.mddesign doc linked from the README. CI now runs on Node 22, 24, and 26.Data model
<prefix>:member:<id>— hash withaddressandload. Heartbeat is an atomicHSET + EXPIREpipeline.<prefix>:destination:<id>— set of pod ids. Sole source of truth for routing. No separate binding key.<prefix>:lock:<lockId>— hash withpodId,destinationId, and lock metadata.Documentation
coordinator-pattern.mdat the repo root, linked from the README. Generic 3-tier design note covering caller / coordinator / resource pod, failover, fan-out, transactions and locks, and Kubernetes platform notes.load->pool.openCount(), lock id -> opaque token for the pinned PG connection, etc.).