Skip to content

Conversation

DavidBadura
Copy link
Member

@DavidBadura DavidBadura commented Jul 28, 2025

Implement Dynamic Consistency Boundary according to https://dcb.events/.

The following examples were partially implemented:

There are still some questions open:

  •  How do we handle the different streams? It should be possible to use different streams for different bounded contexts. Currently, this is not reflected in the API.
  •  The EventTagExtractor must handle value objects. The current implementation requires PHP's Stringable interface, which requires a __toString() method. Since this can lead to problems, we need an alternative.
  •  Filtering event types is not yet implemented.
  • Is archiving still possible? Is it necessary? Can this possibly be implemented with tags? -> for DCB: no
  • The Projection API isn't fully developed yet. Returning QueryComponent instead of tags directly? Apply should be converted to Attributes.

@DavidBadura DavidBadura added this to the 3.12.0 milestone Jul 28, 2025
@DavidBadura DavidBadura force-pushed the DCB branch 2 times, most recently from 5adaa31 to c85eace Compare July 28, 2025 10:58
Copy link

github-actions bot commented Jul 28, 2025

Hello 👋

here is the most recent benchmark result:

SimpleSetupStreamStoreBench
===========================

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 1.010ms (±0.00%)   | 1.027ms (±0.00%)   | -1.67%    | 35.201mb        | 34.991mb   | +0.60%      |
| benchLoad10000Events ()                | 57.046ms (±0.00%)  | 58.368ms (±0.00%)  | -2.26%    | 35.201mb        | 34.528mb   | +1.95%      |
| benchSave1Event ()                     | 1.080ms (±0.00%)   | 1.091ms (±0.00%)   | -0.98%    | 34.674mb        | 34.528mb   | +0.42%      |
| benchSave10000Events ()                | 292.100ms (±0.00%) | 294.342ms (±0.00%) | -0.76%    | 34.674mb        | 34.528mb   | +0.42%      |
| benchSave10000Aggregates ()            | 8.217s (±0.00%)    | 8.306s (±0.00%)    | -1.07%    | 34.674mb        | 34.528mb   | +0.42%      |
| benchSave10000AggregatesTransaction () | 5.101s (±0.00%)    | 5.080s (±0.00%)    | +0.41%    | 34.674mb        | 34.528mb   | +0.42%      |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SubscriptionEngineBatchBench
============================

+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
|                           | time (kde mode)                                   | memory                                     |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| subject                   | Tag: <current>    | Tag: base         | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| benchHandle10000Events () | 76.375ms (±0.00%) | 76.020ms (±0.00%) | +0.47%    | 34.961mb        | 34.813mb   | +0.43%      |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+

SnapshotsBench
==============

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad10000EventsMissingSnapshot () | 53.304ms (±0.00%)  | 55.203ms (±0.00%)  | -3.44%    | 34.565mb        | 34.418mb   | +0.42%      |
| benchLoad10000Events ()                | 890.300μs (±0.00%) | 961.600μs (±0.00%) | -7.41%    | 34.564mb        | 34.418mb   | +0.42%      |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SubscriptionEngineBench
=======================

+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
|                           | time (kde mode)                               | memory                                     |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
| subject                   | Tag: <current>  | Tag: base       | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
| benchHandle10000Events () | 3.251s (±0.00%) | 3.168s (±0.00%) | +2.63%    | 47.107mb        | 46.961mb   | +0.31%      |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+

SimpleSetupTaggableStoreBench
=============================

+----------------------------------------+--------------------+-----------+-----------------+-------------+
|                                        | time (kde mode)                | memory                        |
+----------------------------------------+--------------------+-----------+-----------------+-------------+
| subject                                | Tag: <current>     | time-diff | Tag: <current>  | memory-diff |
+----------------------------------------+--------------------+-----------+-----------------+-------------+
| benchLoad1Event ()                     | 897.000μs (±0.00%) | +0.00%    | 35.821mb        | +0.00%      |
| benchLoad10000Events ()                | 58.174ms (±0.00%)  | +0.00%    | 35.822mb        | +0.00%      |
| benchSave1Event ()                     | 1.032ms (±0.00%)   | +0.00%    | 35.821mb        | +0.00%      |
| benchSave10000Events ()                | 316.585ms (±0.00%) | +0.00%    | 35.822mb        | +0.00%      |
| benchSave10000Aggregates ()            | 8.345s (±0.00%)    | +0.00%    | 35.822mb        | +0.00%      |
| benchSave10000AggregatesTransaction () | 5.137s (±0.00%)    | +0.00%    | 35.822mb        | +0.00%      |
| benchAppend1Event ()                   | 1.148ms (±0.00%)   | +0.00%    | 35.822mb        | +0.00%      |
| benchAppend100Events ()                | 7.221ms (±0.00%)   | +0.00%    | 35.822mb        | +0.00%      |
+----------------------------------------+--------------------+-----------+-----------------+-------------+

SimpleSetupBench
================

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 858.400μs (±0.00%) | 997.700μs (±0.00%) | -13.96%   | 34.560mb        | 34.344mb   | +0.63%      |
| benchLoad10000Events ()                | 52.061ms (±0.00%)  | 52.938ms (±0.00%)  | -1.66%    | 34.560mb        | 34.344mb   | +0.63%      |
| benchSave1Event ()                     | 987.300μs (±0.00%) | 1.021ms (±0.00%)   | -3.34%    | 34.560mb        | 34.344mb   | +0.63%      |
| benchSave10000Events ()                | 216.324ms (±0.00%) | 215.970ms (±0.00%) | +0.16%    | 34.560mb        | 34.344mb   | +0.63%      |
| benchSave10000Aggregates ()            | 8.276s (±0.00%)    | 8.260s (±0.00%)    | +0.19%    | 34.560mb        | 34.344mb   | +0.63%      |
| benchSave10000AggregatesTransaction () | 4.900s (±0.00%)    | 4.872s (±0.00%)    | +0.56%    | 34.560mb        | 34.344mb   | +0.63%      |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SplitStreamBench
================

+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                         | time (kde mode)                                     | memory                                     |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                 | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad10000Events () | 4.549ms (±0.00%)   | 4.602ms (±0.00%)   | -1.13%    | 37.867mb        | 37.721mb   | +0.39%      |
| benchSave10000Events () | 333.607ms (±0.00%) | 340.701ms (±0.00%) | -2.08%    | 37.869mb        | 37.723mb   | +0.39%      |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

PersonalDataBench
=================

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 855.200μs (±0.00%) | 917.300μs (±0.00%) | -6.77%    | 35.693mb        | 35.548mb   | +0.41%      |
| benchLoad10000Events ()                | 94.801ms (±0.00%)  | 95.616ms (±0.00%)  | -0.85%    | 35.693mb        | 35.548mb   | +0.41%      |
| benchSave1Event ()                     | 1.458ms (±0.00%)   | 1.545ms (±0.00%)   | -5.60%    | 35.693mb        | 35.548mb   | +0.41%      |
| benchSave10000Events ()                | 256.692ms (±0.00%) | 260.156ms (±0.00%) | -1.33%    | 35.695mb        | 35.549mb   | +0.41%      |
| benchSave10000Aggregates ()            | 12.622s (±0.00%)   | 12.590s (±0.00%)   | +0.25%    | 35.693mb        | 35.548mb   | +0.41%      |
| benchSave10000AggregatesTransaction () | 9.105s (±0.00%)    | 9.128s (±0.00%)    | -0.25%    | 36.196mb        | 36.050mb   | +0.40%      |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

This comment gets update everytime a new commit comes in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants