High-Performance Java Persistence: Get the most out of your persistence layer

High-Performance Java Persistence: Get the most out of your persistence layer 电子书 第1张
High-Performance Java Persistence 1st Edition
By 作者:Vlad Mihalcea (Author)
pages 页数: 486 pages
Publisher Finelybook 出版社: VLAD MIHALCEA; 1 edition (October 12, 2016)
Language 语言: English
ISBN-10 书号:973022823X
ISBN-13 书号:9789730228236
The Book Description robot was collected from Amazon and arranged by Finelybook
High-Performance Java Persistence
Get the most out of your persistence layer
About the Book
This book is a journey into Java data access performance tuning. From connection management, to batch updates, fetch sizes and concurrency control mechanisms, it unravels the inner workings of the most common Java data access frameworks.
The first part aims to reduce the gap between application developers and database administrators. For this reason, it covers both JDBC and the database fundamentals that are of paramount importance when reducing transaction response times.
The second part demonstrates how you can take advantage of JPA and Hibernate without compromising application performance.
The third part is dedicated to jOOQ and its powerful type-safe querying capabilities, like window functions or common table expressions.
I Introduction
1. Preface
1.1 The database server and the connectivity layer
1.2 The application data access layer
1.2.1 The ORM framework
1.2.2 The native query builder framework
2. Performance and Scaling
2.1 Response time and throughput
2.2 Database connections boundaries
2.3 Scaling up and scaling out
2.3.1 Master-Slave replication
2.3.2 Multi-Master replication
2.3.3 Sharding
II JDBC and Database Essentials
3. JDBC Connection Management
3.1 DriverManager
3.2 DataSource
3.2.1 Why is pooling so much faster?
3.3 Queuing theory capacity planning
3.4 Practical database connection provisioning
3.4.1 A real-life connection pool monitoring example Concurrent connection request count metric Concurrent connection count metric Maximum pool size metric Connection acquisition time metric Retry attempts metric Overall connection acquisition time metric Connection lease time metric
4. Batch Updates
4.1 Batching Statements
4.2 Batching PreparedStatements
4.2.1 Choosing the right batch size
4.2.2 Bulk processing
4.3 Retrieving auto-generated keys
4.3.1 Sequences to the rescue
5. Statement Caching
5.1 Statement lifecycle
5.1.1 Parser
5.1.2 Optimizer Execution plan visualization
5.1.3 Executor
5.2 Caching performance gain
5.3 Server-side statement caching
5.3.1 Bind-sensitive execution plans
5.4 Client-side statement caching
6. ResultSet Fetching
6.1 ResultSet scrollability
6.2 ResultSet changeability
6.3 ResultSet holdability
6.4 Fetching size
6.5 ResultSet size
6.5.1 Too many rows SQL limit clause JDBC max rows Less is more
6.5.2 Too many columns
7. Transactions
7.1 Atomicity
7.2 Consistency
7.3 Isolation
7.3.1 Concurrency control Two-phase locking Multi-Version Concurrency Control
7.3.2 Phenomena Dirty write Dirty read Non-repeatable read Phantom read Read skew Write skew Lost update
7.3.3 Isolation levels Read Uncommitted Read Committed Repeatable Read Serializable
7.4 Durability
7.5 Read-only transactions
7.5.1 Read-only transaction routing
7.6 Transaction boundaries
7.6.1 Distributed transactions Two-phase commit
7.6.2 Declarative transactions
7.7 Application-level transactions
7.7.1 Pessimistic and optimistic locking Pessimistic locking Optimistic locking
III JPA and Hibernate
8. Why JPA and Hibernate matter
8.1 The impedance mismatch
8.2 JPA vs. Hibernate
8.3 Schema ownership
8.4 Write-based optimizations
8.5 Read-based optimizations
8.6 Wrap-up
9. Connection Management and Monitoring
9.1 JPA connection management
9.2 Hibernate connection providers
9.2.1 DriverManagerConnectionProvider
9.2.2 C3P0ConnectionProvider
9.2.3 HikariCPConnectionProvider
9.2.4 DatasourceConnectionProvider
9.2.5 Connection release modes
9.3 Monitoring connections
9.3.1 Hibernate statistics Customizing statistics
9.4 Statement logging
9.4.1 Statement formatting
9.4.2 Statement-level comments
9.4.3 Logging parameters DataSource-proxy P6Spy
10. Mapping Types and Identifiers
10.1 Types
10.1.1 Primitive types
10.1.2 String types
10.1.3 Date and Time types
10.1.4 Numeric types
10.1.5 Binary types
10.1.6 UUID types
10.1.7 Other types
10.1.8 Custom types
10.2 Identifiers
10.2.1 UUID identifiers The assigned generator
10.2.2 The legacy UUID generator The newer UUID generator
10.2.3 Numerical identifiers Identity generator Sequence generator Table generator Optimizers The hi/lo algorithm The default sequence identifier generator The default table identifier generator The pooled optimizer The pooled-lo optimizer Optimizer gain Sequence generator performance gain Table generator performance gain Identifier generator performance
11. Relationships
11.1 Relationship types
11.2 @ManyToOne
11.3 @OneToMany
11.3.1 Bidirectional @OneToMany
11.3.2 Unidirectional @OneToMany
11.3.3 Ordered unidirectional @OneToMany @ElementCollection
11.3.4 @OneToMany with @JoinColumn
11.3.5 Unidirectional @OneToMany Set
11.4 @OneToOne
11.4.1 Unidirectional @OneToOne
11.4.2 Bidirectional @OneToOne
11.5 @ManyToMany
11.5.1 Unidirectional @ManyToMany
11.5.2 Bidirectional @ManyToMany
11.5.3 The @OneToMany alternative
12. Inheritance
12.1 Single table
12.1.1 Data integrity constraints
12.2 Join table
12.3 Table-per-class
12.4 Mapped superclass
13. Flushing
13.1 Flush modes
13.2 Events and the action queue
13.2.1 Flush operation order
13.3 Dirty Checking
13.3.1 The default dirty checking mechanism Controlling the Persistence Context size
13.3.2 Bytecode enhancement
14. Batching
14.1 Batching insert statements
14.2 Batching update statements
14.3 Batching delete statements
15. Fetching
15.1 DTO projection
15.1.1 DTO projection pagination
15.1.2 Native query DTO projection
15.2 Query fetch size
15.3 Fetching entities
15.3.1 Direct fetching Fetching a Proxy reference Natural identifier fetching
15.3.2 Query fetching
15.3.3 Fetching associations FetchType.EAGER FetchType.LAZY The N+1 query problem How to catch N+1 query problems during testing LazyInitializationException The Open Session in View Anti-Pattern Temporary Session Lazy Loading Anti-Pattern Associations and pagination
15.3.4 Attribute lazy fetching
15.3.5 Fetching subentities
15.4 Query plan cache
16. Caching
16.1 Caching flavors
16.2 Cache synchronization strategies
16.2.1 Cache-aside
16.2.2 Read-through
16.2.3 Write-invalidate
16.2.4 Write-through
16.2.5 Write-behind
16.3 Database caching
16.4 Application-level caching
16.4.1 Entity aggregates
16.4.2 Distributed key-value stores
16.4.3 Cache synchronization patterns
16.4.4 Synchronous updates
16.4.5 Asynchronous updates Change data capture
16.5 Second-level caching
16.5.1 Enabling the second-level cache
16.5.2 Entity cache loading flow
16.5.3 Entity cache entry Entity reference cache store
16.5.4 Collection cache entry
16.5.5 Query cache entry
16.5.6 Cache concurrency strategies READ_ONLY Inserting READ_ONLY cache entries Updating READ_ONLY cache entries Deleting READ_ONLY cache entries NONSTRICT_READ_WRITE Inserting NONSTRICT_READ_WRITE cache entries Updating NONSTRICT_READ_WRITE cache entries Risk of inconsistencies Deleting NONSTRICT_READ_WRITE cache entries READ_WRITE Inserting READ_WRITE cache entries Updating READ_WRITE cache entries Deleting READ_WRITE cache entries Soft locking concurrency control TRANSACTIONAL XA_Strict mode XA mode Inserting TRANSACTIONAL cache entries Updating TRANSACTIONAL cache entries Deleting TRANSACTIONAL cache entries
16.5.7 Query cache strategy Table space query invalidation Native SQL statement query invalidation
17. Concurrency Control
17.1 Hibernate optimistic locking
17.1.1 The implicit optimistic locking mechanism Resolving optimistic locking conflicts Splitting entities Versionless optimistic locking OptimisticLockType.DIRTY update caveat
17.2 The explicit locking mechanism
17.2.1 PESSIMISTIC_READ and PESSIMISTIC_WRITE Lock scope Lock timeout
17.2.2 LockModeType.OPTIMISTIC Inconsistency risk
18. Why jOOQ matters
18.1 How jOOQ works
18.2 DML statements
18.3 Java-based schema
18.4 Upsert
18.4.1 Oracle
18.4.2 SQL Server
18.4.3 PostgreSQL
18.4.4 MySQL
18.5 Batch updates
18.6 Inlining bind parameters
18.7 Complex queries
18.8 Stored procedures and functions
18.9 Streaming
18.10 Keyset pagination


High-Performance Java Persistence 9789730228236.zip

未经允许不得转载:finelybook » High-Performance Java Persistence: Get the most out of your persistence layer
分享到: 更多 (0)

评论 抢沙发

4 + 2 =
  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址