Which one should I choose and why between predis and phpredis ?I am using NGINX and Codeigniter.Thanks in advance
Asked
Active
Viewed 1.2k times
7
-
I find the solution in the given link – Santosh Chakraborty Jul 30 '18 at 08:09
-
https://www.quora.com/Redis-How-does-PRedis-compare-with-phpredis – Santosh Chakraborty Jul 30 '18 at 08:09
-
1[primarily opinion-based] Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. – sɐunıɔןɐqɐp Jul 30 '18 at 08:12
2 Answers
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:

Milad Rahimi
- 3,464
- 3
- 27
- 39
-
4PhpRedis 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