Spring Boot | Spring Data Redis as Cache | @Cacheable | @CacheEvict | @CachePut | JavaTechie

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 136

  • @swagatrath2256
    @swagatrath2256 4 месяца назад +2

    I have a little bit of confusion here..
    The DB being used is Redis and caching is being done at the application level.. which also is using Redis?
    How do you configure which cache mechanism to be used then?

  • @harshitgupta2872
    @harshitgupta2872 2 года назад +4

    Sir, where is the primary data database to store data in redis , you didn't connect to any data base (such as MongoDb) as primary database so that we use Redis as Cache

  • @satyabatigoswami1735
    @satyabatigoswami1735 8 месяцев назад +1

    Learnt so much from your videos. You are very good teacher and a very good person!! Thanks a lot🙏

  • @user-wc4zn7ew7t
    @user-wc4zn7ew7t 2 года назад +5

    Thanks you @java techie, Your videos are very helpful for me. It made me learn Redis Basic in just few hours with example. thanks again appreciatable approach. 👍👌

  • @NiteshSingh-tt8ex
    @NiteshSingh-tt8ex 22 дня назад

    Perfect explanation, I visit your tutorial for quick revision of concepts . Thank you!

  • @ihabson
    @ihabson Год назад +6

    Thank you for the video. I’m a newbie when it comes to cache, so is it possible to give more information about it. Like where is the data stored ? I guess it’s in the RAM but which one ? And what happens if the data changes in the mean time ? Does it mean that applications can possibly get an obsolete « snapshot » of the database because of caching ? Is that where the TTL comes handy ? Or is the « record » deleted from the cache if it changes ? Thank you very much

    • @deeplife9654
      @deeplife9654 6 месяцев назад

      Lolz. His video tutorials are for medium skilled developers to go to Advanced level

  • @zuberdiwan8123
    @zuberdiwan8123 Год назад +1

    Very Nice Tutorial sir...Very Well Explained...Thank You

  • @hrajiv29
    @hrajiv29 2 года назад +1

    Thanks for providing such a nice explanatory videos

  • @mahmoudodeh3534
    @mahmoudodeh3534 3 года назад +4

    Thank you for being teacher

  • @aidataverse
    @aidataverse 3 года назад +1

    very much useful appreciate your effort

  • @sanketr6256
    @sanketr6256 Год назад +1

    very nice video and thanks for the content Basant

  • @vivian1154
    @vivian1154 Год назад +1

    Redis serves a cache purpose primarily here already I believe. the cacheable annotation is to make the method cacheable by conditions to Java in memory. Is my understanding correct?

  • @gopisambasivarao5282
    @gopisambasivarao5282 Год назад +1

    Appreciate your efforts Basant. God Bless you.😊🙏

  • @govardhanmopada1235
    @govardhanmopada1235 3 года назад +4

    Thank you for your videos...
    I learnt more from your videos.
    Very good explanation ❤️👌

  • @satyabratasahoo967
    @satyabratasahoo967 3 года назад +2

    Thank you Basant bhai, can you please explain more on the master slave implementation of redis?

  • @balamurali5127
    @balamurali5127 3 года назад +1

    I am getting error as Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

    • @A2ZZ555
      @A2ZZ555 2 года назад

      Bro resolve hua error apka

  • @fuadgafarov
    @fuadgafarov 2 года назад +2

    Thanks, it will help in my career a lot. Great job. Keep going please.

  • @r.kgupta2561
    @r.kgupta2561 Год назад +1

    Hi Sir , I watched this video its great explanation, but i was looking for Something like Read Through ,Write Through and Asynchronous Caching, if there is some video or blogs can you please suggest me

  • @sasi2182
    @sasi2182 3 года назад +2

    Where the cache data will be stored ...I think it’s in memory db... not stored in redis DB.....what if I have millions of records... will it stored in application itself??

    • @Javatechie
      @Javatechie  3 года назад +1

      No it won't store in application .
      Always it store in in memory cache

    • @sasi2182
      @sasi2182 3 года назад

      @@Javatechie no Basant it's storing in local only ,,,try with by up another instance of same application... Then if you hit request then it's going and hitting database

    • @phoneix24886
      @phoneix24886 3 года назад

      @@sasi2182 Hi sasi, so when we use @Cacheable it is storing data in memory of the application right?

    • @phoneix24886
      @phoneix24886 3 года назад

      @@sasi2182 My doubt just got clarified thanks to this gentleman - ruclips.net/video/1iLy8m33FV8/видео.html

  • @sudhirkk007
    @sudhirkk007 2 года назад +1

    You explained every thing very well, But I can' see you redis connection details ?

    • @Javatechie
      @Javatechie  2 года назад

      Buddy connection info mentioned in config class please check

  • @jewelchowdhury9752
    @jewelchowdhury9752 3 года назад +1

    First of all, thank you very much, sir. I have a question. I want to build a micro-service based e-commerce web application. suppose, I have some services, like customer service, product service(only contain Title and description and the image & price fetches IMG & price from another IMG service & price service), order service, and cart service. In my product service, It is possible when I have static data. and I have tried it. But my question is how can I add a new product record (with all fields) from the admin service(admin panel) into the multiple services like IMG service, product service(Title and description), price service? Please make a video on how to add records into multiple services at a time?

    • @Javatechie
      @Javatechie  3 года назад +1

      Yes we can share same data accros multiple service through Rest API call
      You can check my microservice first video from microservice playlist .you will get clarity on that

    • @jewelchowdhury9752
      @jewelchowdhury9752 3 года назад

      @@Javatechie thank you sir

  • @abhireddy8164
    @abhireddy8164 4 года назад +1

    Sir please do one video on how to establish a communication betweem two microservices by using message queues with one example..i.e.one microservice pass some data to another microservice to process it..like order microservice sends data to payments microservice..

    • @Javatechie
      @Javatechie  4 года назад

      Already covered this so You could check my spring cloud stream or Kafka producer & Consumer video .

  • @trilochanpanda8165
    @trilochanpanda8165 3 года назад

    Could you plz explain this cache mechanism with jwt token, aslo with spring security, login and logout.

  • @kks___
    @kks___ 4 года назад +2

    Sir first of all Thank you so much for your All Video 🙏
    Sir a request to you please make a video on jwt token blacklisting before expires and refresh token please please it’s my humble request .

    • @Javatechie
      @Javatechie  4 года назад +4

      Okay sure I will try this

  • @rexsam3134
    @rexsam3134 Год назад

    Initial 3 minutes were there in other video and need not be repeated here. @Cachable is added only in fetch records.

  • @manishdadheech8440
    @manishdadheech8440 3 года назад +2

    I have small doubt Basant... here you are just configured Redis template in Redis configuration file then using cachable to cache product .. Here how spring comes to know that it needs to use Redis DB to cache data. Normally we need to implement spring interface Cache and CacheManager Then how it is working internally.

    • @Javatechie
      @Javatechie  3 года назад

      Because already we are using ResdisHasOps in our dao. Class and there we are persisting data into reddis server .

  • @bhavanisankar71
    @bhavanisankar71 Год назад

    Sir i applied cache for findAll() that time updated data not getting means after retrieving all data update and delete data not updating to findAll() getting previous data only how can i improve this problem

  • @sandesh4063
    @sandesh4063 3 года назад

    Nice video, one more thing I would like to know that how can we set expiry date to to cache, and how can we clear all keys from cache without deleting records from database?
    Thanks in advanced 🙏

  • @PriteshBhate
    @PriteshBhate 3 года назад +1

    very helpful. Sir, what parameters we passed in @Cacheable . key is understood but doesn't understand value parameter. Can you please explain .

    • @Javatechie
      @Javatechie  3 года назад

      You can pass conditional parameter in value

  • @pushpamitdon
    @pushpamitdon 3 года назад +1

    Informative video but I've a query. What is the difference between caching using @Cacheable and caching via RedisTemplate. Are these records not available in Redis DB if we cache via @Cacheable?

  • @KrishnaReddy-qb2jm
    @KrishnaReddy-qb2jm 3 года назад +1

    when you say get data from db? is it redis client or some sql db? because i see productdao getting data from redis. @Cacheable caches local memory?

    • @phoneix24886
      @phoneix24886 3 года назад

      I actually have the same question not clear here

  • @vinodkumarreddy7696
    @vinodkumarreddy7696 3 года назад +1

    Thanks for the video.. Can we see cache data? and we can store it in a memory I mean local disk?

  • @kvnagendra5354
    @kvnagendra5354 2 года назад +1

    Sir when we have devtool dependency in pom.
    And when we call findbyid there its throwing classcast exception..

    • @Javatechie
      @Javatechie  2 года назад

      findById now returning Optional please check it properly

  • @MrRnl2004
    @MrRnl2004 2 года назад

    Thanks for this helpful tutorial. Can you have a tutorial how to setup your local redis? Thanks

  • @manirsg9641
    @manirsg9641 4 года назад +1

    I am wondering that, how this caching working without redis instance? We can use redis docker image for this work

    • @Javatechie
      @Javatechie  4 года назад +1

      Yes already I up my redis server , please checkout my previous tutorial.
      In config I provided host and port of reddis instance and up it .

  • @techappleteja8564
    @techappleteja8564 4 года назад

    it would be nice if show demonstrate "Product" hash with Relationships

  • @nareshch6454
    @nareshch6454 8 месяцев назад

    simple and great videos!

  • @divyamahesh9032
    @divyamahesh9032 8 месяцев назад

    Hi basant
    I watched both the videos redis as db and redis as cache.In redis as cache video you are using redis as both db and cache . And also if we want we can replace db with any other one eg:oracle etc...
    Am i right???

  • @sudhirkk007
    @sudhirkk007 2 года назад

    same code I trying with Azure redis its not working , getting jedis connection exception

  • @amansinha3629
    @amansinha3629 Год назад +1

    How to specify key in the cacheable method if the method has no parameter?

  • @ranjan098
    @ranjan098 8 месяцев назад +2

    Hi Basant bhai, Great tutorial !!! . is it possible to use Database as some other database but not Redis DB, and use Redis Cache to communicate between db and cache ?

    • @Javatechie
      @Javatechie  7 месяцев назад

      Yes it's possible but I need to check about configuration

    • @midhunma8875
      @midhunma8875 5 месяцев назад

      Hi Please let me know if you found any useful tutorials in this

  • @shubhamkale5003
    @shubhamkale5003 2 года назад

    Very good video Sir

  • @sathiskumarp
    @sathiskumarp 2 года назад +1

    Thanks for the video. I have an order service and payment service, based on the payment service response I have to commit the value to DB. So whether it is possible to maintain the update operation in cache as an intermediate and once the payment is confirmed we can commit to actual DB.

    • @Javatechie
      @Javatechie  2 года назад

      No Satish cache will work behind the db. So if you update on db then it will reflect on cache not reverse

    • @sathiskumarp
      @sathiskumarp 2 года назад

      @@Javatechie Thanks for your response

    • @SP-yh5op
      @SP-yh5op Год назад

      Thanks for your making concepts easier. @Java Techie
      Is it good idea to have 1 utility micro service for Radis caching or having in all 10+ persist micro services configured with redis interactions. We have like 100+ micro services with Kafka streaming.

  • @saurabhmarpadge7498
    @saurabhmarpadge7498 4 года назад +1

    Nice video sir.
    Sir can you make a video on how to apply sharding in InMemory DB if it is possible .

    • @Javatechie
      @Javatechie  4 года назад +1

      Okay I will check this

  • @arunprasadvs3452
    @arunprasadvs3452 Год назад

    1.How is it implemented in application
    2.What functionalities in application utilizes caching
    3.How do you identify that a method uses caching from code
    kindly reply me

  • @mallikarjun-shurpali9698
    @mallikarjun-shurpali9698 Год назад +1

    Thanks sir...

  • @mobinshah1
    @mobinshah1 3 года назад +1

    You are the best. No doubt

  • @veerraju8445
    @veerraju8445 3 месяца назад

    What is the type of cache used here,is it read through cache?

  • @CaponordRevHappy
    @CaponordRevHappy 3 года назад +1

    Nice one! very helpful.

  • @pamuletip5054
    @pamuletip5054 3 года назад +1

    What is the maven dependencies that we have to keep for redis??

    • @Javatechie
      @Javatechie  3 года назад +1

      Go to video description and checkout my GitHub link

  • @k.i.m.5506
    @k.i.m.5506 2 года назад

    Hi friend, thanks for another great tutorial. One quick question -- how do you set up TTL with this solution?

  • @sadigepawan4710
    @sadigepawan4710 4 года назад +1

    Hi basant could you please do video on file operations and kafka streams ??

    • @Javatechie
      @Javatechie  4 года назад +1

      Could you please check out my spring cloud playlist

  • @imshaggy619
    @imshaggy619 Год назад +1

    How can I store the cached data into any file and get the data from that file when required in code

    • @Javatechie
      @Javatechie  Год назад

      Then why do you need cache?

    • @imshaggy619
      @imshaggy619 Год назад

      @@Javatechie it's a large number of values , big table. So what will be the easier approach to get those as needed without a DB hit everytime.
      Like a lookup service for the cache - lookup.getValue(key)

  •  2 года назад

    Excellent.. but how compiler knows that you are using redis by annotation only??

  • @nikp7743
    @nikp7743 Год назад +1

    Прикольно что индусы даже не стараются говорить без акцента)

  • @udaysurse5438
    @udaysurse5438 4 года назад +1

    Nice

  • @gauravk002
    @gauravk002 2 года назад +1

    Again an excellent video from Java Techie..

  • @aneckumar5701
    @aneckumar5701 3 года назад +1

    hello sir, how can i clear redis cache on booting the project , if not how can I clear cache manually?

  • @ankushmane2336
    @ankushmane2336 Год назад

    Hi @Java Techie,
    I watch this video and used the same on my system but the @Cacheable and @CacheEvict functionality does not work for me.
    get records not cached into the cache.
    could you please help me?

    • @Javatechie
      @Javatechie  Год назад

      It shouldn't be behaved like this.let me cross check and update you

  • @RootAccess
    @RootAccess 2 года назад +1

    What will happen if I have multiple instances of application running?

    • @Javatechie
      @Javatechie  2 года назад

      Your request will always landed to a single instance

    • @RootAccess
      @RootAccess 2 года назад

      @@Javatechie consider I have two instances running both instances cached value for key 1 then instance 1 receive delete request after that instance 2 receive get request what will i get then will instance 2 check database?

  • @Entertainment_Zone2522
    @Entertainment_Zone2522 2 года назад

    How can MySQL update data in real time in redis cache?

  • @arunpatel1619
    @arunpatel1619 2 года назад

    Create video on handling shared cache in spring boot microservices

  • @gajendrathakur4833
    @gajendrathakur4833 3 года назад +1

    Thanks Sir

  • @simashpokharel6044
    @simashpokharel6044 2 года назад

    Can you make a video on Spring boot + memcached ?

  • @yashrao7236
    @yashrao7236 3 года назад +1

    Sir, is it possible to configure different Time To Live values for different cache values(endpoints)?

  • @HoangDuyong-zl4jk
    @HoangDuyong-zl4jk 8 месяцев назад

    could you please teach me how to insert data to database and redis

  • @Harish.D-f1l
    @Harish.D-f1l Год назад

    I am Getting Exception,
    org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection;

  • @yashpatel-qg3ic
    @yashpatel-qg3ic 2 года назад

    hello @java techie , can you tell me how to do update method. I want to implement in my college project. so can you help me on this. Thankyou in advanced. If you help me in that it will be the great.

    • @yashpatel-qg3ic
      @yashpatel-qg3ic 2 года назад

      i have searched like template.opsForHash(). (for update) I didnt find anything on that, If you help me, It will be the great. atleast which method should i use for update please.

    • @yashpatel-qg3ic
      @yashpatel-qg3ic 2 года назад

      can you confirm it, it will be the same as create please.

  • @sovansingh7937
    @sovansingh7937 4 года назад +1

    sir make a video on spring-security saml

  • @abhishekpatidar9903
    @abhishekpatidar9903 3 года назад +1

    Can i use database as mysql and redis for caching, if yes then how?

  • @jdbcspring6804
    @jdbcspring6804 3 года назад

    hello, i have a question, when we cache every operation or any operation that we want what if there's changes happened in the database "update statment" in this case the data will fetch from the redis and they will took the oldest one "before the update ", can you please clarify about this ?

    • @TheLeony2
      @TheLeony2 3 года назад

      yes, but you can use @CachePut to synchronize date with cache

    • @WajidAli-wk8je
      @WajidAli-wk8je 3 года назад +1

      @@TheLeony2 Can you please give an example, I am trying but it does not update the list in the cache. I mean It is not updating the cache entry, after I call getall(I have cached previously) has same value as before.

  • @Saravanan-lj9so
    @Saravanan-lj9so 4 года назад +1

    This code is not working for me ..Getting a connection refused. Any one tried?

    • @Javatechie
      @Javatechie  4 года назад +1

      You need to start your redis server , I already started but missed to mention while recording video .

    • @Saravanan-lj9so
      @Saravanan-lj9so 4 года назад +1

      @@Javatechie Thanks.I will try

  • @akaghachinaka5852
    @akaghachinaka5852 3 года назад +1

    excellent! thanks.

  • @gursimransinghbhatiaa6131
    @gursimransinghbhatiaa6131 3 года назад

    Can @cachaeble be used even in non-spring classes?

  • @curiouspragyan1938
    @curiouspragyan1938 3 года назад

    How to implement redix connection pool logic

  • @rajeshg3570
    @rajeshg3570 3 года назад

    Nice video but I don't see any reference to Redid here .. Did I miss anything ??

  • @Dedeepya9
    @Dedeepya9 4 года назад +1

    Thanks 👍

  • @himanshanawarathna5931
    @himanshanawarathna5931 Год назад +1

    Thank you !

  • @2RAJ21
    @2RAJ21 3 месяца назад

    Thank you

  • @vijayjumbad6074
    @vijayjumbad6074 3 месяца назад

    But where you config redis cache?

  • @johnvick8861
    @johnvick8861 Год назад

    Is there any course you provide

  • @phoneix24886
    @phoneix24886 3 года назад

    I don't understand something. If Redis is itself a cache, and we are saving to redis, why use @Cacheable?

    • @phoneix24886
      @phoneix24886 3 года назад

      Nevermin, use this link to get clarified - ruclips.net/video/1iLy8m33FV8/видео.html

  • @sudhirgaurav8587
    @sudhirgaurav8587 3 дня назад

    looks video is incomplete

  • @TheTulunka
    @TheTulunka 2 года назад +1

    i love you, java techie

  • @devang007
    @devang007 3 года назад +1

    Great video!!

  • @hamzabouzidi2944
    @hamzabouzidi2944 2 года назад

    we say the value not the balue :)

  • @othetai6297
    @othetai6297 4 года назад +1

    video good :))

  • @arjunponti1483
    @arjunponti1483 3 года назад

    Hi

  • @hamzabouzidi2944
    @hamzabouzidi2944 2 года назад

    bro please learn to speak english we say cache not kece