PHPackages                             walnut/lib\_recordstorage - 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. walnut/lib\_recordstorage

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

walnut/lib\_recordstorage
=========================

0.0.4(4y ago)067PHP

Since Sep 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/kapitancho/walnut-lib-recordstorage)[ Packagist](https://packagist.org/packages/walnut/lib_recordstorage)[ RSS](/packages/walnut-lib-recordstorage/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

Record Storage
==============

[](#record-storage)

A key/value based record storage abstraction

Usages
------

[](#usages)

There are several ways to use the Record Storage.

### Full example using in-memory storage and PHP serialization

[](#full-example-using-in-memory-storage-and-php-serialization)

```
//Create a storage
$storage = new SerializedRecordStorage(
    new PhpArrayDataSerializer,
    new InMemoryKeyValueStorage
);
//An accessor factory for easy access
$accessorFactory = new ArrayDataAccessorFactory($recordStorage);

//Get the product storage
$accessor = $accessorFactory->accessor('products');

//Store some data
$accessor->store('product-id-1', [
    'id' => 'product-id-1',
    'name' => 'My first product',
    'itemsInStock' => 5
]);

count($accessor->all()); //1

//Fetch the data by key
$accessor->retreive('product-id-1'); //['id' => ..., 'name' => ...]

//Fetch the data by filter
$accessor->byFilter(
    fn(array $entry): bool => $entry['itemsInStock'] > 0
); //[1 record]

//Remove it
$accessor->remove('product-id-1');
//
```

### Using a JSON serializer

[](#using-a-json-serializer)

```
//Create a storage
$storage = new SerializedRecordStorage(
    new JsonArrayDataSerializer(
        new JsonSerializer
    ),
    new InMemoryKeyValueStorage
);
```

### Using an in-file storage

[](#using-an-in-file-storage)

```
//Create a storage
$storage = new SerializedRecordStorage(
    new JsonArrayDataSerializer(
        new JsonSerializer
    ),
    new InFileKeyValueStorage(
        new PerFileKeyToFileNameMapper(
            baseDir: __DIR__ . '/data',
            fileExtension: 'json'
        )
    )
);
```

### Using cached storage (highly recommended)

[](#using-cached-storage-highly-recommended)

```
$storage = new SerializedRecordStorage(/*...*/);
$cacheableStorage = new CacheableRecordStorage($storage)
```

\###More adapters and decorators

- Transaction Context decorator
- Redis Adapter
- ...other

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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 ~80 days

Total

4

Last Release

1511d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/792682?v=4)[Marian Kostadinov](/maintainers/kapitancho)[@kapitancho](https://github.com/kapitancho)

---

Top Contributors

[![kapitancho](https://avatars.githubusercontent.com/u/792682?v=4)](https://github.com/kapitancho "kapitancho (7 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/walnut-lib-recordstorage/health.svg)

```
[![Health](https://phpackages.com/badges/walnut-lib-recordstorage/health.svg)](https://phpackages.com/packages/walnut-lib-recordstorage)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M117](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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