Published Sep 3, 2019

Episode 121: OR Mappers with Michael Plöd

Delve into the world of Object-Relational Mappers with Michael Plöd as he unpacks the intricacies of ORMs, discussing their performance, caching strategies, architectural implications, and basic concepts to enhance database interaction and software design.
Episode Highlights
Software Engineering Radio - the podcast for professional software developers logo

Popular Clips

Episode Highlights

  • Performance

    The performance of Object-Relational Mappers (OR Mappers) is often debated, but argues that they generally perform well compared to hand-coded SQL, especially when used by average developers. He notes that while database experts can outperform OR Mappers, these tools offer abstraction and portability that hand-coded SQL cannot 1. Plöd compares this to the performance impact of virtual machines versus assembly language, emphasizing that OR Mappers do not inherently degrade performance when used correctly 2.

    You will always find people that say OR Mappers are so slow. But I think the reality is that not every developer can be a database expert in terms of writing the top performing SQL for database x.

    ---

    He also highlights that a good OR Mapper sends efficient SQL to the database, reducing the need for developers to manage low-level performance details 2.

       

    Caching

    Caching in OR Mappers is a nuanced topic, with advising a conservative approach. He suggests tuning data access before implementing caching, as not all data benefits equally from it 3. Plöd warns against caching critical data, like financial information, due to the risks of outdated caches, while recommending caching for static data like country lists 3.

    Before I start introducing a second level caching mechanism to an OR Mapper, my recommendation is to first tune the plain data access.

    ---

    He also stresses that caching should only be added when it provides business value, and not just because it seems like a trendy solution 4.

Related Episodes