docs: Score composition via refs, major architectural progress for simple yet type safe infrastructure component composition #342
Reference in New Issue
Block a user
No description provided.
Delete Branch "docs/score-composition-via-refs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Proposal to build loosely dependent but strongly typed infrastructure components using refs.
This means that a Zitadel score does not directly depend on a PostgreSQL score, but can be passed a PostgreSQLRef in its builder to know how to connect to it. This is much better than passing strings around as it allows for robust refactoring and extension to support new features without any risk of breaking string parsing in the consumer code.
I say loosely dependent because previous attempts were looking at dependency graphs and pipelines and the way they were envisioned forced much more inter-knowledge than an optional ref to a declarative desired state.
Also, a very important aspect of the refs is that they are not guaranteed to exist or have already converged when they are passed around. Just like kubernetes refs, they are eventually consistent and consumers should be resilient and handle eventual consistency themselves.
In my humble opinion, this is one of the things that kubernetes got fundamentally right : infrastructure is cahotic. You cannot expect an infrastructure component to be up, and even once it is up, it can go down anytime. A continuous convergence mechanism is the correct approach when drives fail, power goes out, buildings catch fire, etc.
The actual convergence mechanism is way out of scope of this p-r and ADR though, but passing around information as eventually consistent refs is a decision that makes sense in this consistency mode.