datastax/php-driver
PHP extension (wrapper over DataStax C/C++ driver) providing a feature-rich, tunable client for Apache Cassandra 2.1+ via CQL3 and the native binary protocol. Prebuilt binaries available. Driver is in maintenance mode; use DSE PHP driver for DSE.
Pros:
executeAsync() for background jobs).duration, date, time, tinyint) natively, critical for data integrity in hybrid Laravel/Cassandra apps.Session::schema()), useful for Laravel migrations or admin panels.Cons:
FutureSession, Timestamp::toDateTime) may persist in production workloads.pecl install cassandra, complicating CI/CD pipelines (e.g., Docker, Heroku).Cassandra\SimpleStatement vs. DB::table()).database.php config lacks native support for Cassandra’s connection policies (e.g., whitelist/blacklist hosts).executeAsync() can integrate with Laravel Queues, but error handling (e.g., Future::get() timeouts) needs custom middleware.PHP-143, PHP-144) could resurface under high load.Future::get() timeouts and memory usage in production.Illuminate\Database connections with a custom CassandraConnection (extend Connection class).CassandraQueryBuilder to translate Laravel’s fluent syntax to CQL (e.g., DB::table('users')->where('active', true) → SELECT * FROM users WHERE active = true).CassandraModel trait to override Eloquent’s query logic (e.g., new Cassandra\SimpleStatement($query)).CassandraMigrator to generate CQL from Laravel migration files.executeAsync() with Laravel’s queue system for background Cassandra operations.| Laravel Feature | Integration Feasibility | Notes |
|---|---|---|
| Eloquent ORM | Medium | Requires custom CassandraModel trait. |
| Query Builder | High | Direct CQL mapping. |
| Migrations | Low | No native support; manual CQL required. |
| Scout (Search) | Low | Use Elasticsearch instead. |
| Queues | High | executeAsync() + Future::get(). |
| Redis Cache | N/A | Cassandra is not a drop-in replacement. |
| Events | Medium | Custom listeners for Cassandra events. |
Phase 1: Proof of Concept (2–4 weeks)
Session::schema()).Phase 2: Core Integration (4–8 weeks)
CassandraServiceProvider to register:
config/database.php).Phase 3: Production Readiness (2–4 weeks)
Cluster::withConnectionPool()).Future::get() timeouts, query latency).pecl install cassandra; document this in README.md and CI pipelines.redis, pgsql) if compiled with incompatible PHP versions.DB::raw(), DB::select(), or DB::transaction().cassandra connection to config/database.php.CassandraQueryBuilder and CassandraModel.Future status).PHP-189, PHP-143) are available via releases.How can I help you explore Laravel packages today?