Weave Code
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

Php Postgres Document Store Laravel Package

event-engine/php-postgres-document-store

PostgreSQL-backed document store for Event Engine (PHP). Store, update, and query JSON documents efficiently using Postgres features like JSONB and indexes. Designed for read models/projections with a simple API and solid performance.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Event Sourcing & CQRS Architecture: Enables seamless integration of PostgreSQL as a document store for event-sourced applications, reducing complexity in managing event streams and state projections.
  • Hybrid Data Model: Supports both relational and document-like storage, allowing teams to leverage PostgreSQL’s robustness while maintaining flexibility for unstructured or semi-structured data (e.g., JSON payloads, nested objects).
  • Roadmap Acceleration: Faster iteration on event-driven features (e.g., real-time analytics, audit logs, or complex event queries) without reinventing document storage from scratch.
  • Build vs. Buy: Avoids custom development of a document store layer, reducing technical debt and maintenance overhead while adhering to open-source principles.
  • Use Cases:
    • Event Store + State Projections: Store events in PostgreSQL while maintaining optimized read models (e.g., Materialized Views or JSONB documents).
    • Multi-Tenant SaaS: Isolate tenant data in document format while sharing relational infrastructure.
    • Legacy Modernization: Gradually migrate monolithic apps to event-driven architectures by layering this store over existing PostgreSQL databases.
    • Real-Time Systems: Combine with PostgreSQL’s LISTEN/NOTIFY for event-driven triggers or WebSocket push notifications.

When to Consider This Package

  • Adopt If:

    • Your stack already uses PostgreSQL (or you’re committed to it) and you need a lightweight, schema-flexible document store.
    • You’re building or migrating to an event-sourced or CQRS system and want to avoid separate NoSQL databases (e.g., MongoDB).
    • Your team prioritizes developer velocity over fine-tuned performance tuning (e.g., for high-throughput write-heavy workloads).
    • You need ACID compliance for document operations (e.g., transactions spanning events and documents).
    • Your use case involves complex queries across both relational and document data (e.g., filtering JSONB fields with SQL).
  • Look Elsewhere If:

    • You require horizontal scalability for document reads/writes (PostgreSQL is vertically scaled by default).
    • Your documents are extremely large (e.g., >10MB) or need fine-grained sharding (PostgreSQL’s JSONB has limits).
    • You need multi-region replication or global low-latency access (consider a dedicated NoSQL solution like DynamoDB or Cosmos DB).
    • Your team lacks PostgreSQL expertise or prefers a managed service (e.g., Firebase, MongoDB Atlas).
    • You’re constrained by cost (PostgreSQL licensing or cloud pricing may exceed NoSQL alternatives for your scale).

How to Pitch It (Stakeholders)

For Executives: "This package lets us use PostgreSQL—our existing, battle-tested database—as both an event store and a flexible document store, cutting infrastructure costs and reducing vendor lock-in. By leveraging JSONB and PostgreSQL’s strengths, we can accelerate event-driven features (e.g., real-time dashboards, audit trails) without adding complexity or new databases. It’s a low-risk way to modernize our architecture while keeping operational overhead low."

For Engineering: *"This is a lightweight Laravel/PHP wrapper for PostgreSQL’s JSONB capabilities, tailored for event-sourced apps. It gives us:

  • No schema migrations: Store events or documents as JSONB without rigid tables.
  • SQL superpowers: Query documents with PostgreSQL’s full toolkit (e.g., jsonb_path_query, GIN indexes).
  • Laravel integration: Works seamlessly with Eloquent, Events, and Queues.
  • Future-proof: Avoids vendor lock-in while letting us scale reads with Materialized Views or read replicas. Tradeoff: Not ideal for petabyte-scale document storage, but perfect for most event-driven apps. Let’s prototype it for [specific use case] and compare it to [alternative]."*

For Architects: *"This package abstracts the complexity of managing event streams and document stores in PostgreSQL, offering:

  • Atomicity: Transactions span events and documents (e.g., append event + update projection).
  • Performance: Leverage PostgreSQL’s indexing and query optimization for JSONB.
  • Extensibility: Add custom indexes, triggers, or functions for domain-specific needs. Considerations:
  • Benchmark against raw PostgreSQL JSONB for your workload.
  • Plan for backup/recovery strategies if documents grow large.
  • Pair with a queue (e.g., Laravel Queues) for high-throughput event processing."*
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky