• Stars
    star
    110
  • Rank 316,770 (Top 7 %)
  • Language
    PHP
  • License
    BSD 3-Clause "New...
  • Created about 8 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PDO implementation of ProophEventStore http://getprooph.org

pdo-event-store

Build Status Coverage Status Gitter

PDO EventStore implementation for Prooph EventStore

Requirements

  • PHP >= 7.3
  • PDO_MySQL Extension or PDO_PGSQL Extension

For MariaDB you need server version >= 10.2.11.
Performance Impact: see [MariaDB Indexes and Efficiency](docs/variants.md#MariaDB Indexes and Efficiency)

For MySQL you need server version >= 5.7.9.

For Postgres you need server version >= 9.4.

Attention: Since v1.6.0 MariaDB Server has to be at least 10.2.11 due to a bugfix in MariaDB, see https://jira.mariadb.org/browse/MDEV-14402.

Setup

For MariaDB run the script in scripts/mariadb/01_event_streams_table.sql on your server.

For MySQL run the script in scripts/mysql/01_event_streams_table.sql on your server.

For Postgres run the script in scripts/postgres/01_event_streams_table.sql on your server.

This will setup the required event streams table.

If you want to use the projections, run additionally the scripts scripts/mariadb/02_projections_table.sql (for MariaDB), scripts/mysql/02_projections_table.sql (for MySQL) or scripts/postgres/02_projections_table.sql (for Postgres) on your server.

Upgrade from 1.6 to 1.7

Starting from v1.7 the pdo-event-store uses optimized table schemas. The upgrade can be done in background with a script optimizing that process. A downtime for the database should not be needed. In order to upgrade your existing database, you have to execute:

  • MariaDB
ALTER TABLE `event_streams` MODIFY `metadata` LONGTEXT NOT NULL;
ALTER TABLE `projections` MODIFY `position` LONGTEXT;
ALTER TABLE `projections` MODIFY `state` LONGTEXT;

Then for all event-streams (SELECT stream_name FROM event_streams)

ALTER TABLE <stream_name> MODIFY `payload` LONGTEXT NOT NULL;
ALTER TABLE <stream_name> MODIFY `metadata` LONGTEXT NOT NULL,
  • MySQL

nothing to upgrade

  • Postgres

For all event-streams (SELECT stream_name FROM event_streams)

ALTER TABLE <stream_name> MODIFY event_id UUID NOT NULL;

Additional note:

When using Postgres, the event_id has to be a valid uuid, so be careful when using a custom MetadataMatcher, as the event-store could throw an exception when passing a non-valid uuid (f.e. "foo") as uuid.

The migration is strongly recommended, but not required. It's fully backward-compatible. The change on Postgres is only a microoptimization, the change on MariaDB prevents errors, when the stored json gets too big.

Introduction

Prooph Event Store v7

Tests

If you want to run the unit tests locally you need a runnging MySql server listening on port 3306 and a running Postgres server listening on port 5432. Both should contain an empty database event_store_tests.

Run Tests With Composer

MariaDb

$ vendor/bin/phpunit -c phpunit.xml.mariadb

MySql

$ vendor/bin/phpunit -c phpunit.xml.mysql

Postgres

$ vendor/bin/phpunit -c phpunit.xml.postgres

Run Tests With Docker Compose

MariaDb

docker-compose -f docker-compose-tests.yml run composer run-script test-mariadb --timeout 0; \
docker-compose -f docker-compose-tests.yml stop

MySql

docker-compose -f docker-compose-tests.yml run composer run-script test-mysql --timeout 0; \
docker-compose -f docker-compose-tests.yml stop

Postgres

docker-compose -f docker-compose-tests.yml run composer run-script test-postgres --timeout 0; \
docker-compose -f docker-compose-tests.yml stop

Support

Contribute

Please feel free to fork and extend existing or add new plugins and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and may adapt the documentation.

License

Released under the New BSD License.

More Repositories

1

event-store

PHP 7.4 EventStore Implementation
PHP
547
star
2

service-bus

PHP Lightweight Message Bus supporting CQRS.
PHP
440
star
3

event-sourcing

Provides basic functionality for event sourced aggregates.
PHP
262
star
4

proophessor-do

prooph components in action
JavaScript
254
star
5

docker-files

Collection of prooph docker files
M4
249
star
6

proophessor-do-symfony

Symfony version of proophessor-do CQRS + Event Sourcing example app
JavaScript
170
star
7

event-store-client

PHP Event Store Client Implementation
PHP
113
star
8

event-store-symfony-bundle

Event Store Symfony Bundle
PHP
109
star
9

laravel-package

Laravel package for prooph components to get started out of the box with message bus, CQRS, event sourcing and snapshots
PHP
100
star
10

service-bus-symfony-bundle

Symfony Bundle - PHP Lightweight Message Bus supporting CQRS
PHP
89
star
11

common

Common classes used across prooph components
PHP
85
star
12

proophessor

Exploring prooph components
PHP
84
star
13

micro

Functional prooph for microservices
PHP
53
star
14

micro-do

Microservice version of the famous proophessor-do event sourcing app
PHP
42
star
15

event-store-bus-bridge

Marry CQRS with Event Sourcing
PHP
37
star
16

message-flow-analyzer

Static code analyzer for message flow in a prooph powered project
PHP
30
star
17

event-store-http-client

PHP 7.2 Event Store HTTP Client Implementation
PHP
25
star
18

pdo-snapshot-store

PDO Snapshot Store
PHP
25
star
19

php-cs-fixer-config

PHP CS Fixer config for prooph components
PHP
24
star
20

event-store-mgmt-ui

Event Store Management UI
JavaScript
23
star
21

snapshot-store

Snapshot Store
PHP
20
star
22

snapshotter

Take aggregate snapshots with ease
PHP
19
star
23

event-store-http-api

Prooph EventStore HTTP API
PHP
18
star
24

documentation

CSS
17
star
25

standard-projections

Standard projections to use with Prooph EventStore
PHP
15
star
26

laravel-example

PHP
15
star
27

psr7-middleware

Consume prooph messages with a PSR7 middleware
PHP
14
star
28

link

Automated Workflow Processing
JavaScript
13
star
29

event-store-doctrine-adapter

[Deprecated] Doctrine Adapter for ProophEventStore
PHP
13
star
30

humus-amqp-producer

HumusAmqp Producer for Prooph Service Bus
PHP
12
star
31

annotations

Prooph Annotations
PHP
12
star
32

psb-http-producer

Http Message Producer for Prooph Service Bus using httplug
PHP
11
star
33

no-mvc

[experimental] No View, No Controller, Just a Model and a Bus
PHP
11
star
34

micro-cli

Command line interface to create prooph microservices
PHP
11
star
35

http-middleware

PSR compatible middleware to integrate prooph with a middleware dispatcher
PHP
11
star
36

psb-enqueue-producer

Enqueue Producer for Prooph Service Bus http://getprooph.org
PHP
10
star
37

docs

prooph docs
9
star
38

fun-facts-service

Microservice to fetch and serve fun facts about prooph repositories
PHP
8
star
39

event-store-benchmarks

Benchmarks for prooph event store
PHP
8
star
40

redis-event-store

Redis Adapter for ProophEventStore
8
star
41

psb-bernard-producer

Bernard Message Producer for Prooph Service Bus
PHP
8
star
42

event-store-flywheel-adapter

Flywheel Adapter for ProophEventStore http://getprooph.org
PHP
7
star
43

service-bus-zfc-rbac-bridge

Marry Service Bus with ZfcRbac
PHP
7
star
44

arangodb-snapshot-store

ArangoDb Snapshot Store implementation
PHP
7
star
45

snapshot-doctrine-adapter

[Deprecated] Doctrine Adapter for the Snapshot Store
PHP
6
star
46

processing

Deprecated package. Will be removed in 03/2016! Use:
PHP
6
star
47

psb-zeromq-producer

ZeroMQ Message Producer for Prooph Service Bus.
PHP
6
star
48

event-store-http-middleware

PSR-15 Event Store HTTP API middleware
PHP
6
star
49

event-store-mongodb-adapter

[Deprecated] MongoDB Adapter for ProophEventStore
PHP
6
star
50

event-store-redis-adapter

[Deprecated] Redis Adapter for ProophEventStore http://getprooph.org
PHP
5
star
51

event-store-adapter-benchmarks

[deprecated] Prooph EventStore Adapter Benchmarks
PHP
5
star
52

ProophServiceBusModule

[deprecated] ZF 2 Module for ProophServiceBus. Use:
PHP
5
star
53

mongodb-snapshot-store

MongoDB Snapshot Store implementation
PHP
4
star
54

snapshot-mongodb-adapter

[Deprecated] MongoDB Adapter for the Snapshot Store
PHP
4
star
55

prooph-pack

A prooph "pack" recipe for Symfony flex
4
star
56

snapshot-redis-adapter

[Deprecated] Redis Adapter for the Snapshot Store http://getprooph.org
PHP
4
star
57

httplug-event-store

HTTP event-store implementation talking with http-api
PHP
4
star
58

snapshot-memcached-adapter

[Deprecated] Memcached Adapter for the Snapshot Store
PHP
3
star
59

psb-kafka-producer

3
star
60

docs-template

CSS
3
star
61

event-store-bus-bridge-symfony-bundle

[deprecated] Event Store Bus Bridge Symfony Bundle
PHP
3
star
62

psb-gearman-producer

[deprecated] Gearman Message Producer for Prooph Service Bus
3
star
63

ProophEventStoreModule

[deprecated] ZF 2 Module for ProophEventStore. Use:
PHP
2
star
64

link-message-queue

Message Queue Module for prooph LINK
PHP
2
star
65

link-process-manager

Process configurator for prooph LINK
PHP
2
star
66

memcached-snapshot-store

Memcached Snapshot Store implementation
PHP
2
star
67

link-sql-connector

SQL connector module for prooph LINK
PHP
1
star
68

various-benchmarks

various benchmarks for decision making
1
star
69

link-app-core

Application core for prooph LINK
PHP
1
star
70

psb-php-resque-producer

[deprecated] php-resque message producer for Prooph Service Bus
PHP
1
star
71

event-store-zf2-adapter

[Abandoned] ZF2 DB Adapter for ProophEventStore
PHP
1
star
72

link-dashboard

Dashboard module for prooph LINK
PHP
1
star