Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Pdo Event Sourcing Laravel Package

ecotone/pdo-event-sourcing

Full event sourcing for Ecotone, backed by your relational database via PDO: event-sourced aggregates and sagas, catch-up and streaming projections, event upcasting and replay. PostgreSQL and MySQL supported, with in-memory testing via EcotoneLite and no external infrastructure.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Ecotone is an architecture layer rather than a framework — commands, handlers, and aggregates are declared via PHP 8 attributes on ordinary classes, and the persistence strategy is a pluggable adapter. pdo-event-sourcing is precisely that adapter: it stores the event stream in the relational database you already operate. For a Laravel shop already standardized on MySQL/PostgreSQL, this removes the single largest adoption barrier to event sourcing — introducing and operating a second stateful system (EventStoreDB, Kafka-as-system-of-record).
  • The package is a read-only split repository of the ecotone-dev monorepo. The 8 stars and 0 dependents measure the split artifact, not the project. This is the most important correction to the raw score: adoption must be assessed against upstream ecotone/ecotone (Packagist download volume, GitHub Actions split-testing badge), not this mirror. Any due diligence that stops at this repo's metrics will produce a false negative.
  • The feature surface is broader than a persistence adapter: event-sourced aggregates, event-sourced sagas (durable workflows), projections, upcasting, and streaming projections to Kafka/RabbitMQ. That means the package sits on the critical path for workflow durability and read-model freshness, not just write-side storage. It is infrastructure, and should be scoped and governed as such.
  • Laravel fit is indirect. Ecotone brings its own bootstrapping and container integration; the store talks PDO directly and therefore bypasses Eloquent, the DB facade, and Laravel's connection/transaction management. That is a deliberate design choice (portability, no ORM coupling) but it creates a seam your team must own: two connection paths, two transaction semantics, and a test harness that behaves differently from production if you use the in-memory store.

Integration feasibility

  • Composer-installable and version-locked to the Ecotone core; the practical gate is version alignment between core, this store, and whichever Laravel integration package you adopt. Confirm the supported matrix explicitly rather than inferring it.
  • Requires a real PostgreSQL or MySQL instance with DDL rights on first boot. Assume no SQLite support outside tests — verify before anyone prototypes on the default Laravel SQLite setup and reports a false blocker.
  • Feasible for a single bounded context in a sprint or two of engineering; feasible for production in a quarter once schema ownership, projection operations, and replay runbooks are in place. The package is not the hard part — the domain modeling discipline is.

Technical risk

  • License: NOASSERTION is a release blocker until cleared. The upstream badge points to MIT, so this is almost certainly a metadata artifact of the split process, but legal must confirm per-artifact rather than per-upstream. Treat as pre-work, not as a reason to reject.
  • Bus factor and support surface. Small maintainer base, no visible commercial SLA, and zero public dependents means no reference implementations to copy, no community troubleshooting corpus, and a meaningful chance your team is the first to hit a given failure mode. Budget for upstream engagement (the monorepo is the contribution path — this repo is read-only, so you cannot vendor-patch casually; you fork or you upstream).
  • Maturity signal is "readme." Documentation depth beyond the README is unproven from this artifact alone. Assume the real docs live at ecotone.tech and audit them before committing.
  • Concurrency correctness is on you. Optimistic concurrency on aggregate version, transaction boundary placement, and retry-on-conflict semantics are the failure modes that produce silent data corruption in event stores. Validate with a deliberate contention test, not a happy-path demo.
  • Upcasting is a permanent obligation. Once events are in the table, every schema change to a payload requires an upcaster. This is a design-time commitment that outlives any individual feature team.
  • Streaming projections add distributed-systems risk (Kafka/RabbitMQ) to a package whose default proposition is "no new infrastructure." Adopt streaming only when projection lag on the database becomes the actual constraint.

Key questions

  1. What is the confirmed license of this artifact, and does legal accept it?
  2. Which upstream ecotone/ecotone version and Laravel integration package are we pinning, and what is their support matrix for our PHP and database versions?
  3. Who owns the event store schema and its migrations — our application or the package?
  4. What is the aggregate-version conflict strategy, and how do we test it under contention?
  5. What is the upstream release cadence and the maintainer count, and what is our fork-and-maintain contingency if it stalls?
  6. Which bounded context is the beachhead, and is it one where replay and audit are genuinely valuable — or are we paying event-sourcing complexity for CRUD?

Integration Approach

Stack fit

  • Strong fit if the stack is Laravel + PHP 8.1+ + PostgreSQL or MySQL, and the team already accepts CQRS/DDD vocabulary. The PDO store means no new operational dependency, no new backup/restore procedure, no new on-call surface — the events live in the database your DBAs already run.
  • Weak fit if the team has no event-sourcing experience, if the domain is predominantly CRUD, or if the org has standardized on a managed event platform. In those cases the package is not the constraint; the paradigm is.
  • Note the two-connection seam: the PDO store and Eloquent will not share transaction scope by default. Any workflow that writes an aggregate and a read model inside one request must be designed explicitly — either through the outbox/projection mechanism or by accepting eventual consistency. Decide this up front; it is the most common source of "it worked in dev" incidents.

Migration path

  • Greenfield bounded context first. Do not retrofit an existing Eloquent aggregate into an event-sourced one as the opening move — that combines paradigm migration with data migration and is where these initiatives die.
  • Parallel-run pattern: new context writes to the event store; existing contexts continue on Eloquent; integration via published events. This lets you prove the write side and the projection pipeline without a big-bang cutover.
  • If you must migrate an existing entity, use a one-way backfill that replays historical state into synthetic events, then freeze the legacy table read-only. Validate by diffing projected state against the legacy table for a full business cycle before decommissioning.

Compatibility

  • Pin exact versions of the store and core together; do not let Composer float either. Split-repo packages have an independent tag cadence from the monorepo, and drift here is a subtle, hard-to-diagnose failure.
  • Verify PostgreSQL vs MySQL semantics explicitly — locking behavior, JSON column handling, and index strategy differ meaningfully for an append-heavy event table. Pick one and standardize; don't support both across environments.
  • Test harness must mirror production. In-memory store for unit tests is fine; at least one integration suite must run against the real database engine and version, including the contention and replay cases.

Sequencing

  1. License clearance and upstream health audit (stars/downloads on ecotone/ecotone, release cadence, open-issue responsiveness) — no engineering spend before this gate.
  2. Spike: one aggregate, one command, one projection, against the target database. Two weeks, timeboxed, with a written go/no-go.
  3. Schema and migration ownership decision; establish the event table, snapshot strategy, and projection checkpoint tables.
  4. Contention and replay validation — conflict retries, projection rebuild from zero, upcaster introduction with a synthetic payload change.
  5. Production hardening: observability on projection lag, conflict rate, and stream length; runbooks for rebuild and poison-event handling.
  6. Only then: sagas/durable workflows, then streaming projections if and when database-side projection load actually justifies the additional infrastructure.

Operational Impact

Maintenance

  • Maintenance burden splits cleanly: upstream (package and core versions) and internal (upcasters, projections, schema). The internal half is the larger and less escapable — every payload schema change is a permanent compatibility obligation, and unlike ordinary code you cannot simply migrate the data away.
  • Read-only split repo means you consume releases, you don't patch them in place. Budget a small, explicit fork budget if the upstream stalls, and identify the engineer who would own a fork before you need one.
  • Schema migrations from the package must be identifiable and separable from application migrations; mixing them makes rollback and environment rebuilds ambiguous.

Support

  • Expect community-only support with a slow tail. The zero-dependents signal means Stack Overflow and blog coverage will be thin for this specific adapter; broader Ecotone material is more likely to help.
  • Mitigation is internal: designate two engineers as the event-sourcing owners (not one), maintain an internal "how this actually works" document, and subscribe to upstream releases. The support risk is a staffing problem more than a vendor problem.

Scaling

  • Read scaling is comfortable: projections are ordinary tables, and you can serve read models from replicas without touching the event store. Streaming projections to Kafka/RabbitMQ are the escape hatch when database-side projection consumption becomes the bottleneck.
  • Write scaling is the eventual constraint. A single append-only event table grows without bound; plan for partitioning (time or stream-id hash), snapshotting long-lived aggregates, and archival of cold streams. This is not day-one work, but it must be a known roadmap item, not a surprise.
  • Connection behavior is the practical near-term limit: PDO is per-process, so connection counts scale with PHP-FPM workers. Size the pool against the event store's needs separately from Eloquent's.

Failure modes

  • Concurrency conflicts — version collisions on hot aggregates. Must produce a bounded retry, not a 500. Instrument conflict rate; a rising rate means aggregate boundaries are wrong.
  • Partial writes / dual-write drift — aggregate persisted but projection not updated, or vice versa. The outbox pattern is the expected answer; verify the package's story here rather than assuming it.
  • Projection lag and stall — projections silently fall behind, read models serve stale data. Alert on lag as a first-class SLI; a stalled projection is a user-visible outage in a CQRS system.
  • Poison messages — a single event that fails a projector halts the pipeline. Needs an explicit dead-letter/quarantine path.
  • Upcaster defects — a bad upcaster corrupts replay silently and retroactively. Upcasters need their own test suite and replay-validation in staging.
  • Replay blast radius — a full rebuild is a heavy, hours-long operation against a live table. Rehearse it before you need it, and know the read-model degradation story during rebuild.
  • Unbounded stream growth — an aggregate with thousands of events degrades load time. Snapshotting thresholds must be configured, not discovered.

Ramp-up

  • The package itself is a day of learning. Event sourcing, CQRS, aggregate boundaries, and eventual consistency are a quarter of learning — that, not the integration, is the real cost and the real schedule risk.
  • Recommend a single experienced architect paired with two product engineers, a written internal guide, and a deliberately small first context. Avoid staffing this with a team that is simultaneously learning Laravel and DDD.
  • The honest TPM read: the technology risk is manageable and the architectural upside is real, but the maturity signals here (8 stars, 0 dependents, NOASSERTION, readme-only) mean you are an early adopter, and early adopter cost is paid in engineering time, not license fees. Approve a timeboxed spike with a hard go/no-go; do not approve a platform-level commitment on the strength of this artifact alone.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle