Skip to content

[#209] Add per-tenant snapshotting to the multi-tenancy demo - #4794

Merged
laura-devriendt-lemon merged 2 commits into
mainfrom
feature/axoniq/176/209_event_storage_snapshot_demo
Jul 30, 2026
Merged

[#209] Add per-tenant snapshotting to the multi-tenancy demo#4794
laura-devriendt-lemon merged 2 commits into
mainfrom
feature/axoniq/176/209_event_storage_snapshot_demo

Conversation

@laura-devriendt-lemon

@laura-devriendt-lemon laura-devriendt-lemon commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Adds per-tenant snapshotting to the multi-tenancy demo, the half of axoniq-framework#263 the demo did not yet cover. Tracked by axoniq-framework#209, which is what the #209 in the title refers to rather than anything in this repository.

What it adds

A new step 2 in DemoLifecycle.run. Both known tenants fill a course under the same identifier, so each tenant's own snapshot store ends up holding its own snapshot of that identifier. The run logs:

Course [cs-101] is snapshotted in both tenants' own snapshot stores: true.
Each snapshot holds only its own tenant's student, so neither read the other's: true.
Springfield's snapshot holds [alice], Shelbyville's holds [carol]

Snapshot isolation cannot be shown behaviourally, because a snapshot changes no behaviour. The demo therefore reads the two per-tenant stores through a new TenantSnapshots seam and compares snapshot contents. Comparing the framework's snapshot envelopes would prove nothing, since each envelope carries its own write timestamp and never compares equal to another, even if one tenant had read the other's snapshot.

Also included

MultiTenancyDemoIT failed about one run in four with CANCELLED: Unknown Context springfield on its first command. Provisioning waits until the tenant provider lists a tenant, which does not mean Axon Server routes to its context yet. The existing Enrollments.causedByTenantNotReady retry now covers every tenant's first command, not only the runtime-added one.

Depends on axoniq-framework#263

TenantSnapshotStoreFactory exists only on that branch, so examples CI fails here until it merges. Verified locally against feature/176/209_eventStore at cfa9839b92, where the 12 core tests, the declarative smoke test, and the Axon Server integration test all pass.

@laura-devriendt-lemon
laura-devriendt-lemon requested a review from a team as a code owner July 28, 2026 13:45
@laura-devriendt-lemon
laura-devriendt-lemon requested review from hjohn, jangalinski and smcvb and removed request for a team July 28, 2026 13:46
@laura-devriendt-lemon laura-devriendt-lemon self-assigned this Jul 28, 2026
@laura-devriendt-lemon
laura-devriendt-lemon marked this pull request as draft July 28, 2026 13:47
@laura-devriendt-lemon laura-devriendt-lemon added Type: Feature Use to signal an issue is completely new to the project. Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. labels Jul 28, 2026
@laura-devriendt-lemon laura-devriendt-lemon added this to the Release 5.3.0 milestone Jul 28, 2026
@laura-devriendt-lemon
laura-devriendt-lemon force-pushed the feature/axoniq/176/209_event_storage_snapshot_demo branch 2 times, most recently from 92233d4 to 1bc2cab Compare July 29, 2026 09:47
@laura-devriendt-lemon
laura-devriendt-lemon force-pushed the feature/axoniq/176/209_event_storage_snapshot_demo branch from 1bc2cab to 27d0936 Compare July 29, 2026 09:57
@laura-devriendt-lemon
laura-devriendt-lemon marked this pull request as ready for review July 29, 2026 10:04
@laura-devriendt-lemon
laura-devriendt-lemon force-pushed the feature/axoniq/176/209_event_storage_snapshot_demo branch from 1b39c86 to 3688bb4 Compare July 30, 2026 08:50

@smcvb smcvb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No concerns here. But, I must say, this "example" looks more like an extremely extensive integration test than a user-facing example. In other words, it's an example for us to ensure multi-tenancy works as intended, not an example to the user how to enable and use multi-tenancy.

Letting it slide, as I don't think we should enforce that distinction right now, but it's worth noting that the examples folder is essentially intended as material for users to comprehend how to achieve something. Having things like demo life cycle and outcome objects, to me, don't belong in a user's application, those belong in test functionality.

FYI, the examples build fails, so we should fix that before merging :-)

@laura-devriendt-lemon
laura-devriendt-lemon merged commit e40794f into main Jul 30, 2026
7 of 9 checks passed
@laura-devriendt-lemon
laura-devriendt-lemon deleted the feature/axoniq/176/209_event_storage_snapshot_demo branch July 30, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. Type: Feature Use to signal an issue is completely new to the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants