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

Php Rql Laravel Package

danielmewes/php-rql

php-rql is a PHP client driver for RethinkDB. It lets PHP applications connect to a RethinkDB server, build ReQL queries with a fluent API, execute them synchronously or asynchronously, and process results, making it easy to integrate RethinkDB’s realtime NoSQL database into PHP projects.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • This is a raw database driver, not a Laravel package. There is no service provider, no publishable config, no facade, no Eloquent adapter, and no cache/queue/session driver. Value only exists if RethinkDB is already, or is deliberately, part of the platform.
  • Fit against Laravel's data layer is poor by default. The framework's DB abstraction (query builder, schema grammar, migrations, Eloquent) is SQL-centric; this library speaks ReQL over the ql2 protobuf wire protocol and will not sit underneath DB::connection() without an adapter we write ourselves.
  • Legitimate fit exists only for RethinkDB's differentiators: changefeeds (server-push realtime), JSON document storage, automatic sharding/replication, and simple horizontal scale-out.

Integration feasibility

  • Feasible, and the packaging is unusually clean for its era: pure PHP with a bundled protobuf implementation (no ext-protobuf requirement), promise-based async API, cursor iteration, Composer install.
  • The cost is entirely in the glue: config, connection lifecycle, health checks, exception-to-log mapping, retry semantics, and test harness. The wrapper is days; production hardening is weeks.
  • App code should never touch the driver directly. Build a repository boundary first — retrofitting one later is where this class of project typically fails.

Technical risk

  • The dominant risk is upstream database supply chain, not driver code quality. RethinkDB's commercial sponsor ceased operations in 2016; the project survives as a community codebase with intermittent maintenance. That is a strategic risk that must be accepted by a named sponsor, not absorbed silently by an engineering team.
  • Driver risk: a PHP 5.3-era codebase. Verify on our supported PHP range (8.1/8.2/8.3) — dynamic properties, curly-brace string offsets, reserved words, and typed signatures are all plausible breakages. Expect to fork and patch.
  • Low adoption (336 stars) means a small bug-finding surface and a thin answer base; we will be debugging against reference implementations in Python/JS rather than PHP precedent.
  • The hand-rolled protocol layer improves installability but concentrates correctness and performance risk in edge cases: very large cursors, nested/array types, and RethinkDB pseudo-types (time, binary, geometry).
  • Security: there is no PDO-style parameterization. ReQL is composited programmatically, so user input must be passed as r->expr() arguments and never string-concatenated. r.js() in particular is server-side evaluation and should be banned by policy.

Key questions

  1. Is RethinkDB already an approved platform standard? If not, who is the executive sponsor for the exception?
  2. What is our supported PHP range at go-live, and does the driver pass an integration suite on it?
  3. Do we actually need changefeeds and document semantics, or can Postgres LISTEN/NOTIFY, Redis Streams, or Mongo change streams cover the requirement?
  4. Who owns the fork when upstream goes quiet, and what is the documented exit plan (export tooling, dual-write)?
  5. Will this run under PHP-FPM only, or also Laravel Octane/Swoole? Long-lived workers invalidate the driver's connection and promise assumptions.
  6. What is the support story for the server in our environment — self-managed containers, or a managed offering we can actually procure?

Integration Approach

Stack fit

  • Verdict: no native fit; adopt as an internal infrastructure dependency with a deliberate adapter layer, not as an app-level library.
  • Keep the relational database as system of record for transactional data. Use RethinkDB in a bounded role: realtime feeds, activity streams, notification fan-out, or document-shaped payloads.
  • Avoid Octane/Swoole in v1. If it becomes mandatory, design connection-per-worker pooling and per-request state reset before writing any feature code.

Migration path

  1. Spike (1–2 weeks): stand up a RethinkDB node from the community build/container, port the driver to our PHP version, and prove connect → query → cursor → changefeed → reconnect on a realistic schema.
  2. Fork and pin: vendor the package under our namespace, add CI (unit plus integration against a container), publish an internal version, and pin the exact tag. Do not float on dev-master.
  3. Laravel glue: service provider, config file, facade, health-check route, exception mapping into the framework handler, and an optional repository/base-model abstraction.
  4. Shadow read: mirror one bounded dataset, diff results against the source of truth, and measure latency and error rates.
  5. Production slice: ship one feature behind a flag with a defined fallback path.
  6. Expand only after 4–6 weeks of clean operation and a post-incident review of any retries or reconnects observed.

Compatibility

  • PHP/Composer: validate version constraints and patch for current PHP before committing; treat the fork as the supported artifact.
  • Laravel coupling: effectively none, because the glue is ours. This is a genuine advantage — it survives framework upgrades as long as the PHP API surface stays stable.
  • Server coupling: pin both driver and server build together and record the pairing in our dependency inventory.

Sequencing

  • Database platform approval must precede driver hardening. Hardening first creates sunk-cost pressure to ship a decision that hasn't actually been made.
  • Build the abstraction boundary before the first feature, not after the pilot succeeds.

Operational Impact

Maintenance

  • Assume we own the driver outright. Upstream is effectively frozen; assign one named maintainer, a quarterly review, and a watch on PHP releases and CVEs.
  • Budget roughly 1–2 engineering days per quarter for dependency hygiene, more in any quarter where we move PHP versions.
  • Two moving parts (server plus client) double the maintenance surface versus a single relational database.

Support

  • No vendor SLA. Community channels only, with limited PHP-specific knowledge. Escalation is internal engineering plus reading the ReQL spec and cross-referencing the Python/JS drivers.
  • Onboarding documentation must be written in-house. The ecosystem will not fill these gaps.

Scaling

  • Server side is a genuine strength: sharding and replication are native, and changefeeds scale with the cluster.
  • Client side is the concern. Under PHP-FPM, connections are per-request and fine; under Octane, connection lifecycle and promise handling become a real design problem. Watch handshake churn.
  • Iterate cursors rather than materializing result sets; PHP memory is the usual bottleneck with document stores.
  • Changefeeds are long-lived connections and belong in a supervised worker or queue process, never in a web request.

Failure modes to design for

  • Node loss or failover mid-query: retry with idempotency keys on writes.
  • Changefeed disconnect: reconnect with resume logic; delivery is not exactly-once, so deduplicate downstream.
  • Table-not-ready and shard-rebalancing errors on cold start: exponential backoff.
  • Durability selection (soft vs hard writes): decide explicitly per use case; soft writes can lose recent data on failover.
  • Partial results on timeout: treat cursors as streams and make consumers idempotent.
  • Silent breakage after a PHP upgrade: integration tests against a real container in CI are non-negotiable.
  • Data gravity and exit: with no Eloquent-grade tooling, export and import must be scripted. Write and test the export path before go-live, not after.

Ramp-up

  • The learning curve is real: ReQL, document data modeling, changefeed semantics, and a non-idiomatic driver API built around promises and cursors.
  • Realistic estimate: 1–2 weeks for a strong Laravel developer to be productive on a bounded feature; 4–6 weeks to be production-trustworthy; longer for on-call and operations readiness.
  • Mitigations: a single spike owner, an internal reference application, and a review checklist that forbids direct driver usage outside the repository layer.

Recommendation: approve only as a scoped, sponsor-backed exception for a use case that genuinely requires changefeeds or document-scale semantics. Frame it internally as "build and own," not "adopt." If the requirement is marginal, a Postgres plus Redis (or Mongo) combination captures most of the value at a fraction of the operational risk — which is broadly what the low opportunity score reflects: real technical capability, weak ecosystem tailwind, and a high ownership burden.

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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager