Back Button Tooling
Learn Redis Through Examples

Learn Redis Through Examples

You've probably known for a while now that Redis is a thing. But, like so many others, maybe you've had trouble understanding exactly when you would reach for a key-value database like this. What's wrong with just using MySQL for everything, right? Well, as you'll find, there are a number of situations when Redis emerges as the best possible tool for the job. In this series, you'll work through a number of examples to get up and running with Laravel and Redis as quickly as possible.

Intermediate
7 episodes
1:14:36 hrs
7
Latest Episode in This Series

Added 3 years ago

Fetch In Progress Articles

Laracasts offers the ability to view recent series that you are currently working through. While this can...

Watch
Learn Redis Through Examples

Learn Redis Through Examples

You've probably known for a while now that Redis is a thing. But, like so many others, maybe you've had trouble understanding exactly when you would reach for a key-value database like this. What's wrong with just using MySQL for everything, right? Well, as you'll find, there are a number of situations when Redis emerges as the best possible tool for the job. In this series, you'll work through a number of examples to get up and running with Laravel and Redis as quickly as possible.

Begin
7
Latest Episode in This Series

Added 3 years ago

Fetch In Progress Articles

Laracasts offers the ability to view recent series that you are currently working through. While this can...

Watch

Your Teacher | Jeffrey Way

https://laracasts.s3.amazonaws.com/avatars/jeffrey-avatar.jpg's avatar
Hi, I'm Jeffrey. I'm the creator of Laracasts and spend most of my days building the site and thinking of new ways to teach confusing concepts. I live in Orlando, Florida with my wife and two kids.
    1. EPISODE 1

      Run Time 4:39

      Free

      In this opening episode, we'll get Redis installed on your machine, before moving on to basic Redis usage in Laravel. Let's start with the most old-school of examples: a site visitor counter. As silly as it may be, should you need such a counter, Redis is a perfect choice.

    2. EPISODE 2

      Run Time 6:40

      Okay okay, so a website visitor counter is a bit old-fashioned. But, if you think about it, we increment counters all over the place: your number of followers, the times a video has been downloaded, the number of articles you've favorited, etc. Let's review one example in this episode, while also taking time to discuss key name-spacing.

    3. EPISODE 3

      Run Time 19:07

      You're going to love sorted sets. Think of them as unique arrays that automatically sort their items, according to a particular score that you define. You might sort the top scoring basketball teams, a forum leaderboard, or even the most popular video tutorials at Laracasts! When it comes to Redis, even two lines of code can accomplish so much.

    4. EPISODE 4

      Run Time 11:24

      Next up, let's review Redis' hash data type. Think of these as a Redis equivalent to PHP's associative array. When you need to associate a number of key-value pairs with a single key, this is the type you should reach for. Near the conclusion of this lesson, we'll also touch upon Laravel's Cache component, and how that fits in with our Redis review.

    5. EPISODE 5

      Run Time 14:00

      Caching, of course, is an incredible use-case for Redis. Whether you're caching database queries, API calls, or even HTML fragments, you'll get a lot of use out of the techniques within this episode. We'll begin by building up a custom remember function, before switching over to Laravel's Cache component.

    6. Before we move on to learning about PubSub in Redis, let's take a short break to review how we might organize our PHP to best take advantage of caching. In the previous episode, we simply wrapped our database query in a call to Cache::remember(). But, what if we want to dry up our code a bit, or even turn the caching on and off (through the use of decorators), like the flick of a switch? In this episode, I'll demonstrate a few options that you might consider.

    7. EPISODE 7

      Run Time 10:08

      Laracasts offers the ability to view recent series that you are currently working through. While this can easily be accomplished with a traditional MySQL pivot table, leveraging Redis is faster, and more practical. In this episode, I'll demonstrate the basic workflow to implement such a feature on your own website.