PHPackages                             blixit/event-sourcing - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. blixit/event-sourcing

ActiveLibrary

blixit/event-sourcing
=====================

0.0.9(7y ago)020MITPHP

Since Apr 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/blixit/event-sourcing)[ Packagist](https://packagist.org/packages/blixit/event-sourcing)[ RSS](/packages/blixit-event-sourcing/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (9)Dependencies (4)Versions (9)Used By (0)

Blixit Event Sourcing
=====================

[](#blixit-event-sourcing)

[![Build Status](https://camo.githubusercontent.com/ace9f03c503a10c81632bb893825e972dd56fdc455cc0260ebff30fe48322af4/68747470733a2f2f7472617669732d63692e636f6d2f626c697869742f6576656e742d736f757263696e672e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/blixit/event-sourcing)[![codecov](https://camo.githubusercontent.com/7c18d15923e6e2660998eafea620d60094396fceff7d59f7f62ae6b14d54eace/68747470733a2f2f636f6465636f762e696f2f67682f626c697869742f6576656e742d736f757263696e672f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/blixit/event-sourcing)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7918930f4af5a9f4c062b87ad7d87b5440bf6664d9bc6e854af7a2e1dfebdafa/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f626c697869742f6576656e742d736f757263696e672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/blixit/event-sourcing/?branch=master)[![Code Intelligence Status](https://camo.githubusercontent.com/23c025e7107f5479dd03962b54d0123b61423d061be4fc192792c2be5a1ad5bc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f626c697869742f6576656e742d736f757263696e672f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)

This is a standalone library to create PHP7.2+ applications following the event sourcing pattern.

### Installation

[](#installation)

```
composer require blixit/event-sourcing

```

### Documentation

[](#documentation)

- [Basic Usage](./wiki/basic-usage.md)
- [Event Store](./wiki/event-store.md)
- [Snapshot Store](./wiki/snapshot-store.md)
- [Dispatcher and Middlewares](./wiki/dispatcher-middlewares.md)

### Why this library ?

[](#why-this-library-)

**The Problem**

Some months ago, I heard about DDD and ES-CQRS then I was not able to stop reading articles about these subjects. Then I found Prooph.

After having been using Prooph, I came to the idea to write my own implementation. Here are some reasons for which I gave up Prooph:

1. the documentation is really not up-to-date
2. it forces the choice of database management system (MySQL). To use other database management systems you have to use some libraries they develop and that don't come with a super documentation. I mean adapters for NoSQL Database such as MongoDb.
3. as consequence, the coupling with the infrastructure is really high
4. events stream is not easy to understand. The flux between the moment your event is generated and its storage is not tracable
5. stream name system is not optimal and generated names are difficult to debug. As a result, hundreds of tables can be generated into the database, which doesn't make sense, especially for migrations handling.

I will stop here because it's not about charging against Prooph. I liked the framework and thanks to them I got my first example of PHP implementation.

**My solution**

2&amp;3 . To resolve the 1st problem, I used DDD and define infrastructures dependencies as interface. For instance, the event store doesn't know anything about the way data are really persisted. I define a `EventPersisterInterface` interface that enumerates the relevant methods to persist or get events. By doing so, the developer can just plug any database service behind the scene with only one constraint: respect the interface. The same way the `SnapshotPersisterInterface` interface tells which function are required to persist immutable snapshots.

4 . I added some hooks to give more flexibility to the developer to interact with the internal components of the library. For instance, I created 4 hooks to follow the writing and the reading of an event:

- beforeWrite: when the event is ready to be added to the stream
- afterWrite : after the storage, the event persister has just been called
- beforeRead : after the database read, but just before to put the event into the stream
- afterRead : once the stream is built

5 . I defined 3 naming strategies class that the developer can add to its store: `OneStreamPerAggregateStrategy`, `SingleAggregateStreamStrategy``UniqueStreamStrategy`. These strategies can be switched on production. The developer has just to move relevant events to the new stream. Notice that only the stream name will be affected.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

8

Last Release

2573d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7375fc876a93c1ded99b929bc5da544c431e5dcd0aee009639eeb501971d527b?d=identicon)[blixit](/maintainers/blixit)

---

Top Contributors

[![developer2reliefapps](https://avatars.githubusercontent.com/u/30403622?v=4)](https://github.com/developer2reliefapps "developer2reliefapps (42 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/blixit-event-sourcing/health.svg)

```
[![Health](https://phpackages.com/badges/blixit-event-sourcing/health.svg)](https://phpackages.com/packages/blixit-event-sourcing)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
