Modern Redis in 40 Minutes | Crash Course 2023

Поділитися
Вставка
  • Опубліковано 8 лип 2024
  • Master modern Redis with a project-based learning approach. We'll explore the most relevant & used data types and set up both a serverful and serverless Redis instance as our Redis playground. You'll learn performance optimizations and later also learn to keep your database requests at a minimum using Redis JSON.
    Upstash for serverless Redis: upstash.com/?Josh2
    Windows Subsystem Linux: learn.microsoft.com/en-us/win...
    -- my links
    Discord for questions/answers: / discord
    My GitHub: github.com/joschan21
    -- timestamps
    0:00 What you'll learn
    0:59 What can Redis do for you?
    2:40 Task - can you figure out the ideal data types?
    4:25 Our project structure
    5:08 Redis for serverful environments
    7:22 Redis for serverless environments
    9:02 Setting up our Redis playground project
    14:17 Connecting to Redis
    16:48 Lists
    18:48 Sets
    23:08 Hashes
    26:32 Fetching comments on the frontend
    28:56 Performance optimizations
    31:02 Redis JSON
  • Наука та технологія

КОМЕНТАРІ • 84

  • @eshw23
    @eshw23 11 місяців тому +15

    These crash courses over fundamental topics are a blessing, helps me with my own projects

  • @codewithantonio
    @codewithantonio 11 місяців тому +26

    Just in time I plan to build my next app with upstash! Great Content!

    • @joshtriedcoding
      @joshtriedcoding  11 місяців тому +2

      Cheers man, looking forward to it!

    • @blank_bow
      @blank_bow 7 місяців тому +1

      Waiting for your content also

  • @ashimov1970
    @ashimov1970 11 місяців тому

    All concise, and right to the point. Great job, Josh. God bless

  • @yanaytsabary8297
    @yanaytsabary8297 11 місяців тому

    Great cover - thank you!

  • @keshavakumar9828
    @keshavakumar9828 11 місяців тому +5

    For the past 2 weeks I been learning redis through docs and now you droped this gem 💎
    You are the most consistent youtuber with such high quality content. Thank you for this tutorial
    I wish this was 4-5+ hr long

    • @beloaded3736
      @beloaded3736 11 місяців тому

      I think there is Stephen Griders course on Udemy that is over 9hrs long on the redis topic..

    • @joshtriedcoding
      @joshtriedcoding  11 місяців тому +1

      Really appreciate that man. Means a lot.

  • @retrosynthguy
    @retrosynthguy 6 місяців тому

    Bro, you're the best, I freaking love u dude

  • @canardeur8390
    @canardeur8390 6 місяців тому

    Ein ganz kurzer Kurs, der doch sehr gründlich ist!
    Also kurz gesagt: toller Kurs!

  • @thedevnoteyt
    @thedevnoteyt 11 місяців тому +8

    Fantastic tutorial Josh. Can you please make such crash courses on other topics like React Query, tRPC etc ?

  • @kleinertraitor
    @kleinertraitor 11 місяців тому +4

    Great video!
    I'd be interested in a follow up for using redis as a cache and then syncing it with a real MySQL database.

  • @aBradAbroad
    @aBradAbroad 11 місяців тому +1

    Another one! Thanks Josh

  • @Tiberiumgod
    @Tiberiumgod 11 місяців тому

    Thanks. About JSON was interesting.

  • @mohitcodeswell
    @mohitcodeswell 11 місяців тому +4

    Ohhh hiii Josh, thanks for the redis course, I was making a stackoverflow clone and needed this very much !

    • @joshtriedcoding
      @joshtriedcoding  11 місяців тому +1

      cheers dude happy to hear that. Appreciate you commenting so regularly

    • @mohitcodeswell
      @mohitcodeswell 11 місяців тому

      @@joshtriedcoding thank you josh for noticing comments, is really took years to find a teacher (guru in India)

  • @atejap
    @atejap 5 місяців тому

    You did it. tks a lot

  • @frazuppi4897
    @frazuppi4897 11 місяців тому

    I think it would have been better to create the three tags under tags: etc and you then have a set or list inside the comment linking the the id of one specific tag

  • @santiagograviano9064
    @santiagograviano9064 11 місяців тому

    Keep it going champ, you doing it great!

  • @apteryx
    @apteryx 11 місяців тому

    Yooo, I literally setup upstash/redis in my project yesterday!

  • @27sosite73
    @27sosite73 6 місяців тому

    ty

  • @jitx2797
    @jitx2797 11 місяців тому

    Thansk for the awesome content man

  • @wavyboyjodii
    @wavyboyjodii 7 місяців тому

    thanks bro

  • @elbezz
    @elbezz 11 місяців тому

    awesome!

  • @DamirSecki
    @DamirSecki 11 місяців тому +2

    Josh, thanks for the video... can you please explain in the next video... how can we use this in production?
    and how can we sync the redis with our sql or mongo db?

  • @tomirodriguez7195
    @tomirodriguez7195 11 місяців тому +4

    Excelent video Josh!
    I was wondering in which cases would you use redis instead of an actual database? Since the latest is way more powerfull and cheep, is there some edge cases where using redis would be better?
    I can't stop comparing the 10k comments / day from upstash against the 1billon read from Planetscale 🤔
    Thanks for all the content :) It really helps a lot

  • @jermunitz3020
    @jermunitz3020 11 місяців тому

    Another important key type is Streams. I find it useful for multiplayer games and chat apps were the data needs to be streamed in and updates subscribed to. It's like a little Kafka.

    • @ikhwanrizqynurzaman7579
      @ikhwanrizqynurzaman7579 11 місяців тому

      True. I used it in online trading app. It's lightweight, fast, and easy to use

  • @gosnooky
    @gosnooky 11 місяців тому

    What would the performance benefits be to using Redis JSON to just store, say, a cached API response as opposed to just stringifying/parsing the standard Redis string response? The JSON has to be marshaled anyways by ioredis. My current use cases don't involve granular edits to nested data. I just store and retrieve the whole thing.

  • @hn3m3s1s
    @hn3m3s1s 11 місяців тому

    Really nice video on a interesting topic!
    In the introduction you say you would explain 'when' to use redis but I'm not sure I got it. Would have been great to explain when to use redis over SQL for example.

    • @joshtriedcoding
      @joshtriedcoding  11 місяців тому +1

      Throughout the video and at the end I mention the role many people use it as - a cache for your mysql / postgres / mongo database. Not only does it take load off of the primary db, but also speeds up requests for frequently requested resources. Hope that helps!

    • @hn3m3s1s
      @hn3m3s1s 11 місяців тому

      @@joshtriedcoding thanks

  • @syedsadiq8591
    @syedsadiq8591 10 місяців тому

    I am subscribing to this channel

  • @CodeWithMathias
    @CodeWithMathias 11 місяців тому

    i prefer to use docker instead of using virtualization in my machine it's more flexible. great video btw

  • @emee__
    @emee__ 11 місяців тому +1

    Bro, can you make a tutorial on migrating express server to next js or at the very least use express server together with next js, I would greatly appreciate

  • @user-rd4oo1jg5g
    @user-rd4oo1jg5g 9 місяців тому

    Very good video, I congratulate you. I ask you a question, suppose I have an application with a mysql database, my app calls an api to query and show products to the user, if I implement you Redis to cache the busquedaby that the api first see if you have stored in cache and if not just then go to query the database, with the first user who enters the app Eedis stored in the server cache and then if another user comes and asks to see the products would be set in that cache even if they are different users? The cache has a time and then it is deleted and the search to the database is done again, right? Thank you very much

  • @frazuppi4897
    @frazuppi4897 11 місяців тому

    redis is just soo good

  • @jritzeku
    @jritzeku 8 місяців тому

    How would you cache a list of data like posts? In reality, wouldnt this be more practical than just a caching a single post since it would take longer to fetch.
    Could I just a set a dummy key like "posts" and store value there? And whenever new post is added, or existing post is edited/deleted, would have to flush

  • @MrAtomUniverse
    @MrAtomUniverse 11 місяців тому

    Talk about KeyDB, it has enterprise features of redis

  • @rainx6995
    @rainx6995 5 місяців тому

    can I know the canvas tool is been used?

  • @tmacka88
    @tmacka88 11 місяців тому

    Great video. Any reason why you didn’t store the commentId inside the JSON object. Why did you keep them seperate?

    • @joshtriedcoding
      @joshtriedcoding  11 місяців тому +1

      Keeping track of all comment ids in a list makes sense to easily fetch the x latest comments. With those IDs, you can go ahead and fetch the details for each comment - because the key you store those as is defined by the commentId (e.g. comment_details:commentId). No need to keep track of it separately

  • @nr7343
    @nr7343 11 місяців тому

    a question...
    In the end Redis saves everything as a strig..
    So what is the difference between this and just doing
    JSON.stringify()
    ??

  • @pushkarkathayat7893
    @pushkarkathayat7893 5 місяців тому

    As nextjs already caches request, do we still need it?

  • @fonyuyjudefomonyuy3980
    @fonyuyjudefomonyuy3980 11 місяців тому

    Josh🙏🇨🇲

  • @asatorftw
    @asatorftw 11 місяців тому

    Needs some real world examples and applications in the video. I think people use redis mostly for rate limiting and session storage? Or would anyone seriously pick redis for saving userdata over a sql db?

  • @ishansoni4326
    @ishansoni4326 11 місяців тому

    But what about react-query? Is it having a similar use case?

    • @joshtriedcoding
      @joshtriedcoding  11 місяців тому

      redis and react query are two very different things

  • @lakshmanshankar
    @lakshmanshankar 11 місяців тому

    Why installing wsl may be docker is easy to setup but I m not sure how it works on windows

  • @koustavmaity-fh3gx
    @koustavmaity-fh3gx 9 місяців тому

    how to use zrem using uptash redis

  • @lepa319
    @lepa319 8 місяців тому

    redis doesnt come with the json integration, showing us the installation of this would be helpful.

  • @mohakbajaj4235
    @mohakbajaj4235 11 місяців тому

    Hey Josh! What's in your Excelifraw Library? Also, Do you use Excelidraw+?

    • @joshtriedcoding
      @joshtriedcoding  11 місяців тому +1

      Hey ddue! Not sure what you mean by library.. I just write all the stuff in there for the videos and use icons from flaticon. I don't use a paid version for excalidraw. Cheers man

    • @mohakbajaj4235
      @mohakbajaj4235 11 місяців тому

      @@joshtriedcoding Well the top right button....

    • @joshtriedcoding
      @joshtriedcoding  11 місяців тому

      @@mohakbajaj4235 oh, it just says "no items added yet"

  • @Its-InderjeetSinghGill
    @Its-InderjeetSinghGill 4 місяці тому

    You did not mention TTL!

  • @namhoai5282
    @namhoai5282 11 місяців тому

    give your slide about redis pls

  • @schmellmafeet
    @schmellmafeet 2 місяці тому

    I thought Redis was for ephemeral data?

  • @mikelCold
    @mikelCold 11 місяців тому

    Great video, but kinda funny how you ended it by practically saying "nothing I showed you is how people normally use redis" and then just ended the video... lol

    • @joshtriedcoding
      @joshtriedcoding  11 місяців тому +1

      Thanks man. I think you kinda missed the point. The point of the video is to learn when to use redis and which data types for which purpose. The transfer of applying that knowledge to a database call is non-existent. You get the result and put it into redis just the same way you learn in the video. You could even argue the comment data object was a database result, just mocked

  • @theangelofspace155
    @theangelofspace155 11 місяців тому

    Just at 18:00 min of thr video Im loking most so far but one thing. Why use next.js to teach a new stack? Sigh nextJS already has its unique caveats l, it would have been better seen the setup in plain front/backends like a node/express backend and a vite fromt end, that way we learn how to set it up in general and then addpated to whatever framework we want to use (next, solid, svektekit, etc) show was the most pure form first 😔

    • @joshtriedcoding
      @joshtriedcoding  11 місяців тому

      Fair point. That's why I showed how to set up a locally hosted Redis in the beginning, so you can easily follow along in any other framework/language. I'd used ioredis to connect to it, but there are a bunch of clients to connect to locally hosted Redis. The API is close to the same, just wanted to also show Redis for serverless environments because not a lot of existing videos do that.

  • @uttamkumbhakar2894
    @uttamkumbhakar2894 11 місяців тому

    Third Comment :))

  • @jengstrm2
    @jengstrm2 10 місяців тому

    You missed the most important feature! Guess what it is…😊

  • @nr7343
    @nr7343 11 місяців тому

    i like your videos, but you mix evry topic with nextjs 🙃

    • @theangelofspace155
      @theangelofspace155 11 місяців тому

      Same feedback 😮‍💨😢. I love the content but I just wish the were more generic so I can use it in not nextjs (I prefer to use vite) but even svelte.

  • @eydiwowers
    @eydiwowers 11 місяців тому

    First :))

  • @techs7296
    @techs7296 11 місяців тому

    Likes at 18:41, 404

    • @techs7296
      @techs7296 11 місяців тому

      Its pm not video timing

  • @RifkiJones
    @RifkiJones 11 місяців тому +1

    I know Upstash sponser you, but I'm sure many people watching are not interested in them. It feels a bit like your making this tutorial not to teach us Redis, but to plug Upstash in a video

    • @joshtriedcoding
      @joshtriedcoding  11 місяців тому

      Unfortunate you feel this way. The API is basically the same, that's why I show the whole express / any framework of your choice setup as well. It doesn't matter how you follow along, the focus is on Redis and not on the underlying provider

  • @greendsnow
    @greendsnow 5 місяців тому

    Upstash is NOT Redis! You're misleading people.

  • @siddiquiaffan
    @siddiquiaffan 11 місяців тому

    Wondering if it will work or not if we do something like this.
    redis.json.set('key', '$.tags.TypeScript', true)
    time: 34:06

  • @davidc.7688
    @davidc.7688 9 місяців тому