7

Which one should I choose and why between predis and phpredis ?I am using NGINX and Codeigniter.Thanks in advance

2 Answers2

16

I'll consider that your concern is performance and you mean "Which is faster?".

The short answer is "PhpRedis".

PhpRedis is a PHP extension (written in C) and Predis is a PHP package (written in PHP).

Based on many benchmarks like the mentioned link below, PhpRedis is about 6 times faster than Predis. It's recommended to use PhpRedis if performance is a concern to your service.

Useful links:

PhpRedis vs Predis: Comparison on real production data

Milad Rahimi
  • 3,464
  • 3
  • 27
  • 39
  • 4
    PhpRedis is about 6x faster then Predis - https://medium.com/@akalongman/phpredis-vs-predis-comparison-on-real-production-data-a819b48cbadb . Howeverm if you're on a shared hosting, the only option would probably be Predis as a PHP package. – Jakub Adamec Nov 22 '20 at 11:57
3

It is worth noting that aside from library performance considerations, PHPRedis is presently lagging behind Predis in adding Redis 7 feature support (which I was looking for), so timing of your project implementation can also be a factor.

John Rix
  • 6,271
  • 5
  • 40
  • 46