Hibernate Performance Revisit

1. Bird View

In bird view, consists of 2 parts: Fetching Strategy and Caching

Fetching Strategy: elaborate DB query. lazy/batch etc.

Caching: elaborate avoiding DB query. second cache: entity, collection, query(timestamp)


2. Hibernate Query Cache Considered Harmful

See reference 2 for details. Reasons:

2.1 Frequent insert/update invalidates cache constantly

2.2 High memory cost

2.3 Timestamp cache has a synchronization lock, lock contention might do harm to concurrency and scalibility.


References:

1. http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/performance.html

2. http://tech.puredanger.com/2009/07/10/hibernate-query-cache/

你可能感兴趣的:(Hibernate Performance Revisit)