0

I'am wondering what is the best way to use Redis NoSQL Database in CakePHP not for Caching but as regular Key/Value Store?

There is a Plugin for Redis 2.4.2 or higher, but the Plugin does not work with CakePHP 3.x: Redis CakePHP 2.4.2 Plugin

What is the best way to use Redis in CakePHP 3 as regular Key/Value Database? How costly is it to upgrade the CakePHP 2.4.2 Redis-Plugin to a CakePHP 3.x Plugin. Is the migration of the Plugin the best way or is it better to create a new Datasource? (The current Redis-Plugin extends the Datasource-class.)

Niklas
  • 95
  • 1
  • 9

1 Answers1

0

Take a close look at what that datasource does, it's pretty much just a proxy to a Redis class instance, other than that it only handles connecting and disconnecting.

So besides having auto connect/disconnect functionality, there is pretty much no point in implementing such a datasource, and you could also just use Redis directly instead.

https://github.com/phpredis/phpredis#classes-and-methods

If you'd wanted to use it as a datasource, ie have it accessible via the connection manager, then you'll have to implement \Cake\Datasource\ConnectionInterface.

If you are looking for a datasource that acts as an ORM, that's a complete different story, and a rather complex task, see for example the CakePHP ElasticSearch Datasource plugin.

ndm
  • 59,784
  • 9
  • 71
  • 110