Spring Data Redis in Spring Boot Example | Tech Primers

Поділитися
Вставка
  • Опубліковано 30 січ 2025

КОМЕНТАРІ •

  • @rahulvutukuri9254
    @rahulvutukuri9254 3 роки тому +1

    I apolozise, in the previous comment on redis vedio i asked for java implementation, got it here, good work. Thanks

  • @MrSuriyam
    @MrSuriyam 6 років тому +8

    thanks for taking the time to explain redis on springboot. Much appreciated.

  • @rituagrawal2218
    @rituagrawal2218 7 років тому +6

    Awesome video. Crisp and to the point

  • @karishmashaik2842
    @karishmashaik2842 3 роки тому

    Nice explanation . Thank you

  • @shivraj777
    @shivraj777 5 років тому +2

    Good one. This talks about just the Redis as standalone cache. How about making use of Redis along with database like MySQL? so all the CRUD operations will have one more element of adding/updating/deleting the actual data from database based on how Redis performs.

  • @sofoklisfountas8965
    @sofoklisfountas8965 7 років тому +3

    Great video! A very good example to get a first impressin on Spring, Redis and Rest combined at the right level of difficulty for me.
    A would like to see a similar example/examples with Spring Cloud Dataflow and Kafka or RabbitMQ.

  • @mauricepheyton1386
    @mauricepheyton1386 4 роки тому

    Correct me if I’m wrong, did you do the @Postmapping part inside the URL bar? Thanks. 👍

  • @rahulvutukuri9254
    @rahulvutukuri9254 3 роки тому

    could help to explain an example of a transaction in a distributed system using distributed Redis, ex: cart created, item added and when we add 2nd item we do not know, which replica of APP handle the 2nd scan and how can distributed cache help us

  • @phanimohan9943
    @phanimohan9943 5 років тому

    Thanks for this good demo. Helped me to kick start with Redis - Spring Boot

  • @benjamingreen1278
    @benjamingreen1278 3 роки тому

    Hi, is redis necesarily used with jpa? because the way data is stored/retrieved/deleted/updated seems alike as jpa. is it possible to use redis with other data action type(such as mybatis. jpa will be faster, so the choice will be jpa, but I wonder why redis is always used with jpa)?

  • @TheNikhil7
    @TheNikhil7 3 роки тому

    Great! Just have a question though, How you made connection to Redis running on some different port, How did Spring came to know about the same?

  • @Dizzy_Dizz
    @Dizzy_Dizz 3 роки тому

    Good indeed, Can you have a tutorial for microservcie session handling? perhaps using redis

  • @sagarsinha30
    @sagarsinha30 3 роки тому

    How to do a mass insertion in redis , I have a databse in MySql and i want it to add it to Redis Sever. Any method to do it so?

  • @rohitmanohar2733
    @rohitmanohar2733 4 роки тому

    very nice explantion, if possible can u provide information , if redis cache server is running on different remote server ,so how to use that ?

  • @codefarm0
    @codefarm0 5 років тому +1

    Very well explained.
    Thanks :)

  • @motikumar4511
    @motikumar4511 6 років тому +1

    Awesome video for beginners

  • @MisterViable
    @MisterViable 7 років тому +2

    An example of redis implemented along side of postgresql would be really helpful

    • @TechPrimers
      @TechPrimers  7 років тому

      sure michael, will do that soon

  • @seemamehra786
    @seemamehra786 4 роки тому

    Here you have stored data directly to redis what if we want to add to data to oracle db with that maintain cache in redis

  • @anisam123
    @anisam123 4 роки тому

    what is the difference between doing the crud operations in this way and doing crud operation using normal spring data jpa where model objects are annotated with RedisHash?

  • @sridharreddy5415
    @sridharreddy5415 6 років тому

    Hi,
    I implemented Spring redis and REDIS server I am running docker image, and port is mapped to local port.
    docker run -p 6379:6379 redis
    but when I run the application, I am getting the following error
    2019-01-28 18:58:22.285 ERROR 49588 --- [nio-8081-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is 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] with root cause

  • @tushargoel5522
    @tushargoel5522 5 років тому +3

    Thanks for the video.. I have doubt... You have mentioned that Redis doesn't provide any repository interface.. Why not used CrudRepository?

  • @akhilt9577
    @akhilt9577 4 роки тому +1

    bro, you're awesome. thank you soo much for your efforts. Appreciate it 💙💙💙

  • @anmolmore6074
    @anmolmore6074 5 років тому +1

    Nice explanation.
    Just one question, can I create the beans of 'JedisConnectionFactory' and 'RedisTemplate()' in a configuration class file.
    I mean, if i will create a class called 'JedisConfiguration' and apply '@Configuration' annotation there and declare all my Beans in there ?
    Will it be a good choice ?

  • @psterdale
    @psterdale 5 років тому +1

    Good comprehensive tutorial... Thank you...

  • @sudhanshugupta2511
    @sudhanshugupta2511 5 років тому

    Can we connect to the aws elastic cache (redis) locally ?

  • @amarreddy09
    @amarreddy09 6 років тому +1

    Can u post video on authentication & Authorization with redis for multiple services. Thanks

  • @navneethsubramanya.8465
    @navneethsubramanya.8465 4 роки тому

    Hi Tech Primers,
    wonderful video, thoroughly enjoyed it.
    i have a question though, this is using spring data redis to store in memory database, but what if i want to use JPA along with this?
    such that when a request is made it should first search in the redis cache, if not found then hit the persistence ?

  • @hasanenesdogan1243
    @hasanenesdogan1243 4 роки тому

    Thank you so much for this tutorial it was very helpful. Can you do a tutorial about user registration with redis?

  • @ajaydhiman2368
    @ajaydhiman2368 3 роки тому

    I notice you didn't use @Autowired in Controller and in Impl class but still this example run - how ?

  • @夏凡-i9t
    @夏凡-i9t 7 років тому

    Can I lock the key? Like when I am query or handle some certain key's value, this key can not be reached by another operation. So basically can i add a lock on the key but not the whole redis process. If can how do you do it then?

  • @souvikdas226
    @souvikdas226 4 роки тому

    i am able to post data using the code , but while fetching all values from redis using the key "USER" its not showing any data , but get "rest/user/all" is working fine .. any idea ?
    127.0.0.1:6379> KEYS *
    1) "\xac\xed\x00\x05t\x00\x04USER"
    127.0.0.1:6379> HGETALL USER
    (empty array)

  • @mitali_bhokare
    @mitali_bhokare 4 роки тому

    Is there an example explaining Redis using the Lettuce client?

  • @fareezjasmi6893
    @fareezjasmi6893 5 років тому

    Thankyou for the very insightful tutorial !

  • @durgeshkumar9790
    @durgeshkumar9790 4 роки тому +1

    It's helpful video thanks u so much sir

  • @suryakantamahanty9990
    @suryakantamahanty9990 6 років тому +1

    can you tell how to see these inserted values in redis command line interface ??

    • @TheKNdheeraj0
      @TheKNdheeraj0 6 років тому

      Use keys * command to know all the keys in the redis and the key would look weird, because generally Jedis makes the key of hash type so copy that key and type HGETALL it will display all the java objects of hash type

  • @abdulsattarshaikh9758
    @abdulsattarshaikh9758 6 років тому +1

    nice and very helpful video

  • @dheerajscorefitness6981
    @dheerajscorefitness6981 3 роки тому

    How did it connect to reddis, you have not provided any connection in application.properties to your local reddis, can someone please explain this, how the connection happened to reddis, we generally provide connection in case of MySQL through application.properties but in this case it didn't happen, please help.

  • @loftkey
    @loftkey 4 роки тому

    Why use opsforhash over opsforvalue?

  • @mansisaraswat857
    @mansisaraswat857 3 роки тому

    Great video..

  • @amrendrasingh8641
    @amrendrasingh8641 7 років тому +1

    Hi Ajay,
    Thanks for Great Video.
    How can I use redis as a distributed cache?

  • @jnsridhar
    @jnsridhar 3 роки тому

    how to inject redisTemplate by only using the application.properties ??

  • @jasongufeng
    @jasongufeng 6 років тому +1

    Great video!

  • @rudrascorpio
    @rudrascorpio 6 років тому

    How do i set expiry / or time to live for User objects while saving ?

  • @indiautube4915
    @indiautube4915 6 років тому

    Thanks for the Tutorial. Suppose we have a portal with Shopping Cart. Guest users, without login, can add products to their Shopping Cart. If we save the user's shopping cart to Redis, how to differentiate which Cart belongs to which user. Is there a way this can be done with JSESSIONID or something similar?

  • @pratikool1
    @pratikool1 4 роки тому

    Please add videos for redis sentinel mode with lettuce client

  • @chandrakishore3143
    @chandrakishore3143 5 років тому

    Thanks very nice explanation

  • @lh6845
    @lh6845 4 роки тому

    How to set TTL here?

  • @amarreddy09
    @amarreddy09 6 років тому

    How to store data from zuul filter to redis. Thanks

  • @1414Akash
    @1414Akash 4 роки тому

    For every repository we need to create RedisTemplate? Like in your case you had only user repository so you created RedisTemplate

  • @panduseru6107
    @panduseru6107 7 років тому

    you have any example how to store jwt token into Redis cache

  • @lagvales
    @lagvales 6 років тому +1

    You helped me a lot!

  • @TheWizInterviews
    @TheWizInterviews 3 роки тому

    Thanks for the wonderful video. A crisp and clear introduction to the topic. Just what I needed before starting off on a new project. One suggestion .. can you please crop off a few seconds of the coughing sound in the video. It is a simple task on the UA-cam studio.

  • @smithalder2778
    @smithalder2778 5 років тому

    Thank you for the tutorial but if i want to do a post call how to do that

  • @R.fit_b
    @R.fit_b 4 роки тому

    jedis pool config is required how to manage it?

  • @NarendraPrasanth
    @NarendraPrasanth 6 років тому +1

    How to see the results in redis server

  • @dileepalla6769
    @dileepalla6769 7 років тому +2

    Can u Post an example on junit how to write junit test case for controller

  • @balrajmys
    @balrajmys 7 років тому

    Awesome bro :) I really liked this video.. Very Informative.. Thanks :)

  • @vaib5917
    @vaib5917 6 років тому

    Can you please make a video on Redis Pub-Sub using Spring Boot? Thanks in advance

  • @bhargavasurimenu7850
    @bhargavasurimenu7850 5 років тому

    Did I miss the Redis Configuraiton in Spring boot Application ?, I saw you created JedisConnectionFactory and assigned to RedisTemplate.

  • @prasaddharmadhikari1126
    @prasaddharmadhikari1126 4 роки тому

    Please make a video on spring boot with jwt authentication using redis

  • @surendirababujanarthanan761
    @surendirababujanarthanan761 7 років тому +1

    Can we configure the cache size and the cache time limit to invalidate the cache without restarting the redis server similar to how we configure using ehcache provider?

    • @TechPrimers
      @TechPrimers  7 років тому

      Yes, you can do both without restarting the Redis server

  • @praneethsai27
    @praneethsai27 5 років тому +2

    Thanks it was quite helpful.Is there a way i could use findByIdAndnameNot in Springdata redis?

    • @seixao
      @seixao 4 роки тому

      great question!

  • @sumitkapoor1206
    @sumitkapoor1206 6 років тому

    why did'nt you use @cacheable?

  • @MadMax-lw7er
    @MadMax-lw7er 6 років тому +1

    very helpful tutorial

  • @AmongManyWays
    @AmongManyWays 6 років тому

    Why did not we autowired the redisTemplate in Repository ?

  • @dnr2361
    @dnr2361 5 років тому

    Hi bro can u tell me how to invalidate the session.... In redis...

  • @java3711
    @java3711 5 років тому

    could you please show us.How to deploy this example on PCF cloud

    • @TechPrimers
      @TechPrimers  5 років тому

      you can check other videos on PCF. I have done them.

  • @BigBigLeo
    @BigBigLeo 4 роки тому

    thanks for your job, bro)

  • @orenazuz
    @orenazuz 7 років тому

    a very good tutorial I was wondering how to implement redis with mongodb if you have any idea it will be great thanks

  • @nitinsridhar7555
    @nitinsridhar7555 6 років тому +1

    Awesome Dude

    • @nitinsridhar7555
      @nitinsridhar7555 6 років тому

      2018-12-29 13:55:39.459 INFO 4652 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
      2018-12-29 13:55:39.591 INFO 4652 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
      2018-12-29 13:55:39.621 INFO 4652 --- [ restartedMain] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.repository.ArticleRepository.
      2018-12-29 13:55:39.625 INFO 4652 --- [ restartedMain] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.repository.CategoryRepository.
      2018-12-29 13:55:39.626 INFO 4652 --- [ restartedMain] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.repository.UserAddressRepository.
      2018-12-29 13:55:39.627 INFO 4652 --- [ restartedMain] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.repository.UserRepository.

    • @nitinsridhar7555
      @nitinsridhar7555 6 років тому

      As I mentioned Please guide me how to resolve this

  • @ratjagapakhi1
    @ratjagapakhi1 5 років тому

    Dont we need to start redish server separately or it is embedded ?

  • @ruchitajain4165
    @ruchitajain4165 7 років тому

    @Ajay very informative video. I have got one doubt from where the data is coming i.e. from where are you reading the Name, Id ("1, Peter" , "2, Ryan") and storing it further in Redis. i ts kind of a silly question but if you can guide me here. TIA

    • @TechPrimers
      @TechPrimers  7 років тому

      hi ruchita, the values are created via REST endpoints (/rest/user/update)

  • @gobinathjeganathan7902
    @gobinathjeganathan7902 7 років тому +1

    Super video bro😀...

    • @TechPrimers
      @TechPrimers  7 років тому

      my pleasure gobi

    • @gobinathjeganathan7902
      @gobinathjeganathan7902 7 років тому

      Tech Primers can we use redis as a normal database

    • @TechPrimers
      @TechPrimers  7 років тому

      +gobi nath yes you can. But you wont have great SQL client lile tools for querying redis

    • @gobinathjeganathan7902
      @gobinathjeganathan7902 7 років тому

      Tech Primers ok... Thank you very much

  • @PrakashKumar-wv9yi
    @PrakashKumar-wv9yi 5 років тому

    Is it same for redis search also ?

    • @TechPrimers
      @TechPrimers  5 років тому

      what is same? I did not get your question prakash

  • @matianze7090
    @matianze7090 3 роки тому +1

    Thanks.

  • @arvindgupta-zm7lz
    @arvindgupta-zm7lz 5 років тому

    please make videos on spring boot

  • @pan1490
    @pan1490 5 років тому

    Can anyone have any information on redis pipeline in spring boot?

  • @NiftyNavigatorPro
    @NiftyNavigatorPro 4 роки тому

    Hello one more examples with MySQL database using with redis how to implement MySQL and hibernate...

  • @PraveenKumar-lp6il
    @PraveenKumar-lp6il 5 років тому

    thank you... it is working fine. i did it..

  • @bathulanagendra4621
    @bathulanagendra4621 7 років тому

    Hi Peter,
    i am getting the output like {"2":{"id":"2","name":"surya","salary":20000},"1":{"id":"1","name":"nagendra","salary":20000}}.
    where im doing mistake.Suggest me to get output like your example.

  • @huanglu1691
    @huanglu1691 7 років тому

    Thank you so much for sharing. It is great!

    • @TechPrimers
      @TechPrimers  7 років тому

      My pleasure Jakson. Glad that was useful

    • @huanglu1691
      @huanglu1691 7 років тому

      It does. Thank you.

  • @overview1662
    @overview1662 6 років тому

    Hi Team,
    Can you please share sample code of how to use using Mysql and Redis as a secondary cache integration with HashOps using Spring Boot?
    It will be helpful for many students.

    • @overview1662
      @overview1662 6 років тому

      I have done the same, check the below code:
      public Article findArtilcleById(String articleId) throws IOException {
      Optional id = Optional.of((Long) (Long.valueOf(String.valueOf(articleId))));
      try{
      //To check if data is in cache or not
      if(!hashOperations.hasKey(key, articleId)) {
      logger.info("Yes Data is not in the cache, add it in the cache now.");
      //Getting data from database
      Article a = articleRepository.findById(id);
      //Storing data from database to cache
      hashOperations.put(key, String.valueOf(a.getId()), a);
      return a;
      }
      }catch (Exception e){
      System.out.println(" "+e.getMessage());
      }
      // Returning data from cahce if data is in the cache.
      Article article = gson.fromJson(String.valueOf(hashOperations.get(key, articleId)), Article.class);
      logger.info(("Getting it from cache"));
      return article;
      }

    • @proxy5061
      @proxy5061 2 роки тому

      Simple annotations are dere , easy

  • @aleksei4604
    @aleksei4604 5 років тому

    Thanks. Exect this is nessary for interview.

  • @Po4kaKita
    @Po4kaKita 4 роки тому +1

    Thx!

  • @joepoor5327
    @joepoor5327 5 років тому +2

    ty

  • @shubhambisht3090
    @shubhambisht3090 4 роки тому

    hi getting this exception
    Caused by: java.lang.ClassNotFoundException: redis.clients.jedis.JedisPoolConfig

  • @karankanojiya7672
    @karankanojiya7672 3 роки тому +1

    Respect ++ !

  • @mr_shamanth_m
    @mr_shamanth_m 5 років тому

    Hi, i am really liking your Tech Videos, thanks a lot for the videos :) could you help me with Distributed Cache please, i am not getting references for this. One server with multiple clients accessing same cache, clients may be on same server or different server.

  • @naregbar190
    @naregbar190 5 років тому

    Why didn't you use @RedisHash ?

    • @TechPrimers
      @TechPrimers  5 років тому +1

      @RedisHash was introduced post Spring data redis 1.7

  • @fairozahmed7113
    @fairozahmed7113 7 років тому +1

    Cool

  • @ray5843
    @ray5843 6 років тому

    Spring Data Redis in Spring Boot Example | Tech Primers

  • @ゾカリクゾ
    @ゾカリクゾ 4 роки тому

    "sping" boot in thumbnail

  • @akhileshguptaakhi
    @akhileshguptaakhi 4 роки тому

    Connecting with host and password:
    @Bean
    JedisConnectionFactory jedisConnectionFactory() {
    RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration("192.168.1.51",
    6379);
    redisStandaloneConfiguration.setPassword(RedisPassword.of("yourRedisPasswordIfAny"));
    return new JedisConnectionFactory(redisStandaloneConfiguration);
    }

  • @techperson2312
    @techperson2312 5 років тому

    for beginners its really hard to understand

  • @proxy5061
    @proxy5061 2 роки тому

    bro hy , redis wtf

  • @muhammadahmedshaikh9531
    @muhammadahmedshaikh9531 3 роки тому

    How can i use hateoas and HAL in this project