Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
sg247887.pdf
Скачиваний:
15
Добавлен:
01.03.2016
Размер:
4.45 Mб
Скачать

IBM® Information Management Software

IBM solidDB

Delivering Data with Extreme Speed

Provides low latency, high throughput, and extreme availability

Offers fully featured relational in-memory database software

Has universal cache with shared memory access

Chuck Ballard

Dan Behman

Asko Huumonen

Kyosti Laiho

Jan Lindstrom

Marko Milek

Michael Roche

John Seery

Katriina Vakkila

Jamie Watters

Antoni Wolski

ibm.com/redbooks

International Technical Support Organization

IBM solidDB: Delivering Data with Extreme Speed

May 2011

SG24-7887-00

Note: Before using this information and the product it supports, read the information in “Notices” on page ix.

First Edition (May 2011)

This edition applies to Version 6.5 of IBM solidDB (product number 5724V17) and IBM solidDB Universal Cache (product number 5724W91).

© Copyright International Business Machines Corporation 2011. All rights reserved.

Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

Contents

Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi The team who wrote this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii Now you can become a published author, too! . . . . . . . . . . . . . . . . . . . . . . . . xv Comments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi Stay connected to IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi

Chapter 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 The opportunity of the in-memory database . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.1 Disk databases cannot expand to memory . . . . . . . . . . . . . . . . . . . . . 2 1.1.2 IBM solidDB IMDB is memory-friendly . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1.3 Misconceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.1.4 Throughput and response times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.2 Database caching with in-memory databases. . . . . . . . . . . . . . . . . . . . . . . 9 1.2.1 Databases are growing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.2.2 Database caching off-loads the enterprise server. . . . . . . . . . . . . . . 10 1.2.3 IBM solidDB Universal Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.3 Applications, competition, and the marketplace . . . . . . . . . . . . . . . . . . . . 11

Chapter 2. IBM solidDB details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.2 Server architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.2.1 Database access methods and network drivers . . . . . . . . . . . . . . . . 16 2.2.2 Server components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.3 Data storage in solidDB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.3.1 Main-memory engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.3.2 Disk-based engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.4 Table types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.4.1 In-memory versus disk-based tables . . . . . . . . . . . . . . . . . . . . . . . . 24 2.4.2 Persistent versus non-persistent tables . . . . . . . . . . . . . . . . . . . . . . 25 2.4.3 Choosing between different table types . . . . . . . . . . . . . . . . . . . . . . 26 2.5 Transactionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.5.1 Concurrency control and locking. . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.5.2 Isolation levels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 2.5.3 Durability levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 2.6 solidDB SQL extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.6.1 solidDB SQL standard compliance . . . . . . . . . . . . . . . . . . . . . . . . . . 32

© Copyright IBM Corp. 2011. All rights reserved.

iii

2.6.2 Stored procedures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.6.3 Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.6.4 Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.6.5 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.6.6 Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

2.7 Database administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.7.1 Configuration settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.7.2 ADMIN COMMAND. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 2.7.3 Data management tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 2.7.4 Database object hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

Chapter 3. IBM solidDB Universal Cache details . . . . . . . . . . . . . . . . . . . . 39 3.1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.1.1 Architecture and key components. . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.1.2 Principles of operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.2 Deployment models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 3.3 Configuration alternatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3.3.1 Typical configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3.3.2 Multiple cache nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 3.3.3 SMA for collocation of data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 3.3.4 solidDB HSB servers for high availability . . . . . . . . . . . . . . . . . . . . . 49 3.4 Key aspects of cache setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 3.4.1 Deciding on the replication model . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 3.4.2 Defining what to replicate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 3.4.3 Starting replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 3.5 Additional functionality for cache operations . . . . . . . . . . . . . . . . . . . . . . . 56 3.5.1 SQL pass-through . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 3.5.2 Aging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 3.5.3 Improving performance with parallelism . . . . . . . . . . . . . . . . . . . . . . 60 3.6 Increasing scale of applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 3.6.1 Scaling strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 3.6.2 Examples of cache database applications . . . . . . . . . . . . . . . . . . . . 64 3.7 Enterprise infrastructure effects of the solidDB Universal Cache . . . . . . . 65 3.7.1 Network latency and traffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 3.7.2 Back-end machine load. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 3.7.3 Database operation execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

Chapter 4. Deploying solidDB and Universal Cache . . . . . . . . . . . . . . . . . 67 4.1 Change and consideration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 4.2 How to develop applications that use solidDB . . . . . . . . . . . . . . . . . . . . . 68 4.2.1 Application program structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 4.2.2 ODBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 4.2.3 JDBC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

iv IBM solidDB: Delivering Data with Extreme Speed

4.2.4 Stored procedures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 4.2.5 Special considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.3 New application development on solidDB UC. . . . . . . . . . . . . . . . . . . . . . 84 4.3.1 Awareness of separate database connections . . . . . . . . . . . . . . . . . 85 4.3.2 Combining data from separate databases in a transaction. . . . . . . . 87 4.3.3 Combining data from different databases in a query . . . . . . . . . . . . 87 4.3.4 Transactionality with Universal Cache . . . . . . . . . . . . . . . . . . . . . . . 88 4.3.5 Stored procedures in Universal Cache architectures . . . . . . . . . . . . 88 4.4 Integrate an existing application to work with solidDB UC . . . . . . . . . . . . 89 4.4.1 Programming interfaces used by the application . . . . . . . . . . . . . . . 89 4.4.2 Handling two database connections instead of one . . . . . . . . . . . . . 90 4.5 Data model design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 4.5.1 Data model design principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 4.5.2 Running in-memory and disk-based tables inside solidDB . . . . . . . . 92 4.5.3 Data model design for solidDB UC configurations . . . . . . . . . . . . . . 94 4.6 Data migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 4.7 Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 4.7.1 Regular administration operations . . . . . . . . . . . . . . . . . . . . . . . . . . 99 4.7.2 Information to collect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 4.7.3 Procedures to plan in advance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 4.7.4 Automation of administration by scripts . . . . . . . . . . . . . . . . . . . . . 106

Chapter 5. IBM solidDB high availability. . . . . . . . . . . . . . . . . . . . . . . . . . 109 5.1 High availability (HA) in databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 5.2 IBM solidDB HotStandby. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 5.2.1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 5.2.2 State behavior of solidDB HSB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 5.2.3 solidDB HSB replication and transaction logging . . . . . . . . . . . . . . 114 5.2.4 Uninterruptable system maintenance and rolling upgrades . . . . . . 121 5.3 HA management in solidDB HSB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 5.3.1 HA control with a third-party HA framework . . . . . . . . . . . . . . . . . . 124 5.3.2 HA control with the watchdog sample . . . . . . . . . . . . . . . . . . . . . . . 125 5.3.3 Using solidDB HA Controller (HAC) . . . . . . . . . . . . . . . . . . . . . . . . 126 5.3.4 Preventing Dual Primaries and Split-Brain scenarios . . . . . . . . . . . 128 5.4 Use of solidDB HSB in applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 5.4.1 Location of applications in the system . . . . . . . . . . . . . . . . . . . . . . 129 5.4.2 Failover transparency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 5.4.3 Load balancing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 5.4.4 Linked applications versus client/server applications . . . . . . . . . . . 134 5.5 Usage guidelines, use cases. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 5.5.1 Performance considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 5.5.2 Behavior of reads and writes in a HA setup . . . . . . . . . . . . . . . . . . 135 5.5.3 Using asynchronous configurations with HA. . . . . . . . . . . . . . . . . . 136

Contents v

5.5.4 Using default solidDB HA setup . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 5.5.5 The solidDB HA setup for best data safeness . . . . . . . . . . . . . . . . 137 5.5.6 Failover time considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 5.5.7 Recovery time considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 5.5.8 Example situation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 5.5.9 Application failover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

5.6 HA in Universal Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 5.6.1 Universal Cache HA architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 142 5.6.2 UC failure types and remedies . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144

Chapter 6. Performance and troubleshooting . . . . . . . . . . . . . . . . . . . . . 147 6.1 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 6.1.1 Tools available in the solidDB server . . . . . . . . . . . . . . . . . . . . . . . 148 6.1.2 Tools available in InfoSphere CDC . . . . . . . . . . . . . . . . . . . . . . . . . 180 6.1.3 Performance troubleshooting from the application perspective . . . 182 6.2 Troubleshooting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214

Chapter 7. Putting solidDB and the Universal Cache to good use. . . . . 219 7.1 solidDB and Universal Cache sweet spots . . . . . . . . . . . . . . . . . . . . . . . 220 7.1.1 Workload characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 7.1.2 System topology characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 7.1.3 Sweet spot summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 7.2 Return on investment (ROI) considerations . . . . . . . . . . . . . . . . . . . . . . 225 7.2.1 solidDB Universal Cache stimulates business growth . . . . . . . . . . 226 7.2.2 solidDB server reduces cost of ownership . . . . . . . . . . . . . . . . . . . 229 7.2.3 solidDB Universal Cache helps leverage enterprise DBMS . . . . . . 230 7.2.4 solidDB Universal Cache complements DB2 Connect . . . . . . . . . . 230 7.3 Application classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 7.3.1 WebSphere Application Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 7.3.2 WebLogic Application Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 7.3.3 JBoss Application Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 7.3.4 Hibernate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 7.3.5 WebSphere Message Broker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 7.4 Examining specific industries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 7.4.1 Telecom (TATP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 7.4.2 Financial services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 7.4.3 Banking Payments Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 7.4.4 Securities Exchange Reference Architecture (SXRA) . . . . . . . . . . 246 7.4.5 Retail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 7.4.6 Online travel industry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 7.4.7 Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265

Chapter 8. Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 8.1 Where are you putting your data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270

vi IBM solidDB: Delivering Data with Extreme Speed

8.2 Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272

Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273

Abbreviations and acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279

Contents vii

viii IBM solidDB: Delivering Data with Extreme Speed

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]