• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

POJOs in action : Performance issue

 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, mr.Chris Richardson, can i know the performance issue between ordinary JDBC and POJOs ? thank you
[ January 25, 2006: Message edited by: Nakata kokuyo ]
 
Chris Richardson
author
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nakata,

Strictly speaking your question is really how does the performance of an ORM framework compare with JDBC.

There are several different things to consider:
1. ORM is a layer on top of JDBC so there is an overhead, which may or may not be significant.
2. ORM frameworks have sophisticated performance options such as lazy/eager loading and caching that would be quite difficult to implement yourself.
3. ORM frameworks are suited to particular patterns of database access. See here http://www.coderanch.com/t/216017/ORM/java/iBatis-Hibernate-same-book Having said that you can, of course, write poorly performing JDBC code.
4. An ORM framework can consistently generate efficient SQL that would be a lot of work write by hand and maintain.

The big issue is whether the database access patterns of your application are compatible with how ORM frameworks work.

Chris
 
Scott Selikoff
author
Saloon Keeper
Posts: 4031
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From a performance stand point, if you write perfect SQL, only load exactly as much data as you need, and cache exactly as much data as you'll need for later... then JDBC is superior.

The problem is that as applications and databases grow, it becomes very difficult to accomplish this writing JDBC code. Aside from basic query optimization, caching is a very important part of ORM manager. If hundreds of people are all reading the same record and no one is modifying it, why load it over and over again from the database using JDBC? The ability to manage and organize caches and data is usually beyond the scope of most application level programming especially in larger applications. So from a mantainability standpoint, as well as a long term performance view, ORM tools for databases are superior.
[ January 25, 2006: Message edited by: Scott Selikoff ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic