PHPackages                             morebec/orkestra-postgresql-eventstore - 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. morebec/orkestra-postgresql-eventstore

ActiveLibrary

morebec/orkestra-postgresql-eventstore
======================================

PostgreSQL Event Store for Orkestra

v2.5.6(3y ago)14191Apache-2.0PHPPHP &gt;=7.4

Since Apr 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Morebec/orkestra-postgresql-eventstore)[ Packagist](https://packagist.org/packages/morebec/orkestra-postgresql-eventstore)[ RSS](/packages/morebec-orkestra-postgresql-eventstore/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelogDependencies (7)Versions (23)Used By (1)

PostgreSqlEventStore
====================

[](#postgresqleventstore)

This component provides an implementation of a the an Event Store (from the EventSourcing Component) using PostgreSQL.

Under the hood, it uses DBAL for communication with PostgreSQL.

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

[](#installation)

```
composer require morebec/orkestra-orkestra-postgresql-eventstore
```

Usage
-----

[](#usage)

```
use Morebec\Orkestra\PostgreSqlEventStore\PostgreSqlEventStore;
use Morebec\Orkestra\PostgreSqlEventStore\PostgreSqlEventStoreConfiguration;

$connection = DriverManager::getConnection([
    'url' => '...'
], new Configuration());

$config = new PostgreSqlEventStoreConfiguration();
$store = new PostgreSqlEventStore($connection, $config);
```

### Event Store Subscriptions

[](#event-store-subscriptions)

The pu/sub mechanism of the event store is implemented using PostgreSQL's `LISTEN/NOTIFY` feature. Unfortunately given the nature of PHP being a synchronous RunTime, the only way to have Pub/Sub capabilities is to run a `LISTEN` loop:

```
// This method will start a loop and listen for communications from PostgreSQL's LISTEN/NOTIFY mechanis.
$store->notifySubscribers();
```

This is can be used with `Event Processors`.

### PostgreSqlEventStorePositionStorage

[](#postgresqleventstorepositionstorage)

An implementation of `EventStorePositionStorageInterface` is also shipped with the component as the `PostgreSqlEventStorePositionStorage`, which also relies on DBAL for communication with PostgreSQL:

```
use Morebec\Orkestra\PostgreSqlEventStore\PostgreSqlEventStorePositionStorage;
use Morebec\Orkestra\PostgreSqlEventStore\PostgreSqlEventStorePositionStorageConfiguration;

$connection = DriverManager::getConnection([
    'url' => '...'
], new Configuration());

$config = new PostgreSqlEventStorePositionStorageConfiguration();
$store = new PostgreSqlEventStorePositionStorage($connection, $config);
```

### PostgreSqlEventProcessor

[](#postgresqleventprocessor)

A ready-made implementation of an Event Processor with support for the `PostgreSqlEventStore`is also provided with this component:

```
use Morebec\Orkestra\PostgreSqlEventStore\PostgreSqlEventProcessor;
$processor = new PostgreSqlEventProcessor($publisher, $eventStore, $postgreSqlEventStore, $positionStorage);

// This call will loop and notify all event store subscribers as well as the event processor itself
// for event tracking.
$processor->start();
```

> Given that the `EventStoreInterface` can be decorated, the processor cannot directly use the `PostgreSqlEventStore` through the `EventStoreInterface`. Also, since it requires using specific methods from the implementation `PostgreSqlEventStore` to access some PostgreSQL specific features, the actual instance of the `PostgreSqlEventStore` must be injected additionally. This is why both are injected in the constructor.

Testing
-------

[](#testing)

To run the tests execute the following command:

```
vendor/bin/phpunit tests/
```

It is required to have an instance of postgresql running with a password-less role `postgres` and a database named `postgres`. To easily get this setup and running a `docker-compose` configuration file is available at the root of this project.

To run it simply execute the following command:

```
docker-compose up -d
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Recently: every ~58 days

Total

22

Last Release

1135d ago

PHP version history (2 changes)2.0PHP &gt;=7.3

v2.3.3PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/10d7f5561446f2d4df4413803946e9f77175155d241f78bd65c0dd94e6caffc5?d=identicon)[jwillp](/maintainers/jwillp)

---

Top Contributors

[![jwillp](https://avatars.githubusercontent.com/u/5913483?v=4)](https://github.com/jwillp "jwillp (1 commits)")

---

Tags

event-sourcingevent-storeorkestraphppostgresql

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/morebec-orkestra-postgresql-eventstore/health.svg)

```
[![Health](https://phpackages.com/badges/morebec-orkestra-postgresql-eventstore/health.svg)](https://phpackages.com/packages/morebec-orkestra-postgresql-eventstore)
```

###  Alternatives

[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k4](/packages/elgg-elgg)[neos/flow

Flow Application Framework

862.0M449](/packages/neos-flow)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[rias/statamic-redirect

28298.4k](/packages/rias-statamic-redirect)

PHPackages © 2026

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