Spring Data JPA | Query Hints | Optimize Database Performance | Hands-On Guide

Поділитися
Вставка
  • Опубліковано 15 гру 2024

КОМЕНТАРІ • 54

  • @MohamedKaanoun
    @MohamedKaanoun 2 дні тому +12

    Bro deserves 100M subscribers

    • @Javatechie
      @Javatechie  2 дні тому +8

      I don't know the true buddy whether i could reach even 1M or not however This word is enough for me to boost 🥰

    • @reshmasoni7671
      @reshmasoni7671 День тому +1

      I think gold button from UA-cam ❤❤❤

    • @richardvincent3979
      @richardvincent3979 День тому +2

      Not 100M please, 1Billion. Your information are always relevant. Thank you for consistently delivering value. You are the best

    • @Javatechie
      @Javatechie  День тому +2

      Thank you Richa for your good wishes 🥰. Keep learning 😊

    • @subhbirajdar
      @subhbirajdar День тому +2

      Interesting video for db performance

  • @skaftab3954
    @skaftab3954 16 годин тому +1

    Bro these are premium stuff. I am surprised by the number of subscribers.

  • @goodcourseavailable
    @goodcourseavailable 2 дні тому +4

    Amazing tutor on UA-cam..
    1M subscribers soon 🎉

    • @Javatechie
      @Javatechie  2 дні тому

      Thank you so much buddy for your kind words 😊. Keep learning 😊

  • @ravindrakushwahakrishna
    @ravindrakushwahakrishna 2 дні тому +3

    Thanks sir for everything

  • @KenanSevinmedik-u5f
    @KenanSevinmedik-u5f 2 дні тому +1

    Thank you brother. I love Java Techie!

  • @anandnigade5886
    @anandnigade5886 2 дні тому +1

    I was also searching for the same. Thank you so much 🎉

  • @Rakeshcp-g7w
    @Rakeshcp-g7w 2 дні тому +1

    Thanks for sharing 👍

  • @GKK31
    @GKK31 2 дні тому +1

    Thanks for sharing

  • @erbharat2022
    @erbharat2022 2 дні тому +1

    Thank you 🙏🏻

  • @VikashRai_07
    @VikashRai_07 2 дні тому +1

    Thanks! 🙂

  • @vikrambaliga7241
    @vikrambaliga7241 2 дні тому +4

    How long does the value stay in cache,also why did time out if time out was set to 2000, when the response 1029

    • @tubemekala
      @tubemekala 2 дні тому

      I also have same question why did time out if time out was set to 2000, when the response 1029?

    • @Javatechie
      @Javatechie  2 дні тому +1

      Guys, that's exactly what I mentioned. The response time may vary. For example, the first time I tried, it took over 2000 ms. However, after a restart, it took only 1029 ms on the second attempt. If you restart and retry again, the response time could exceed 2000 ms or drop below 1029 ms

    • @Javatechie
      @Javatechie  2 дні тому +2

      If no explicit cache duration is configured in your cache provider, the cache entries will remain until they are evicted due to memory constraints, manual eviction, or application restart.

    • @vikrambaliga7241
      @vikrambaliga7241 2 дні тому +1

      @@Javatechie Thanks Sir

  • @henrivalencia21
    @henrivalencia21 2 дні тому +1

    thank you.

  • @satyamsundaram-r4n
    @satyamsundaram-r4n День тому +1

    Thanks❤🙏

  • @shubhamthakare1599
    @shubhamthakare1599 День тому +1

    please explain about Optimistic vs. Pessimistic Locking in Spring Data and thank you for this video

    • @Javatechie
      @Javatechie  День тому

      Sure good suggestion 👍. Noted ✅️

  • @ALLinONE121
    @ALLinONE121 2 дні тому +1

    Great 👍

  • @siyamuddin
    @siyamuddin 2 дні тому +1

    Impressive

  • @karthikravisankar5608
    @karthikravisankar5608 День тому +1

    Could you please post a video on the jpa specification interface

  • @XprimeX-q7l
    @XprimeX-q7l 2 дні тому +1

    hey the fetched size was 50 but it bought 196504 records how? and where was cache?

    • @Javatechie
      @Javatechie  День тому

      No what it does is , fetchSize controls how many rows the JDBC driver fetches in one go from the database cursor but doesn’t limit the total records returned by the query. For example, with fetchSize=50, the driver fetches rows in chunks of 50, optimizing memory usage for large datasets. However, all rows matching the query will still be returned unless explicitly limited using setMaxResults() or a LIMIT clause. For instance, if a query matches 1000 rows, they’ll be fetched in 20 chunks of 50 but all 1000 rows will be returned unless otherwise restricted.

  • @Anilkumar-reddy
    @Anilkumar-reddy День тому +1

    Good Video as always♥, one doubt here. In video iu mentioned in the quertHint annotatios as fetch size is 50 right. after calling the api, did u get the records in 1lakh++ or only 50

    • @Javatechie
      @Javatechie  День тому

      No let me clear your doubts , fetchSize controls how many rows the JDBC driver fetches in one go from the database cursor but doesn’t limit the total records returned by the query. For example, with fetchSize=50, the driver fetches rows in chunks of 50, optimizing memory usage for large datasets. However, all rows matching the query will still be returned unless explicitly limited using setMaxResults() or a LIMIT clause. For instance, if a query matches 1000 rows, they’ll be fetched in 20 chunks of 50 but all 1000 rows will be returned unless otherwise restricted.
      Hope this make sense

    • @Anilkumar-reddy
      @Anilkumar-reddy День тому +1

      @ Thank you for detail explaination👌👌🙌

  • @girishrp9339
    @girishrp9339 День тому +1

    Basat request you please answer this question
    Why introduced Java 8 static and default method in interface and abstract class already used it?
    Can you tell me real time example

    • @Javatechie
      @Javatechie  День тому

      Girish i have covered this video on my interview QA series please have a look once , after watching if you are unclear then please feel free to let me know

  • @ash-1908
    @ash-1908 2 дні тому +1

    When we use Queryhint for saving query response to cache, if the data in database is always changing, how will it help ? Because the cache data will not be in sync if database data is changed right ?

    • @Javatechie
      @Javatechie  2 дні тому +1

      It will update once you try fetching the records . Not sure how it does will check and update buddy

  • @thurlukulasekhar223
    @thurlukulasekhar223 День тому +1

    Small doute if it taken 1029 but why it thorws exception 2000 limit time

    • @Javatechie
      @Javatechie  День тому

      When first time I ran it might took more than 2 sec that's why we get error. Second time it took only 1029 ms
      So the fact is that it will varry , for example if i will run 5 times in my local every time it won't give you the same result buddy

  • @weitanglau162
    @weitanglau162 2 дні тому +1

    Can you make a Spring Data JDBC video?
    Simpler than JPA

  • @girishrp9339
    @girishrp9339 День тому +1

    Can do make video of jpa save performance. In real time am facing 15sec to save into 3tables using oneTOMany relationship with Eager loading

    • @Javatechie
      @Javatechie  День тому

      Okay sure I will plan but can you elaborate your usecase what is the payload size you are persisting to DB is this in bulk or single nested payload ?

    • @girishrp9339
      @girishrp9339 День тому +1

      iterating one record at time
      hearder table 1 record
      Details table 3 records
      Under details child table 4 records
      3 tables one-to-many relationship
      Please make eager and lazy loading I didn't understand others videos still confused when to use fetchType.Eager and Lazy. One interview asked didn't given proper example

    • @Javatechie
      @Javatechie  День тому

      @@girishrp9339 thanks for clear picture let me try to reproduce this exact scenario and will update you buddy

  • @girishvm2335
    @girishvm2335 День тому

    Timeout is not required right technically
    Let it take the actual time as we optimised the method using queryhint know .

  • @RohitSingh-sd2hn
    @RohitSingh-sd2hn 2 дні тому

    i couldn't find your design pattern playlist, can you please post that playlist link.

    • @RohitSingh-sd2hn
      @RohitSingh-sd2hn 2 дні тому +1

      finally can i get rid of redis cache ?

    • @Javatechie
      @Javatechie  2 дні тому

      Redis complete Playlist is there buddy just click on Playlist section of javatechie you will find everything . Do let me know incase still you are facing issues

  • @karthiksundaram544
    @karthiksundaram544 2 дні тому +1

    🎉

  • @akhill357
    @akhill357 2 дні тому +1

    Where's pagination implemented here, you got all records at once

    • @Javatechie
      @Javatechie  2 дні тому

      FetchSize will load chunk of records on batch on the fly buddy. That's what the magic