Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
anthonymf opened this issue Oct 10, 2021 · 5 comments · Fixed by #17
Closed

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

anthonymf opened this issue Oct 10, 2021 · 5 comments · Fixed by #17

Comments

@anthonymf
Copy link

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

Does this package really need Predis?

@MacFJA
Copy link
Owner

MacFJA commented Oct 11, 2021

  • Predis has a bit nicer API when it come to custom command (Well, it have a API, where phpredis don't).
  • Predis doesn't require an external PHP extension to be added (build) to PHP compiler to run.
  • Predis have a support for phpiredis PHP extension that can improve performance.

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
Copy link
Author

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
Copy link
Owner

MacFJA commented Oct 16, 2021

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 MacFJA linked a pull request Oct 16, 2021 that will close this issue
@MacFJA
Copy link
Owner

MacFJA commented Nov 7, 2021

@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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants