0

As I was developing a php app I realised that my app is slow in terms of processing large sets of data in the catche. Decided to do something about it and went on to google to find some sort of solution or at least suggestions.

I came across Redis, after reading about it I would realy like to give it a go and test it out as it looks promising,

But I also stumbled into predis and phpredis, and thats when I begun to get confused. From what I understand i need predis or phpredis with my php app, but then where do I use Redis....? how should I build my stack...?

Redis->predis->php

Do I have to install both Redis and Predis/phpredis within my PHP directory in eg. lib dir..?

Also is there any significant difference between Redis and Phpredis

2 Answers 2

1

Redis is a standalone caching application: http://redis.io/ (plenty of documentation on how to install)

predis is a library for interacting with a running Redis application easily from within php. Phpredis is similar but requires compiling.

You can think of it like MySql and PHP. MySql is it's own application that you are able to communicate with via a PHP extension, MySql itself is not a part of PHP.

Your stack could be (apache / php5.3 / mysql / redis) with just the predis library.

You can run redis either on the same server or a different server, it's up to you.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much for clearing these out for me makes SENSE :)
1

Redis is a server that runs independently from your application (i.e. PHP) code. You can download it from here.

To talk to Redis, your application can do one of the following:

  1. Implement Redis' protocol, i.e. RESP
  2. Use a client library

Most people go for option 2, which in PHP's case your options would be predis, phpredis or any of the other clients in the clients page or others that are unlisted by you can find in GitHub.

2 Comments

Thank you :) I just really needed to clear the clouds to understand how to use all these in conjunction, Sorry If my question is bad
No worries - we all start somewhere :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.