MacFJA / php-redisearch

PHP Client for RediSearch
MIT License
67 stars 9 forks source link

Can this be used with phpredis or is Predis required? #16

Closed anthonymf closed 3 years ago

anthonymf commented 3 years ago

The phpredis library is known to be lot faster than Predis.

Does this package really need Predis?

MacFJA commented 3 years ago

But I don't have a strong preference for Predis over anything else. The code don't really use any strong Predis feature that would prevent the code to be use with something else.

I guess I can add a small abstraction layer to be compatible with both phpredis and Predis. That can open more choice when it come to the Redis connection and don't enforce a particular flavor

anthonymf commented 3 years ago

Yes I agree it would open this project up to a wider audience. Many PHP developers just assume (without understanding the network latency impact on real-world performance) that the phpredis C library is better performance than the Predis library. Rightly or wrongly, when someone chooses Redis, it's not a surprise that they are seeking maximum performance.

I saw an abstraction layer approach here which might be suitable. I just assumed the parsing of redisearch results would be the difficult part - given the varying nature of command responses from redis. Perhaps there is already a solution for this...?

MacFJA commented 3 years ago

I just open the PR #17 to allow other solution for connecting to Redis. Right now Predis lib, phpredis extension and phpiredis extension are built-in, but adding other connector should be easy (see README).

For the ethanhann/redis-raw lib, I know it, but this library exists because the author simply archive his phpredis project when I open a PR for a fix. (and I see now that he unarchive his project, open a funding and recreate my PR and merge it 🤷 ) So I prefer come up with my own solution

MacFJA commented 3 years ago

@anthonymf I release the version 2.0.0 with the support of phpredis.

Thanks again for the idea, it force me to refactor some part and rethink a bit how it was working. I think it's better now.

anthonymf commented 2 years ago

Nice work! I can see how you've widened the appeal and it makes this library the most attractive for PHP & redisearch. Congratulations on the release.