How to implement Redis in Spring Boot using Spring Data Redis & Jedis

Sdílet
Vložit
  • čas přidán 8. 08. 2020
  • In this video, I will show you how to implement Redis in Spring Boot Application using Spring Data Redis and Jedis Client
    Github Code: bit.ly/3fBB6Sc
    Other Video:
    -----------------------------------------------------------------------
    How to Create a Virtual Machine Instance in the Google Cloud Platform - • How to Create a Virtua...
    SpringDoc - An Open API 3.0 based Documentation Library in Spring Boot - • SpringDoc - An Open AP...
    Deploy Spring Boot App in AWS EC2 instance using S3 - • Deploy Spring Boot App...
    How to Deploy Quarkus App in Docker - • How to Deploy Quarkus ...
    How to implement Logging in SPRING BOOT - • How to implement Loggi...
    How to Push and Pull a Docker Image from Docker Hub - • How to Push and Pull a...
    Create Docker Image without Dockerfile in Spring Boot - • Create Docker Image wi...
    Follow us on :
    --------------------------------------------------------
    Website: www.dailycodebuffer.com/
    Facebook: / dailycodebuffer
    Twitter: / dailycodebuffer
    Instagram: / dailycodebuffer
    GitHub: github.com/dailycodebuffer
    My Laptop :
    ------------------------------------------------------
    ASUS ROG Zephyrus G14, 14" - amzn.to/3tMb1I6
    ASUS ROG Zephyrus G14, 14" (US) - amzn.to/3xa6X6m
    Audio Gear :
    ------------------------------------------------------
    Maono AU-A04 Condenser Microphone : amzn.to/32FOpwI
    Maono AU-A04 Condenser Microphone (US) :amzn.to/3awzUj7
    Secondary Audio :
    ------------------------------------------------------
    Maono AU-100 Condenser Clip On Lavalier Microphone : amzn.to/3sGIbYd
    Recommended Books:
    ------------------------------------------------------
    Mastering Spring Boot 2.0 (Kindle): amzn.to/3tHJV4L
    Mastering Spring Boot 2.0 (US) : amzn.to/3tHNUy5
    Building Microservices(Kindle) : amzn.to/3gsA1jL
    Building Microservices(US) : amzn.to/3dDnfNn
    Spring Boot in Action : amzn.to/2Qo6YTM
    Spring Boot in Action (US) : amzn.to/32DkeX9
    Spring Microservices in Action : amzn.to/3gsA3rT
    Spring Microservices in Action(US): amzn.to/32G3Hl7
    Music:
    -------------------------------------------------------
    Hear the Noise (Sting): czcams.com/users/audiolibrary...
    “Sound effects obtained from www.zapsplat.com“
    #Redis #SpringDataRedis #Jedis #DailyCodeBuffer
  • Věda a technologie

Komentáře • 92

  • @DailyCodeBuffer
    @DailyCodeBuffer  Před 4 lety

    Follow me on Twitter: twitter.com/DailyCodeBuffer

  • @bgoswami2730
    @bgoswami2730 Před 4 měsíci

    Best tutorial on Redis cache so far on the entire CZcams channel

  • @gr5791
    @gr5791 Před 2 lety

    I got really stuck with getting all the values from redis part. Turned out that flushall was the answer. Thank you.

  • @utkarshdevgan6199
    @utkarshdevgan6199 Před 2 lety

    you are simply awesome bro!, I have never seen such a good content creator yet in my entire life you are really good at it, keep it up Bro

    • @DailyCodeBuffer
      @DailyCodeBuffer  Před 2 lety

      Thanks a lot for your kind words 🙂🙂. Means a lot to me 🙏🙏

  • @krishnagupta2706
    @krishnagupta2706 Před 2 lety

    Hi, your way of explanation is simply amazing.

  • @newkingdom4942
    @newkingdom4942 Před rokem

    One of the best video on redis
    Thank u so much for covering all scenarios 🙏

  • @abduchadili5691
    @abduchadili5691 Před 2 lety +4

    Great stuff here .
    Would be great if you can create a video on Springboot and Caching with Redis.
    Thanks

  • @letsdebug450
    @letsdebug450 Před 3 lety +2

    This man is a gem.

  • @ViniciusSousa-mx8uw
    @ViniciusSousa-mx8uw Před 3 lety

    Thank you SO MUCH!

  • @ankurgoel09
    @ankurgoel09 Před 2 lety +1

    Great Video, very well explained.

  • @aparnaagrawal8936
    @aparnaagrawal8936 Před 3 lety +3

    Nice Explanation, You covered all operations in short time... awesome

  • @kayeshparvez
    @kayeshparvez Před 3 lety +3

    I want to use Redis and Mysql/Postgres at the same time where Redis will be used as an LRU cache. What should I do ?

  • @giftdzikiti1824
    @giftdzikiti1824 Před 3 lety +1

    Thanks. Very useful

  • @italoo190
    @italoo190 Před 3 lety

    Tks sir, was very helpful

  • @shivaadep8532
    @shivaadep8532 Před 3 lety

    Bro I'm getting confused @cacheable n opsfoHash .. which one is better or do we use..?

  • @KhalidAthar
    @KhalidAthar Před rokem

    Hi, wanted to know that how can we add data to multiple db like redis and Mysql with use of single service

  • @hritikshinde296
    @hritikshinde296 Před rokem

    Hi bro i have one doubt if i want data based on two param i.e loginuser and id which method of redis template i should use

  • @shaileshkumar2806
    @shaileshkumar2806 Před 2 lety

    Good video lesson

  • @rupeshtiwari4480
    @rupeshtiwari4480 Před 2 lety +1

    Nice explanation ,I have one query over here How to club this with Mysql or Mongo database ,If key is not present in redis server , it should fetch from database ,Please make a video for it also

  • @kirtivardhan3801
    @kirtivardhan3801 Před rokem

    Nicely explained sir.
    It's so helpful...
    Kindly make springboot security tutorial.

    • @DailyCodeBuffer
      @DailyCodeBuffer  Před rokem

      Thanks 🙏🏻
      Spring security is available on the channel

  • @contactdi8426
    @contactdi8426 Před 7 měsíci

    Why did you add @EneableCaching in the configuration? Where are we using caching here at all in the project? I can't understand the purpose of that here. Please help me understand its use case here

  • @kirwakelvinkering3122
    @kirwakelvinkering3122 Před 10 měsíci

    Thanks a lot for this sir , I had to like , follow you on twitter and comment this comment 😂 , would you please let me know of the theme you are using ?

  • @RaviVerma-bg6ul
    @RaviVerma-bg6ul Před 2 lety

    good one, but how we deploy these things on production environment. like how to start redis on prod.

  • @FaisalKhan-iw6tw
    @FaisalKhan-iw6tw Před 3 lety

    What is the license of redis? Can I deploy this in production freely?

  • @rajeevkalangi2472
    @rajeevkalangi2472 Před 3 lety

    Bro.... But without all the config and all... Simply extending the CrudRepository is also working with Redis...

  • @sergioddh
    @sergioddh Před 2 lety

    How can I find by firstName, for example?

  • @turgenevslife9379
    @turgenevslife9379 Před 7 dny

    any ideas which pattern he used? it's impossible to understand to architecture

  • @shaunakahluwalia451
    @shaunakahluwalia451 Před rokem

    Can all these records be accessed from redis-cli?

  • @unboxian6917
    @unboxian6917 Před 3 lety

    How to set TTL in redis template...plz help

  • @loftkey
    @loftkey Před 3 lety

    Why use opsforhash over opsforvalue?

  • @Pranav-bt2dz
    @Pranav-bt2dz Před 3 lety

    How to manage connection pooling ?

  • @ishitazarkar9689
    @ishitazarkar9689 Před 9 měsíci +1

    Hi @DailyCodebuffer, thanks for creating this video, it is very helpful, can you also create the video to store data in DB and then in cache and for 1st time fetching form DB and storing in cache then next time fetching should happen from cache, also I am facing class cast exception in getByID API can you please help in this.

  • @sankettawhare1795
    @sankettawhare1795 Před 11 měsíci

    how to see json stored in redis after save method thorugh redis cli???

  • @manmitapatnaik2513
    @manmitapatnaik2513 Před 9 měsíci

    19:46 Why am i getting this error "Error creating bean with name "jedisconnectionfactory" defined in class path resource ..
    Have anyone faced this issue ? Please help .

  • @rahulkatlaparthi354
    @rahulkatlaparthi354 Před 2 lety

    How can I implement auto generated id column in redis using spring boot

  • @sathiskumarp
    @sathiskumarp Před rokem

    Thanks for the video.
    Since we are fetching the value from Redis in cache when the value would be stored in real DB?

    • @salmasultana8155
      @salmasultana8155 Před měsícem

      we will store in cache for frequent access. This will be small set of data. DB wise which is huge data remains intact

  • @rabindrasahu3610
    @rabindrasahu3610 Před 3 lety

    Thanks a lot Sir.

    • @DailyCodeBuffer
      @DailyCodeBuffer  Před 3 lety +1

      Happy to help. ❤

    • @rabindrasahu3610
      @rabindrasahu3610 Před 3 lety +1

      @@DailyCodeBuffer sir can you share the update method code please.

    • @rabindrasahu3610
      @rabindrasahu3610 Před 3 lety +1

      waiting for your response sir.(update method code in redis)

    • @DailyCodeBuffer
      @DailyCodeBuffer  Před 3 lety

      @@rabindrasahu3610 I have updated the code. You check checkthe updated repo.

    • @rabindrasahu3610
      @rabindrasahu3610 Před 3 lety +1

      @@DailyCodeBuffer Thank you very much sir.

  • @arjunponti1483
    @arjunponti1483 Před 3 lety

    Hii. After few requests get is not working. It is not showing any error but it is not invoking fingbyid method in serviceimpl

  • @shashankbhat797
    @shashankbhat797 Před 2 lety

    What about the database what we have already?

  • @ashwinvarma9349
    @ashwinvarma9349 Před rokem

    could you explain how to configure jedispool?

  • @loftkey
    @loftkey Před 3 lety

    Is there a way to do this without setting User to implement Serializable?

    • @loftkey
      @loftkey Před 3 lety

      I found a way by using gson to convert the object to a string.

  • @sanketh768
    @sanketh768 Před 3 lety +2

    in this project i think you used redis as a NOSQL database to store the data.
    Can we use it as a cache, using redistemplate?
    as far i know, w can use redis as a NOSQL DB, cache and message broker

    • @DailyCodeBuffer
      @DailyCodeBuffer  Před 3 lety

      Yes

    • @sanketh768
      @sanketh768 Před 3 lety +1

      @@DailyCodeBuffer can you make a video on this if possible?
      I mean to save java objects to redis cache?

  • @curiouspragyan1938
    @curiouspragyan1938 Před 3 lety

    How to implement redis connection pool logic

  • @RaghavSharma-nt3hr
    @RaghavSharma-nt3hr Před rokem

    Could you please create a tutorial on Spring Security and Session Management with Redis. And cover concepts like maxSessions and restrict logins after max sessions etc.

    • @contactdi8426
      @contactdi8426 Před 7 měsíci +1

      This would be a great project tutorial.. the actual use case scenario. @DailyCodeBuffer

  • @MountainMitch
    @MountainMitch Před 2 lety

    Great tutorial!
    When I tried to build this, an error occurred for this line
    JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory(redisStandaloneConfiguration);
    Error:
    java: cannot access redis.clients.jedis.JedisShardInfo
    class file for redis.clients.jedis.JedisShardInfo not found.
    I googled and found 2 suggestions:
    1) Run the latest version of spring-boot-starter-parent
    2) Add an for lettuce to the POM
    Did both of these things but still get the errors.
    Do you have any ideas?

  • @utkarshsharma5202
    @utkarshsharma5202 Před 7 měsíci

    You didn't start redis server. Is it not necessary?

  • @sportstube1414
    @sportstube1414 Před 3 lety

    Is redis support auto expired of data within 1 sec??

    • @DailyCodeBuffer
      @DailyCodeBuffer  Před 3 lety +1

      Yes, you can add the TTL value while storing the keys

  • @ijaz2020
    @ijaz2020 Před 3 lety

    what theme you are using in idea? looks nice.

  • @kenseifeitan4663
    @kenseifeitan4663 Před 2 lety

    Hello DCB
    I hope I can catch your attention
    Can you make Spring Caching it would be helpful
    Thank you so much

  • @tomchandler2356
    @tomchandler2356 Před 3 lety

    Which theme is this?

    • @DailyCodeBuffer
      @DailyCodeBuffer  Před 3 lety

      I don't remember it. I will have to find it again and will share

    • @DailyCodeBuffer
      @DailyCodeBuffer  Před 3 lety

      I have found this theme. It is "Visual Studio Code Dark Plus"

    • @tomchandler2356
      @tomchandler2356 Před 3 lety

      @@DailyCodeBuffer Perfect! Thanks a lot, appreciate it. :)

  • @RahulRaoGonda
    @RahulRaoGonda Před 3 lety

    Hello sir...What’s exactly the use case of redis... meaning can you give me a real world example?

    • @DailyCodeBuffer
      @DailyCodeBuffer  Před 3 lety +1

      We can use Redis as a NoSQL Database. Mostly it is used as a distributed cache

    • @RahulRaoGonda
      @RahulRaoGonda Před 3 lety

      Daily Code Buffer thanks

    • @gorantisridhar
      @gorantisridhar Před 3 lety +2

      Yeah looks like some how he missed.
      But to answer it from my knowledge :
      Spring Redis - basically is a Remote Directory Server and its more popular as in-memory data structure tool.
      Its basically driven by key/store data structure to persist the data.
      You can use this Redis like a Database or a Cache or If you want you can also use like a Message Broker.

  • @divineforever8691
    @divineforever8691 Před rokem

    only shabbir can make iron man learn backend xd

  • @user-yx4pb9gs5v
    @user-yx4pb9gs5v Před rokem

    thanks for this video, when i connect this on my local redis its working fine but when i try to connect aws elasticache redis endpoint then i got connection issue like
    org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
    at

  • @krishnachaitanyaappini564

    rt.setHashKeySerializer(new StringRedisSerializer());
    rt.setHashKeySerializer(new JdkSerializationRedisSerializer());
    why we set the properties two times ?

  • @hiteshmadgulkar3223
    @hiteshmadgulkar3223 Před 6 měsíci

    how to connect redis with username and password ?