PHPackages                             riquito/baobab - 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. riquito/baobab

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

riquito/baobab
==============

A library applying the nested set model

v1.3.1(11y ago)8913.4k↓67%27[10 issues](https://github.com/riquito/Baobab/issues)[2 PRs](https://github.com/riquito/Baobab/pulls)Apache 2.0PHPPHP &gt;=5.2.0

Since Jan 26Pushed 5y ago14 watchersCompare

[ Source](https://github.com/riquito/Baobab)[ Packagist](https://packagist.org/packages/riquito/baobab)[ Docs](http://www.sideralis.org/baobab)[ RSS](/packages/riquito-baobab/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (4)Used By (0)

Baobab ( a library applying the *nested set model* )
====================================================

[](#baobab--a-library-applying-the-nested-set-model-)

Baobab is a library to save tree structured data in a relational database.

Currently there is only a PHP implementation working with MySQL, but it shouldn't be too difficult to port to other languages or databases (most of the work is done via SQL queries and the code is mostly a support to them).

The technique used is Joe Celko's *nested set model*, modified so that a table can hold more than one tree, to help with cases such as storing threads of a forum (each thread is a tree and they all have an identical structure).

In fact when the library asks you for a "tree name", it's really asking for a forest name, because each table created can hold more than one tree.

We have more than one hundred tests to ensure the library is doing The Right Thing (™), a straightforward API and a clean documentation.

You can find the library's documentation at

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

3

Last Release

4339d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/68d7c5e0fe9ef72146e91bfe4782ba5094643269df9334cfc31cbb116c7a2c36?d=identicon)[riquito](/maintainers/riquito)

---

Top Contributors

[![riquito](https://avatars.githubusercontent.com/u/239925?v=4)](https://github.com/riquito "riquito (131 commits)")

---

Tags

sqltreeMPTTnested set model

### Embed Badge

![Health badge](/badges/riquito-baobab/health.svg)

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

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k605.0M6.8k](/packages/doctrine-dbal)[gedmo/doctrine-extensions

Doctrine behavioral extensions

4.1k124.6M429](/packages/gedmo-doctrine-extensions)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[doctrine/sql-formatter

a PHP SQL highlighting library

1.9k181.8M112](/packages/doctrine-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)[stof/doctrine-extensions-bundle

Integration of the gedmo/doctrine-extensions with Symfony

2.0k89.6M457](/packages/stof-doctrine-extensions-bundle)

PHPackages © 2026

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