ORM, 20 years later by Gavin King

Explore the complexities of Object-Relational Mapping (ORM) with expert Gavin King, discussing benefits, limitations, and trade-offs of lazy vs eager loading, handwritten SQL vs ORM code, and more.

Key takeaways
  • There is no one-size-fits-all solution for ORM (Object-Relational Mapping) and it depends on individual needs.
  • The choice between lazy and eager loading depends on the application’s requirements and performance constraints.
  • The speaker argues that ORM solutions are relatively complex libraries and can be difficult to debug and understand.
  • Handwritten SQL code can be more efficient and easier to debug than ORM code, but it requires more expertise.
  • Hibernate’s query language is a lowest common denominator abstraction of SQL and is not as powerful as modern SQL.
  • There are cases where using an ORM can be beneficial, such as when working with complex data models and associations.
  • Hibernate Reactive is a non-blocking implementation of Hibernate that is designed to work with reactive streams and can offer better performance in certain scenarios.
  • The speaker believes that Quarkus is an interesting project that can offer a reactive stack from top to bottom.
  • The choice between using an ORM or handwritten SQL code depends on the individual’s expertise and the requirements of the application.
  • Lazy fetching can be a good option in certain scenarios, but it can also lead to unexpected performance issues.
  • The speaker argues that it is important to evaluate the trade-offs and make informed decisions about which approach to use.
  • There is no single “right” answer for ORM and it depends on individual circumstances.
  • The speaker believes that it is important to be honest with oneself about one’s own limitations and the limitations of the tools being used.
  • The choice between lazy and eager loading depends on the application’s requirements and performance constraints.
  • Handwritten SQL code can be more efficient and easier to debug than ORM code, but it requires more expertise.
  • There are cases where using an ORM can be beneficial, such as when working with complex data models and associations.
  • Hibernate Reactive is a non-blocking implementation of Hibernate that is designed to work with reactive streams and can offer better performance in certain scenarios.