PHPackages                             awd-studio/es-lib - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. awd-studio/es-lib

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

awd-studio/es-lib
=================

An advanced event-sourcing library for PHP 8.3+ designed to handle domain events effectively.

v0.0.9.7(10mo ago)047[1 issues](https://github.com/awd-studio/es-lib/issues)2MITPHPPHP &gt;=8.3CI passing

Since Jan 14Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/awd-studio/es-lib)[ Packagist](https://packagist.org/packages/awd-studio/es-lib)[ Docs](https://github.com/awd-studio/es-lib)[ RSS](/packages/awd-studio-es-lib/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (9)Versions (18)Used By (2)

AWD Event Sourcing library
==========================

[](#awd-event-sourcing-library)

This is a PHP library designed to simplify the implementation of Event Sourcing patterns in your applications. It provides a robust set of tools and abstractions to manage aggregates, events, event storage, and snapshots, enabling you to build scalable, maintainable, and auditable systems.

What is Event Sourcing?
-----------------------

[](#what-is-event-sourcing)

Event Sourcing is a design pattern where changes to an application's state are captured as a sequence of events. Instead of storing only the current state, the application maintains a history of all events that have occurred. This approach offers several advantages, including:

- **Auditability:** Every state change is recorded, providing a complete history.
- **Scalability:** Events can be processed asynchronously or in parallel.
- **Reconstructability:** Past states can be rebuilt by replaying events.

Features
--------

[](#features)

- **Aggregates:** Manage domain entities with built-in support for event sourcing.
- **Events:** Define and handle domain events easily.
- **Event Store:** Persist and retrieve events from a configurable storage backend.
- **Repositories:** Simplify loading and saving aggregates.
- **Snapshots:** Optimize performance by storing snapshots of aggregate states.

Installation
------------

[](#installation)

You can install ES Lib via Composer:

```
composer install awd-studio/es-lib
```

Usage
-----

[](#usage)

Se the [example](example) section.

### Integration

[](#integration)

To use the library in your projects, you need to implement such interfaces:

```
# Storage / DB layer

## Reading
\AwdEs\Event\Storage\Fetcher\EventFetcher::class
\AwdEs\Event\Storage\Fetcher\Handling\CriteriaHandlingCase::class

## Writing
\AwdEs\Event\Storage\Recorder\EventRecorder::class

# Metadata

## Applying
\AwdEs\Event\Applying\EventApplier::class

## Reading metadata
\AwdEs\Event\Handling\EventHandlerMethodResolver::class
\AwdEs\Meta\Event\EventMetadataResolver::class
```

License
-------

[](#license)

This library is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance53

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

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 ~10 days

Recently: every ~15 days

Total

17

Last Release

325d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15061745?v=4)[Anton Karpov](/maintainers/awd-studio)[@awd-studio](https://github.com/awd-studio)

---

Top Contributors

[![awd-studio](https://avatars.githubusercontent.com/u/15061745?v=4)](https://github.com/awd-studio "awd-studio (38 commits)")

---

Tags

phplibraryDomain Driven Designevent sourcinges

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/awd-studio-es-lib/health.svg)

```
[![Health](https://phpackages.com/badges/awd-studio-es-lib/health.svg)](https://phpackages.com/packages/awd-studio-es-lib)
```

PHPackages © 2026

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