You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Interest check: writing deciders in Clojure against the same SkilJ database
#206
This is a call for interest, not a plan. If you would use this, please say so
and describe your use case.
Idea
A small Clojure library that lets a Clojure service read events, decide, and
append to a bounded context that a Rust SkilJ server also uses. Same Postgres
database, same schema, same gapless sequence and DCB consistency check.
It would not be a port of SkilJ. The Rust server stays the owner of the schema:
provisioning, upgrades, key management, projections, and the GraphQL and REST
APIs.
What it would take
Move the commit step (lock the context's sequence row, check the
consistency query, insert events and tags, notify) into a per-context
PL/pgSQL function that the Rust server also calls, so there is one commit
path instead of two that can drift.
A Clojure runtime: query builder, JSON codec, blind-tag hashing, and a call
to that function. It checks skilj_schema_compatibility at startup and
refuses to run on a level it doesn't know.
A conformance suite derived from specs/skilj.allium, run against both
runtimes.
Known limits
Sync projections run Rust project() code inside the commit transaction, so
a context with sync projections could not accept Clojure writers unless
those projections become async.
Sensitive fields and blind tags need the key provider and blind-index key on
the JVM side. A first version would likely exclude contexts that use them.
Event and command types are registered from Rust types today. Clojure would
need its own registration path, or could only use already-registered types.
The commit function's signature becomes a compatibility contract.
Alternative that works today
Call a SkilJ server over GraphQL or REST from Clojure. No schema coupling, but decide() stays in Rust.
Why ask
As far as I can find there is no DCB event sourcing library for Clojure; the
existing ones (edd-core, Rill, everest, active-events) are stream or aggregate
based. But this is a fair amount of work and a second runtime to keep in step,
so it only makes sense with real interest.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
This is a call for interest, not a plan. If you would use this, please say so
and describe your use case.
Idea
A small Clojure library that lets a Clojure service read events, decide, and
append to a bounded context that a Rust SkilJ server also uses. Same Postgres
database, same schema, same gapless sequence and DCB consistency check.
It would not be a port of SkilJ. The Rust server stays the owner of the schema:
provisioning, upgrades, key management, projections, and the GraphQL and REST
APIs.
What it would take
sequencerow, check theconsistency query, insert events and tags, notify) into a per-context
PL/pgSQL function that the Rust server also calls, so there is one commit
path instead of two that can drift.
to that function. It checks
skilj_schema_compatibilityat startup andrefuses to run on a level it doesn't know.
specs/skilj.allium, run against bothruntimes.
Known limits
project()code inside the commit transaction, soa context with sync projections could not accept Clojure writers unless
those projections become async.
the JVM side. A first version would likely exclude contexts that use them.
need its own registration path, or could only use already-registered types.
Alternative that works today
Call a SkilJ server over GraphQL or REST from Clojure. No schema coupling, but
decide()stays in Rust.Why ask
As far as I can find there is no DCB event sourcing library for Clojure; the
existing ones (edd-core, Rill, everest, active-events) are stream or aggregate
based. But this is a fair amount of work and a second runtime to keep in step,
so it only makes sense with real interest.
All reactions