High-performance, low-memory-footprint, single-file embedded database for key/value storage

Overview

LDBA - a fast, pure PHP, key-value database.

Information

LDBA is a high-performance, low-memory-footprint, single-file embedded database for key/value storage and retrieval written in pure PHP.

It is inspired by Erlang's Dets and Berkeley DB sofware and includes implementation of extended linear hashing for fast key/value access and implementation of a fast buddy storage allocator for file space management.

LDBA supports insertion and deletion of records and lookup by exact key match only. Applications may iterate over all records stored in a database, but the 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.

LDBA provides functions compatible with php_dba (Database Abstraction Layer) for easy adoption in existing software.

Requirements: PHP 5.4+

The library is being used, for example, as base storage interface in the PrivMX WebMail software.

Instalation

Run the following command to install the lib via composer:

composer require simplito/ldba-php

An example

$dbh = ldba_open("test.ldb", "c");
if (ldba_exists("counter", $dbh)) {
    $counter = intval(ldba_fetch("counter", $dbh));
} else {
    $counter = 0;
}
ldba_replace("counter", $counter + 1);
ldba_close($dbh);
You might also like...
Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.

TARS - A Linux Foundation Project TARS Foundation Official Website TARS Project Official Website WeChat Group: TARS01 WeChat Offical Account: TarsClou

High performance mine reset plugin for PocketMine-MP 4.0.0

MineReset38 High performance mine reset plugin for PocketMine-MP 4.0.0 Unlike other plugins, this plugin is not threaded but asynchronous. When a mine

A high-performance license server system service for creating and managing products, major versions, and software licenses for the purpose of selling installable software products.
A high-performance license server system service for creating and managing products, major versions, and software licenses for the purpose of selling installable software products.

A high-performance license server system service for creating and managing products, major versions, and software licenses for the purpose of selling installable software products. Comes with a SDK and command-line tool. Works anywhere that PHP runs.

A high-performance event loop library for PHP
A high-performance event loop library for PHP

🐇 A high-performance event loop library for PHP 🐇

High performance view templating API for PHP applications using tags & expressions inspired by Java JSTL and C compiler

View Language API Table of contents: About Expressions Tags Configuration Compilation Installation Unit Tests Examples Reference Guide About This API

File uploads with validation and storage strategies

Upload This component simplifies file validation and uploading. Usage Assume a file is uploaded with this HTML form: form method="POST" enctype="mult

File Storage Api

flux-file-storage-api File Storage Api Installation Native Download RUN (mkdir -p /%path%/libs/flux-file-storage-api && cd /%path%/libs/flux-file-stor

🧬 Nano is a zero-config, no skeleton, minimal Hyperf distribution that allows you to quickly build a Hyperf application with just a single PHP file.

Nano is a zero-config, no skeleton, minimal Hyperf distribution that allows you to quickly build a Hyperf application with just a single PHP file.

Simple, single-file and dependency-free AWS S3 client.

Simple, single-file and dependency-free AWS S3 client. Why? In some scenarios we want the simplest and lightest S3 client possible. For example in Bre

Owner
Simplito
Software R&D
Simplito
Ip2region is a offline IP location library with accuracy rate of 99.9% and 0.0x millseconds searching performance. DB file is ONLY a few megabytes with all IP address stored. binding for Java,PHP,C,Python,Nodejs,Golang,C#,lua. Binary,B-tree,Memory searching algorithm

Ip2region是什么? ip2region - 准确率99.9%的离线IP地址定位库,0.0x毫秒级查询,ip2region.db数据库只有数MB,提供了java,php,c,python,nodejs,golang,c#等查询绑定和Binary,B树,内存三种查询算法。 Ip2region特性

Lion 12.6k Dec 30, 2022
Leaf's very own high-speed, high-performance server

[WIP] Leaf Eien Server Eien is Leaf's implementation of a high-speed, high-performance server based on powerful tools like Open Swoole and Swoole. Eie

Leaf Framework 8 Dec 28, 2022
laminas-memory manages data in an environment with limited memory

Memory objects (memory containers) are generated by the memory manager, and transparently swapped/loaded when required.

Laminas Project 5 Jul 26, 2022
zend-memory manages data in an environment with limited memory

Memory objects (memory containers) are generated by the memory manager, and transparently swapped/loaded when required.

Zend Framework 16 Aug 29, 2020
Optimizes class loading performance by generating a single PHP file containing all of the autoloaded files.

Class Preloader for PHP This tool is used to generate a single PHP script containing all of the classes required for a specific use case. Using a sing

Class Preloader 356 Nov 26, 2022
Share value objects that contain the same primitive value as a singleton

sharable-value-objects Share value objects that contain the same primitive value as a singleton. Singletons are kept under WeakReference objects. Inst

mpyw 5 Nov 14, 2021
This plugin can be embedded in PHP application to give the web application specific routes/href

Routes Plugin PHP This plugin can be embedded in PHP application to give the web application specific routes/href location and for entering specific/l

Ifechukwudeni Oweh 7 Jul 17, 2022
High performance pocketmine 4.0 vote plugin

Voting38 This is a threaded high performance voting plugin for PocketMine-MP API 4.0 You can configure messages and voting rewards in the config. Ther

KingOfTurkey38 7 Jun 1, 2022
A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.

Motan Overview Motan is a cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services. Related

Weibo R&D Open Source Projects 5.8k Dec 20, 2022