Performance oriented Spring Data JPA & Hibernate by Maciej Walkowiak

Поділитися
Вставка

КОМЕНТАРІ • 19

  • @kam1234554321
    @kam1234554321 2 місяці тому +10

    Must watch for everyone starting with JPA!

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

      Not for beginners, getting the annotations right itself is a major win for any beginner.

  • @odrotbohm
    @odrotbohm 2 місяці тому +10

    A great talk, as always! 👏
    It's interesting that you casually refer to the proper solution to the problems of the middle part but don't emphasize on it: none of the problems induced by using full aggregate references in the BankTransfer object occur if you model them as identifier references instead. A many-to-… relation simply has no place in an aggregate model. You can avoid the additional mapping customizations, the usage of JPA-specific repository API and query customizations on the repository methods. Most of the JPA query performance issues can - and should - be solved by using *less* JPA, not more. 😉
    Big thumbs up for the recommendation to use projections and the awareness about the pitfalls regarding transactions. 👍

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

      The best way to optimize Spring Data JPA is to learn DDD and use JMolecules ;)

    • @pmerikan
      @pmerikan Місяць тому +1

      @odrotbohm After reading your comment about identity references and aggregates, I haven't been able to let it go. Do you have any blog posts or other information on the subject?

    • @popastefan6542
      @popastefan6542 Місяць тому +1

      He also said this at min 32:05. In real world, most teams tend to use the hibernate mappings and not follow religiously the DDD paradigm of having the identifier to another aggregate. And even in DDD world, you can still have the hibernate mapping if you require strong consistency between aggregates.

  • @sumanthanumula8048
    @sumanthanumula8048 Місяць тому

    Wow...! Thanks I learnt something new today.

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

    Realy helpful talk, a lot of great tips

  • @PietervandenHombergh
    @PietervandenHombergh 2 місяці тому +2

    one should consider to do the whole transaction in the database, i.e
    transfer from and to accounts in the database. that makes up one query to a custom database function, using the connection just once and which also takes care of the transaction.

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

    so helpful.
    thanks for your hard works!

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

    Thanks very much.
    Addressed some of the problems I faced recently

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

    23:10 , you could start a new thread?

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

    Nice. Tks for share!!

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

    Thanks, Quality Stuff. One concern or confusion , Whenever we use REQUIRES_NEW, it creates separate new transaction and not nested transaction. Although one starting in another but they are not nested, to be precise, right ?

    • @wimdetroyer3290
      @wimdetroyer3290 2 місяці тому +4

      they are nested in the sense that the new transaction B will keep transaction A open until transaction B has committed. Transaction A's lifecycle is tied to transaction B

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

    What a great explannation

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

    I know this is very practical and nice solution but just keep in mind that we should also keep running the application at least 5 years after development.
    If the system becomes bigger and bigger, many quires are wasted without performance checking because the production DB is fast enough with them. DB price is cheaper then refactoring or revieweing generally.
    So please do not over use projection class unless the business logic(use case) requires high performance like batch job. Management of type and design cost keeps increasing and it sometimes causes replacement of application at the end.
    But N+1 problem is easy to become big issue in production, so the techniques are brilliant and it was nice guide. Thank you.

    • @Vortex-gz8se
      @Vortex-gz8se Місяць тому +1

      This is complete nonsense. You should always query the database as efficiently as possible because accessing the DB is always the bottleneck in almost every application. It takes less effort to query to database efficiently from the beginning rather than trying to research performance issues later.