1. Object Cache: fine-grained, in view of the table Record Level, transparent access, without changing the procedure code can greatly enhance the performance of web applications. ORM object cache is a magic weapon for the victory.
2. The merits of the object cache implementation depends on the level of the framework, Hibernate objects are currently known to cache the most powerful open-source ORM
3. Query Cache: coarse-grained for query result sets, real-time data used in less demanding occasions
Eleven. Applications determines the system architecture
First, the need for ORM
Hibernate or iBATIS?
Second, the use of ORM determines the database design
Tend to fine-grained, object-oriented, will go a long table divided into a number of association of small tables, the elimination of redundant column, through the secondary cache to enhance performance (DBA compare the emergence of a taboo relationship, but the ORM cache will exceed the performance bottlenecks associated relations); Hibernate performance bottleneck is not the relationship, but rather the operation of large table
Tend to coarse-grained design, for the relationship and try to put the merger table by table column redundancy, the elimination of relationship. No effective means of cache. iBATIS performance bottleneck is not a great operation, but rather the relationship.
1, the use of two-way one-to-many association, do not use one-way one-to-many
2, flexible use of one-way many-to-one correlation
3, do not have one-on-one, using many-to-one to replace the
4, configure the object cache, the cache does not use a collection
5, one-to-many set to use Bag, many-to-many set to use Set
6, the succession of many types of use of explicit state
7, table fields less, table associated not be afraid of many, has the backing of the secondary cache
Hibernate performance tuning