- What is kefyusuf/laravel-bloom-gate and what does it do?
- kefyusuf/laravel-bloom-gate is a Laravel package that adds Bloom filter-backed gates to the framework's Gate authorization system. It is designed as a probabilistic query-avoidance layer that can reduce absent-value SQL lookups by checking a Bloom filter before hitting SQL-backed data. The package targets workloads with a high ratio of negative lookups and is workload-dependent rather than a general latency improvement. The current release is 0.1.0-rc.2, an evaluation release candidate.
- How do I install laravel-bloom-gate via Composer?
- Install the exact release candidate with Composer by requiring kefyusuf/laravel-bloom-gate:0.1.0-rc.2, then publish the package config using the documented artisan vendor:publish command. The README installation path requires PHP 8.3+ and Laravel 12 or 13, plus a supported SQL consumer and optionally Redis for trusted negatives. Pin the version rather than using a floating constraint because this is an evaluation release candidate.
- Which PHP and Laravel versions are supported by laravel-bloom-gate?
- The documented runtime constraints are PHP 8.3+ and Laravel 12/13. The package also expects a supported SQL consumer such as MySQL, PostgreSQL, or SQLite, and Redis only under the documented durable standalone-primary profile for trusted negatives. Redis Cluster, MongoDB, and long-running retained history are not certified. Validate these constraints against your application before starting a pilot.
- How does laravel-bloom-gate integrate with Laravel's Gate system?
- It registers Bloom filter-backed gates that plug into Laravel's Gate authorization checks, so routes and actions can be guarded with a lightweight probabilistic layer. The gate can answer some checks from the Bloom filter before falling back to SQL when needed. Integration is feasible for teams on the supported PHP and Laravel versions using the documented install-and-publish path. Start with a non-production pilot and measure query behavior before broad rollout.
- Does laravel-bloom-gate actually reduce database queries in production?
- It can reduce absent-value SQL lookups in workloads with a high negative-query ratio; in the local 1,000-query absent-value benchmark, SQL queries fell from 1,000 to 8. However, all-present workloads avoided no SQL calls, and the Redis gate was slower than indexed local MySQL, PostgreSQL, and in-memory SQLite baselines in that test. The package is not a general-purpose performance enhancement, so measure your own datastore behavior and negative-query ratio first.
- What Redis and SQL backends does laravel-bloom-gate support?
- According to the candidate tests, trusted negatives support a production-only Redis profile plus MySQL, PostgreSQL, or SQLite consumers. Redis must be a documented durable standalone primary; Redis Cluster is explicitly out of scope and not certified. MongoDB integration is also unverified. SQL comparison and collation must agree with the filter's normalization semantics.
- Is laravel-bloom-gate production-ready or stable?
- No. Version 0.1.0-rc.2 is an evaluation release candidate, not a stable v1 release and not a production deployment certification. The TPM assessment flags material technical risk around Redis topology, coordinated mutable-filter writes, recovery evidence, and unobserved production deployments. Treat it as a targeted optimization to pilot and validate, not a drop-in production authorization layer.
- How do I test Bloom Gate authorization checks in Laravel?
- Test the gates in an environment that mirrors your production datastore and Redis topology, including trusted negatives, authoritative fallback, known SQL commit/rollback outcomes, and rebuild behavior. Use the README's executable immutable filter example and verify that your test SQL comparison and collation match the filter's normalization semantics. Emit bounded query and retained-lease measurements during the pilot. Do not rely only on unit tests for production readiness.
- What are the risks of coordinated mutable Bloom filters in laravel-bloom-gate?
- Coordinated mutable filters require every membership-entry writer to participate in the prepared-write protocol; if any writer bypasses it, filter state can become inconsistent. Writer drain now rejects inconsistent surviving lease/count evidence in Memory and Redis without repairing it, so operational failures may surface instead of self-healing. The package distinguishes legacy pre-add from coordinated prepared writes, which helps reduce integration ambiguity. Review every code path that mutates Bloom filter membership before adopting mutable filters.
- What alternatives exist to laravel-bloom-gate for faster Laravel authorization checks?
- Alternatives depend on the bottleneck: cache-backed gates, Redis or Memcached lookups, indexed SQL queries, and Laravel's built-in Gate with optimized policies may be simpler for general authorization. Bloom filters are most relevant when you have many absent-value lookups and can tolerate probabilistic false positives. If you need stable, certified production behavior, wait for a v1 release or build a measured internal implementation. Compare against your own baseline rather than assuming Bloom filters are faster.