How To Use Redis For Queuing In Laravel 5
What is Redis?
Redis is an in-memory but persistent on disk database, that represents a different trade-off where very high write and read speed is achieved with the limitation of data sets that can’t be larger than the memory. Once larger than memory, it starts trading the data from the backend SQL databases by pushing and pulling the data. This, in some scenarios, can bring out great speed to the overall system.
For example, a number of people are liking or commenting on a post. While concurrent requests reach the server, it’s impossible to process all of them simultaneously at high speed because accessing the database requires a little section of the overall process time.
We tackle this by pushing the customer’s “like” request in a queue and show him the updated page while database is not updated. After sometime when the jobs in the queues start firing, his job will then be fulfilled and database will be updated at the back-end servers.
This doesn’t explain the whole queuing structure, but the example was just to give an idea of how Redis can be used.
How To Setup Redis.
Make sure you have Redis installed at your local server. You can check it by following the steps below, but if you are working on Cloudways, you can skip this step and follow the next one.
Link:
This post is submitted by our members. Submit a new post.
Tags: Tutorials Laravel 5 Laravel 5.1 Laravel 5.2 Intermediate