{"id":20279349,"url":"https://github.com/simplito/ldba-php","last_synced_at":"2026-03-11T05:31:30.186Z","repository":{"id":57051432,"uuid":"123123190","full_name":"simplito/ldba-php","owner":"simplito","description":"High-performance, low-memory-footprint, single-file embedded database for key/value storage","archived":false,"fork":false,"pushed_at":"2020-06-12T06:12:02.000Z","size":8,"stargazers_count":13,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-16T01:27:17.413Z","etag":null,"topics":["database","embedded-database","php","storage"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simplito.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-27T12:01:43.000Z","updated_at":"2025-06-16T03:59:57.000Z","dependencies_parsed_at":"2022-08-24T05:10:45.541Z","dependency_job_id":null,"html_url":"https://github.com/simplito/ldba-php","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/simplito/ldba-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fldba-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fldba-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fldba-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fldba-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplito","download_url":"https://codeload.github.com/simplito/ldba-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fldba-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30372170,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","embedded-database","php","storage"],"created_at":"2024-11-14T13:29:36.598Z","updated_at":"2026-03-11T05:31:30.163Z","avatar_url":"https://github.com/simplito.png","language":"PHP","readme":"\n# LDBA - a fast, pure PHP, key-value database.\n\n## Information\n\nLDBA is a high-performance, low-memory-footprint, single-file embedded database for key/value storage and retrieval written in pure PHP.\n\nIt is inspired by Erlang's Dets and Berkeley DB sofware and includes implementation of [extended linear hashing](https://en.wikipedia.org/wiki/Linear_hashing) for fast key/value access and implementation of a fast [buddy storage allocator](https://en.wikipedia.org/wiki/Buddy_memory_allocation) for file space management.\n\nLDBA supports insertion and deletion of records and lookup by exact key match only. Applications may iterate over all records stored in a database, but\nthe order in which they are returned is undefined. Fault tolerance is achieved by automatic crash recovery thanks to transactional style writes. The size of LDBA files cannot exceed 2GB.\n\nLDBA provides functions compatible with [php_dba](http://php.net/manual/en/book.dba.php) (Database Abstraction Layer) for easy adoption in existing software.\n\nRequirements: PHP 5.4+\n\nThe library is being used, for example, as base storage interface in the [PrivMX WebMail](https://privmx.com) software.  \n\n\n## Instalation\n\nRun the following command to install the lib via composer:\n```\ncomposer require simplito/ldba-php\n```\n\n\n## An example\n\n```php\n$dbh = ldba_open(\"test.ldb\", \"c\");\nif (ldba_exists(\"counter\", $dbh)) {\n    $counter = intval(ldba_fetch(\"counter\", $dbh));\n} else {\n    $counter = 0;\n}\nldba_replace(\"counter\", $counter + 1);\nldba_close($dbh);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplito%2Fldba-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplito%2Fldba-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplito%2Fldba-php/lists"}