PHPackages                             boyhagemann/storage - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. boyhagemann/storage

ActiveLibrary[File &amp; Storage](/categories/file-storage)

boyhagemann/storage
===================

029PHP

Since Apr 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/boyhagemann/storage)[ Packagist](https://packagist.org/packages/boyhagemann/storage)[ RSS](/packages/boyhagemann-storage/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Immutable Data Storage
======================

[](#immutable-data-storage)

This is a proof of concept of an immutable data storage system. No data will ever get mutated. Every change for both the data schema and the data itself is versioned.

This package can be used in any API framework.

Testing
-------

[](#testing)

Run `vendor/bin/phpunit` to run all tests.

Quick Start
-----------

[](#quick-start)

1. Setup the Entity and a Record

```
    $pdo = new PDO( ... );
    $entity = new MysqlEntity($pdo);
    $record = new MysqlRecord($pdo);
```

2. Create a new entity
3. Insert a record

Drivers
-------

[](#drivers)

By default, it ships with a Mysql driver. But you can make your own driver, as long as it follows the interfaces. The drivers must have a test file that extends the `AbstractTest.php`.

Entities and Records
--------------------

[](#entities-and-records)

The package is divided in two concepts:

1. Entities
2. Records

### Entity

[](#entity)

An Entity reflects a table in MySQL. It holds the structure of the data. An `Entity` has many `Field`s that defines the structure. This is what happens of something changes in an Entity or a Field:

- If an `Entity` changes, the version of the `Entity` increments with 1.
- If a `Field` changes, the version of the `Field` and its `Entity` increments with 1.

### Record

[](#record)

A Record reflects a table row in MySQL. Each Records has a unique `_id` and holds the actual data. A `Record` has many `Value`s that makes up the data. This is what happens of something changes in a Record:

- If the changes of the Record differ from the last version, then the version of the `Record` increments with 1.
- If a provided `Value` differs from the last version of this Value, the version for this Value increments with 1.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a43699bf9428b2ee2e827915e14321f44c4cb7e6fbf4c6a3faf086937a852ce?d=identicon)[boyhagemann](/maintainers/boyhagemann)

---

Top Contributors

[![boyhagemann](https://avatars.githubusercontent.com/u/737610?v=4)](https://github.com/boyhagemann "boyhagemann (35 commits)")

### Embed Badge

![Health badge](/badges/boyhagemann-storage/health.svg)

```
[![Health](https://phpackages.com/badges/boyhagemann-storage/health.svg)](https://phpackages.com/packages/boyhagemann-storage)
```

###  Alternatives

[venveo/craft-compress

Create smart zip files from Craft assets on the fly

124.7k](/packages/venveo-craft-compress)

PHPackages © 2026

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