PHPackages                             ronolo/json-database - 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. ronolo/json-database

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

ronolo/json-database
====================

A lightweight JSON document database, which sits on top of ronolo/json-store and adds document relations and query caching.

0.8.1(6y ago)20MITPHPPHP &gt;= 7.2CI failing

Since Oct 16Pushed 4y ago2 watchersCompare

[ Source](https://github.com/RoNoLo/json-database)[ Packagist](https://packagist.org/packages/ronolo/json-database)[ Docs](http://github.com/ronolo/jsonstorage)[ RSS](/packages/ronolo-json-database/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (5)Versions (12)Used By (0)

Json-Database
=============

[](#json-database)

This is an on-top sitting *extension* of ronolo/json-store which adds additional database like features to the JSON document store. Please read  to learn what you can do with it.

This *extension* adds relation ships between JSON documents.

Usage
-----

[](#usage)

```
$config = Database\Config();
$config->addStore('person', (new Store\Config())->setAdapter(new MemoryAdapter()));
$config->addStore('interests', (new Store\Config())->setAdapter(new MemoryAdapter()));

$database = Database::create($config);
```

This will tell the database, that it knows 2 JSON stores under the hood and when ever a query against the database will happen the database will look for referenced documents put them in place and return the documents normally.

A Referenced document is one which lives in it own store, but is maybe shared by other store documents. Here an example how it looks under the hood.

```
$config = Database\Config();

$config->addStore('person', (new Store\Config())->setAdapter(new Local('/foo/bar/persons')));
$config->addStore('interests', (new Store\Config())->setAdapter(new Local('/foo/bar/interests')));
$database = Database::create($config);

// Create a few interests
$hobby1 = $database->put('interests', ['name' => 'Music', 'stars' => 4], true);
$hobby2 = $database->put('interests', ['name' => 'Boxen', 'stars' => 3.4], true);
$hobby3 = $database->put('interests', ['name' => 'Movies', 'stars' => 5], true);

// Create some persons
$person1 = $database->put('person', [
    'name' => 'Ronald',
    'interests' => [$hobby1, $hobby2]
]);
$person2 = $database->put('person', [
    'name' => 'Ellen',
    'interests' => [$hobby2, $hobby3]
]);
$person3 = $database->put('person', [
    'name' => 'James',
    'interests' => []
]);
$person4 = $database->put('person', [
    'name' => 'Katja',
    'interests' => [$hobby3, $hobby1, $hobby2]
]);

// Request of Katja which will return a JSON object with her 3 hobbies dereferenced.
$katja = $database->read('person', $person4);
```

Katja as JSON:

```
{
    "name": "Katja",
    "interests": [
        {
            "name": "Movies",
            "stars": 5
        },
        {
            "name": "Music",
            "stars": 4
        },
        {
            "name": "Boxen",
            "stars": 3.5
        }
    ]
}
```

Goals
-----

[](#goals)

- No real database needed like SqlLite, Mysql, MongoDB, CouchDB ...)
- PHP 7.2+
- Document Store aka NoSQL
- JSON as format of storage
- (very) low memory usage even for huge results
- NoSQL like query syntax (CouchDB style)
- Repository and database (document relations) usage options
- Abstract data location via

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~3 days

Total

11

Last Release

2372d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/043b3962813e9815beff7da0bcd89ce3f380aeefcb22a721e57a287c65521636?d=identicon)[RoNoLo](/maintainers/RoNoLo)

---

Top Contributors

[![RoNoLo](https://avatars.githubusercontent.com/u/17102148?v=4)](https://github.com/RoNoLo "RoNoLo (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

jsonfilenosqldbdocumentflat

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ronolo-json-database/health.svg)

```
[![Health](https://phpackages.com/badges/ronolo-json-database/health.svg)](https://phpackages.com/packages/ronolo-json-database)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[jamesmoss/flywheel

A lightweight, flat-file, document database

33215.4k5](/packages/jamesmoss-flywheel)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6129.6M91](/packages/league-flysystem-sftp-v3)[greg0/lazer-database

PHP library to use JSON files like flat-file database

28816.5k4](/packages/greg0-lazer-database)[fof/upload

The file upload extension for the Flarum forum with insane intelligence.

188171.7k15](/packages/fof-upload)

PHPackages © 2026

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