kmfk/slowdb 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kmfk/slowdb

Composer 安装命令:

composer require kmfk/slowdb

包简介

A Key/Value Store written in PHP

README 文档

README

SlowDB

When you don't want Redis, Memcached, or any other Key/Value store.

SlowDB is the Key/Value store written purely in PHP that'd you be upset to find your co-worker running in production.

Features:

  • Multiple named Collections
  • In-memory indexes
  • Safe persistence to disk

SlowDB allows for storing Key/Value pairs in multiple collections. Indexes are built/rebuilt on startup to map Keys to file locations on disk. This allows performant binary searches across database files and writing directly to disk for safe, consistent writes.

Installation

Clone the repository locally and run composer install:

$> git clone https://github.com/kmfk/slowdb
$> cd slowdb/
$> php composer.phar install

Usage

Technically, SlowDB can be instantiated as a service in your application.

However, when SlowDB is used as a service, the Database needs to be instantiated and the indexes built on every request. On small datasets, this should be negligible - while large datasets, this can add unwanted latency to requests.

The best way to use SlowDB is by using the included socket server (built on ReactPHP) and the driver.

While only single threaded, this will keep the database indexes in memory and provide better performance.

$> ./slowdb &

Basic Example

Once the server is running, you can use it like this:

    <?php

    require 'vendor/autoload.php';

    use SlowDB\Driver;

    $driver = new Driver('localhost', 1337);

    $driver->test->set('abc', ['foo' => 'bar']);

    $value = $driver->test->get('abc');

    print_r($value);

统计信息

  • 总下载量: 39
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-09-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固