PHPackages                             s00d/rocksdb-client-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. s00d/rocksdb-client-php

ActiveLibrary[Database &amp; ORM](/categories/database)

s00d/rocksdb-client-php
=======================

A PHP client for interacting with RocksDB server

1.0.10(1y ago)137MITPHPPHP ^7.4 || ^8.0

Since Jun 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/s00d/rocksdb-client-php)[ Packagist](https://packagist.org/packages/s00d/rocksdb-client-php)[ RSS](/packages/s00d-rocksdb-client-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (12)Used By (0)

[![Packagist Version](https://camo.githubusercontent.com/471df21087e0345e7369fd73cb1eb08e4b47f09fc7973b0e152355bb7a943d30/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f733030642f726f636b7364622d636c69656e742d7068703f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/s00d/rocksdb-client-php)[![Packagist Downloads](https://camo.githubusercontent.com/757477a6a32fabc6c91dd9d2295bc528a077e99c1220b0a09f3a2f0f3d32e09c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f733030642f726f636b7364622d636c69656e742d7068703f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/s00d/rocksdb-client-php)[![Packagist License](https://camo.githubusercontent.com/580502658352200a2a0557920548b7b482072efb5d42e7ff79053150c10845a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f733030642f726f636b7364622d636c69656e742d7068703f7374796c653d666f722d7468652d6261646765)](https://github.com/s00d/rocksdb-client-php/blob/master/LICENSE)[![GitHub Repo stars](https://camo.githubusercontent.com/0b86a0ae24a9720f85e2c851ac17b96f73a942493fdb2228609144f8c17539d3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f733030642f726f636b7364622d636c69656e742d7068703f7374796c653d666f722d7468652d6261646765)](https://github.com/s00d/rocksdb-client-php)

RocksDB Client PHP
==================

[](#rocksdb-client-php)

A PHP client for interacting with RocksDB server.

Overview
--------

[](#overview)

This package is a part of the [RocksDBFusion](https://github.com/s00d/RocksDBFusion) project. Before integrating this client into your application, you need to run the RocksDB server provided by RocksDBFusion.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require s00d/rocksdb-client-php
```

Workflow
--------

[](#workflow)

Below is the diagram illustrating how the client interacts with the RocksDB server:

 ```
sequenceDiagram
    participant PhpClient
    participant TCP
    participant RocksDBServer
    participant RocksDBDatabase

    PhpClient->>TCP: Open socket (stream_socket_client)
    TCP->>RocksDBServer: Send request (e.g., GET, PUT, DELETE)
    RocksDBServer->>RocksDBDatabase: Perform operation
    RocksDBDatabase->>RocksDBServer: Return data/result
    RocksDBServer->>TCP: Send data/result
    TCP->>PhpClient: Receive data/result
```

      Loading Configuration
-------------

[](#configuration)

### Laravel Integration

[](#laravel-integration)

1. **Add the service provider**:

    In your `config/app.php` file, add the service provider to the `providers` array:

    ```
    'providers' => [
        // Other Service Providers

        s00d\RocksDB\RocksDBServiceProvider::class,
    ],
    ```

    And the alias to the `aliases` array:

    ```
    'aliases' => [
        // Other Facades

        'RocksDB' => s00d\RocksDB\Facades\RocksDB::class,
    ],
    ```
2. **Publish the configuration file**:

    ```
    php artisan vendor:publish --provider="s00d\RocksDB\RocksDBServiceProvider"
    ```

    This will create a `config/rocksdb.php` configuration file where you can set the connection details.
3. **Update your `.env` file**:

    Add your RocksDB connection details to the `.env` file:

    ```
    ROCKSDB_HOST=127.0.0.1
    ROCKSDB_PORT=12345
    ROCKSDB_TOKEN=null
    ```
4. **Usage**:

    Now you can use the RocksDB client in your Laravel application:

    ```
    use RocksDB;

    // Put a value
    RocksDB::put('key', 'value');

    // Get a value
    $value = RocksDB::get('key');

    // Delete a key
    RocksDB::delete('key');

    // Other available methods...
    ```

### Direct Usage (Without Laravel)

[](#direct-usage-without-laravel)

If you want to use the client without Laravel, you can directly instantiate the `RocksDBClient` class.

1. **Create an instance**:

    ```
    use s00d\RocksDB\RocksDBClient;

    $client = new RocksDBClient('127.0.0.1', 12345);

    // If you have a token
    // $client = new RocksDBClient('127.0.0.1', 12345, 'your-token');
    ```
2. **Usage**:

    ```
    // Put a value
    $client->put('key', 'value');

    // Get a value
    $value = $client->get('key');

    // Delete a key
    $client->delete('key');

    // Other available methods...
    ```

Server Setup
------------

[](#server-setup)

This package is a client for the RocksDB server, which is part of the [RocksDBFusion](https://github.com/s00d/RocksDBFusion) project. Before using this client, ensure the RocksDB server is running. You can set up and run the server by following the instructions in the [RocksDBFusion](https://github.com/s00d/RocksDBFusion) repository.

Methods
-------

[](#methods)

### put

[](#put)

Stores a key-value pair in the database.

```
RocksDB::put('key', 'value', 'optional_column_family');
```

### get

[](#get)

Retrieves the value of a key from the database.

```
$value = RocksDB::get('key', 'optional_column_family', 'default_value');
```

### delete

[](#delete)

Deletes a key from the database.

```
RocksDB::delete('key', 'optional_column_family');
```

### merge

[](#merge)

Merges a value with an existing key.

```
RocksDB::merge('key', 'value', 'optional_column_family');
```

### listColumnFamilies

[](#listcolumnfamilies)

Lists all column families in the database.

```
$columnFamilies = RocksDB::listColumnFamilies('path_to_db');
```

### createColumnFamily

[](#createcolumnfamily)

Creates a new column family.

```
RocksDB::createColumnFamily('new_column_family');
```

### dropColumnFamily

[](#dropcolumnfamily)

Drops an existing column family.

```
RocksDB::dropColumnFamily('column_family');
```

### compactRange

[](#compactrange)

Compacts the database within a range.

```
RocksDB::compactRange('start_key', 'end_key', 'optional_column_family');
```

### Transactions

[](#transactions)

#### Begin Transaction

[](#begin-transaction)

Begins a new transaction.

```
$txnId = RocksDB::beginTransaction();
```

#### Commit Transaction

[](#commit-transaction)

Commits a transaction.

```
RocksDB::commitTransaction($txnId);
```

#### Rollback Transaction

[](#rollback-transaction)

Rolls back a transaction.

```
RocksDB::rollbackTransaction($txnId);
```

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](https://github.com/s00d/rocksdb-client-php/blob/master/LICENSE) file for details.

Links
-----

[](#links)

- [GitHub Repository](https://github.com/s00d/rocksdb-client-php)
- [Packagist Package](https://packagist.org/packages/s00d/rocksdb-client-php)
- [RocksDBFusion](https://github.com/s00d/RocksDBFusion)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

11

Last Release

697d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b58c344f6f895edc186de3097331fc96b852a970403edde4c9bbb50bd60388e6?d=identicon)[s00d](/maintainers/s00d)

---

Top Contributors

[![s00d](https://avatars.githubusercontent.com/u/2684895?v=4)](https://github.com/s00d "s00d (19 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/s00d-rocksdb-client-php/health.svg)

```
[![Health](https://phpackages.com/badges/s00d-rocksdb-client-php/health.svg)](https://phpackages.com/packages/s00d-rocksdb-client-php)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
