Skip to content

DCB#763

Merged
DavidBadura merged 28 commits into
4.0.xfrom
DCB
Sep 22, 2025
Merged

DCB#763
DavidBadura merged 28 commits into
4.0.xfrom
DCB

Conversation

@DavidBadura

@DavidBadura DavidBadura commented Jul 28, 2025

Copy link
Copy Markdown
Member

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. -> implemented
  •  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. -> use Identifier component
  •  Filtering event types is not yet implemented. -> 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. -> done

@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
@github-actions

github-actions Bot commented Jul 28, 2025

Copy link
Copy Markdown

Hello 👋

here is the most recent benchmark result:

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

+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                         | time (kde mode)                                     | memory                                     |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                 | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad10000Events () | 3.456ms (±0.00%)   | 3.481ms (±0.00%)   | -0.70%    | 36.355mb        | 36.297mb   | +0.16%      |
| benchSave10000Events () | 514.049ms (±0.00%) | 536.971ms (±0.00%) | -4.27%    | 36.425mb        | 35.897mb   | +1.47%      |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

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

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 1.070ms (±0.00%)   | 1.201ms (±0.00%)   | -10.84%   | 35.799mb        | 35.799mb   | +0.00%      |
| benchLoad10000Events ()                | 106.364ms (±0.00%) | 107.852ms (±0.00%) | -1.38%    | 35.799mb        | 35.799mb   | +0.00%      |
| benchSave1Event ()                     | 1.888ms (±0.00%)   | 1.884ms (±0.00%)   | +0.18%    | 35.799mb        | 35.799mb   | +0.00%      |
| benchSave10000Events ()                | 323.101ms (±0.00%) | 337.012ms (±0.00%) | -4.13%    | 35.801mb        | 35.801mb   | +0.00%      |
| benchSave10000Aggregates ()            | 12.396s (±0.00%)   | 12.351s (±0.00%)   | +0.36%    | 35.799mb        | 35.799mb   | +0.00%      |
| benchSave10000AggregatesTransaction () | 9.493s (±0.00%)    | 9.515s (±0.00%)    | -0.24%    | 36.040mb        | 36.039mb   | +0.00%      |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

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

+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
|                           | time (kde mode)                               | memory                                     |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
| subject                   | Tag: <current>  | Tag: base       | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
| benchHandle10000Events () | 3.292s (±0.00%) | 3.283s (±0.00%) | +0.28%    | 48.287mb        | 48.287mb   | +0.00%      |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+

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

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 1.106ms (±0.00%)   | 1.167ms (±0.00%)   | -5.21%    | 35.136mb        | 35.136mb   | +0.00%      |
| benchLoad10000Events ()                | 68.033ms (±0.00%)  | 66.815ms (±0.00%)  | +1.82%    | 35.136mb        | 35.136mb   | +0.00%      |
| benchSave1Event ()                     | 1.354ms (±0.00%)   | 1.268ms (±0.00%)   | +6.82%    | 35.136mb        | 35.136mb   | +0.00%      |
| benchSave10000Events ()                | 298.341ms (±0.00%) | 294.186ms (±0.00%) | +1.41%    | 35.136mb        | 35.136mb   | +0.00%      |
| benchSave10000Aggregates ()            | 8.183s (±0.00%)    | 8.026s (±0.00%)    | +1.97%    | 35.136mb        | 35.136mb   | +0.00%      |
| benchSave10000AggregatesTransaction () | 5.233s (±0.00%)    | 5.207s (±0.00%)    | +0.51%    | 35.136mb        | 35.136mb   | +0.00%      |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

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

+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                   | memory                                     |
+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>    | Tag: base         | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| benchLoad10000EventsMissingSnapshot () | 70.093ms (±0.00%) | 69.103ms (±0.00%) | +1.43%    | 35.206mb        | 35.206mb   | +0.00%      |
| benchLoad10000Events ()                | 1.112ms (±0.00%)  | 1.054ms (±0.00%)  | +5.53%    | 35.206mb        | 35.206mb   | +0.00%      |
+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+

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

+----------------------------------------+--------------------+-----------+-----------------+-------------+
|                                        | time (kde mode)                | memory                        |
+----------------------------------------+--------------------+-----------+-----------------+-------------+
| subject                                | Tag: <current>     | time-diff | Tag: <current>  | memory-diff |
+----------------------------------------+--------------------+-----------+-----------------+-------------+
| benchLoad1Event ()                     | 1.349ms (±0.00%)   | +0.00%    | 36.301mb        | +0.00%      |
| benchLoad10000Events ()                | 71.637ms (±0.00%)  | +0.00%    | 36.302mb        | +0.00%      |
| benchSave1Event ()                     | 1.373ms (±0.00%)   | +0.00%    | 36.301mb        | +0.00%      |
| benchSave10000Events ()                | 343.079ms (±0.00%) | +0.00%    | 36.356mb        | +0.00%      |
| benchSave10000Aggregates ()            | 8.166s (±0.00%)    | +0.00%    | 36.302mb        | +0.00%      |
| benchSave10000AggregatesTransaction () | 5.281s (±0.00%)    | +0.00%    | 36.302mb        | +0.00%      |
| benchAppend1Event ()                   | 1.609ms (±0.00%)   | +0.00%    | 36.302mb        | +0.00%      |
| benchAppend100Events ()                | 7.783ms (±0.00%)   | +0.00%    | 36.302mb        | +0.00%      |
+----------------------------------------+--------------------+-----------+-----------------+-------------+

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

+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
|                           | time (kde mode)                                   | memory                                     |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| subject                   | Tag: <current>    | Tag: base         | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| benchHandle10000Events () | 90.878ms (±0.00%) | 90.107ms (±0.00%) | +0.86%    | 35.715mb        | 35.715mb   | +0.00%      |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+

This comment gets update everytime a new commit comes in!

Comment thread src/DCB/EventRouter.php Outdated
Comment thread src/Metadata/PropertyType.php Outdated
Comment thread src/Stringable.php Outdated
Comment thread tests/DbalManager.php
@DavidBadura
DavidBadura force-pushed the DCB branch 2 times, most recently from c0c4860 to 2eda68f Compare August 22, 2025 13:52
@DavidBadura DavidBadura removed this from the 3.12.0 milestone Sep 3, 2025
@DavidBadura
DavidBadura changed the base branch from 3.12.x to 4.0.x September 4, 2025 16:23
@DavidBadura
DavidBadura force-pushed the DCB branch 3 times, most recently from 05db524 to 86fb514 Compare September 11, 2025 09:16
@DavidBadura DavidBadura added this to the 4.0.0 milestone Sep 12, 2025
@DavidBadura DavidBadura added the enhancement New feature or request label Sep 12, 2025
@DavidBadura
DavidBadura marked this pull request as ready for review September 16, 2025 08:16
Comment thread Makefile Outdated
Comment thread docs/pages/dynamic_consistency_boundary.md Outdated
Comment thread docs/pages/dynamic_consistency_boundary.md
Comment thread src/Store/Query.php Outdated
Comment thread tests/Benchmark/SimpleSetupTaggableStoreBench.php
@DavidBadura
DavidBadura merged commit 292b76a into 4.0.x Sep 22, 2025
38 of 40 checks passed
@DanielBadura
DanielBadura deleted the DCB branch September 22, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BC-Break enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants