Skip to content

bpaquet/aerospike_redis_php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aerospike_redis_php

This a drop in replacement for the Redis module, using Aerospike as Database.

Installation

Register the redis.lua module into Aerospike

 register module 'redis.lua'

You must have the aerospike php module.

In your PHP code, instead of creating a Redis class, create an Aeropsike Redis class :

  $config = array("hosts" => array(array("addr" => $host, "port" => 3000)));
  $db = new Aerospike($config, false);
  $r = new AerospikeRedis($db, "namespace", "set");

$r can be used as an Redis object.

$r->get("toto");

The namespace must exists in Aerospike config.

Implemented functions

  • get / set / setex
  • del / delete
  • ttl / setTimeout
  • lpush / push / rpop / lpop
  • lSize
  • ltrim / lRange
  • flushdb (using scan, poor performance)
  • hSet / hGet / hDel (keys length must be < 14 chars, bin names limitation in aerospike)
  • hmSet / hmGet
  • hGetAll (key order is different from the redis implementation)

Tests

test.php can be run against Redis or Aerospike.

Against Redis :

USE_REDIS=1 php tests.php

Against Aerospike :

php tests.php

or

HOST=my_aerospike_ip php tests.php

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published