DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

Db2


IBM DB2 is a relational database focus on transactional and warehousing workloads. It is built on top of many Engine dispatchable units (EDUs), which control the activity inside the database. In 2017, IBM Db2 was announced which is the successor name of DB2 (introduced in the 1980s). Recent years, Db2 started to support non-relational structures like JSON and XML. It can support many platforms including Linux, UNIX, Windows, z/OS, i, VSE, and VM.[04][05][06]

Database Entry

Db2


IBM DB2 is a relational database focus on transactional and warehousing workloads. It is built on top of many Engine dispatchable units (EDUs), which control the activity inside the database. In 2017, IBM Db2 was announced which is the successor name of DB2 (introduced in the 1980s). Recent years, Db2 started to support non-relational structures like JSON and XML. It can support many platforms including Linux, UNIX, Windows, z/OS, i, VSE, and VM.[04][05][06]

History[06]


DB2 dates back to early of the 1970s. At that time, IBM researcher Edgar F. Codd described relational databases theory and published the famous paper “A Relational Model of Data for Large Shared Data Banks.”

In 1974, System R, which implemented Codd’s concepts, was developed by a team in IBM. SQL was the critical development of System R.

In the mid-1990s, DB2 Parallel Edition was released which provided scalability by shared-nothing architecture.

In the mid-2006 and October 2007, “Viper” and “Viper 2” were announced, which is the codename for DB2 9 and DB2 9.5.

In June 2009, “Cobra” DB2 9.7 was released. “Cobra” added many exciting features including temporary tables, large objects and data compression for database indexes. In October of the same year, DB2 pureScale was announced, which was a database cluster solution suitable for Online transaction processing (OLTP) workloads. Again in the same year, IBM said that DB2 could be an engine in MySQL.

In early 2012, “Galileo” DB2 10.1 was announced, which can support Linux, UNIX, and Windows. In mid-2017, “Db2” replaces the name of “DB2”.

Checkpoints[07]


IBM Db2 can take a backup using the BACKUP command and it supports online, offline backup using different parameters.

Compression[08]


IBM Db2 supports Row compression and Value compression. Row compression, also known as deep compression, compress data by using shorter symbol strings to remove patterns of values that duplicate across rows. Value compression compress data by storing only one copy of the same value.

Concurrency Control[09][10]


IBM Db2 supports OPTIMISTIC CONCURRENCY CONTROL (OCC) and Two-Phase Locking (2PL). OCC believes that values are unlikely to change before the update or deletion operations but will incur more retry logic in the application. Db2 supports OCC since version 9.5, and the history of 2PL, which was first invented by IBM, can be dated back to 1970s.

Data Model[11][12]


IBM Db2 is a relational database since it was first developed. It added the support of XML documents using pureXML® feature in the Db2 9. To use pureXML, the column should be defined as the XML data type. The XML column can be queried and updated using XQuery and SQL statements.

Foreign Keys[13]


IBM Db2 can define foreign key constraints during creating and altering table. With the definition of foreign key constraints, the database manager will maintain integrities automatically when one object refers another one.

Hardware Acceleration[14][15]


IBM Db2 uses nest accelerators to compress backup images and log archive files. Nest accelerator compresses main memory using 842 algorithm.

Indexes[16]


IBM Db2 uses B+tree as the underlying index data structures. There are three different kinds of nodes, root node, intermediate node, and leaf node in B+ tree. When finding a specific key value pair, IBM Db2 will follow the path from root to leaf.

Isolation Levels[17][18]


Db2 supports four different kinds of isolation level, which are Repeatable read, Read stability, Cursor stability and Uncommitted read. The default level is cursor stability.

Joins[19]


IBM Db2 can support three different kinds of join algorithms, which are nested-loop join, merge join, and hash join. Hash join has the best performance among the three algorithms if memory is large enough to ensure hash loops will not overflow to disk. To tune the hash join performance, it is better estimating and setting the memory large enough but without exceeding the memory limit.

Logging[20]


IBM Db2 use Physiological logging which can be dated back to the famous paper ARIES in 1992, which was developed at IBM Research. ARIES uses Write-Ahead Logging with STEAL + NO FORCE policy.

Query Execution[21]


IBM Db2 uses Iterator Model. There is a next function in every query plan operator. Every time the next function being called, it will either return a single tuple or null when all the tuples have been processed.

Query Interface[22]


IBM Db2 supports the majority of SQL standards. Also, it can support stored procedure which is a set of SQL statements with a dedicated name. Stored procedure can be invoked from command line and application program.

Storage Architecture[23][24]


IBM Db2 use disk as the primary storage location of data. Therefore, it is a disk-oriented DBMS. It is worth to mention that IBM Db2 can support multiple buffer pools, which is the connection between volatile and non-volatile storage. Multiple buffer pools have many advantages. For example, it can accelerate queries that need temporary storage by storing temporary data into separate buffer pools. Also, the data of some seldom-used applications can be stored separately to avoid flushing some hot data.

Storage Model[25]


IBM Db2 stores the values of a single attribute continuously in disk, i.e. DECOMPOSITION STORAGE MODEL (DSM). DSM is suitable for OLAP workloads as queries usually perform large scan over a subset of the attributes.

Stored Procedures[22]


Db2 supports three different kinds of Stored Procedures, which are external stored procedures, external SQL procedures (execute like external stored procedures), and native SQL procedures (create by a single SQL statement). The latter two are written entirely in SQL while the first one can be written in a host language.

System Architecture[26]


Db2 pureScale environment provides Db2 members the ability to access data stored on a shared disk.

Views[27][28]


IBM Db2 supports both views and materialized views. For materialized views, it can be specified maintaining by system clause or user clause.

Citations

28 sources
  1. Db2 | IBM ibm.com
  2. https://www-01.ibm.com/support/docview.wss?uid=swg27009474 ibm.com Dead — Check Archive
  3. IBM Db2 - Wikipedia wikipedia.org
  4. IBM Db2 Database ibm.com
  5. IBM Documentation ibm.com
  6. https://www.wikiwand.com/en/IBM_Db2 wikiwand.com
  7. BACKUP DATABASE command - IBM Documentation ibm.com
  8. Table compression - IBM Documentation ibm.com
  9. Optimistic locking - IBM Documentation ibm.com
  10. IBM notice: The page you requested cannot be displayed ibm.com Dead — Check Archive
  11. IBM Documentation ibm.com
  12. https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.qb.server.doc/doc/c0024080.html ibm.com Dead — Check Archive
  13. Designing foreign key (referential) constraints - IBM Documentation ibm.com
  14. https://www-03.ibm.com/support/techdocs/atsmastr.nsf/5cb5ed706d254a8186256c71006d2e0a/6fb9a087ba445455852581a900572d42/$FILE/DB2_POWER_NX842_Compression_V1.1.pdf ibm.com Dead — Check Archive
  15. https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.ha.doc/doc/c0062003.html ibm.com Dead — Check Archive
  16. Index structure - IBM Documentation ibm.com
  17. https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.perf.doc/doc/c0004121.html ibm.com Dead — Check Archive
  18. Specifying the isolation level - IBM Documentation ibm.com
  19. https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.perf.doc/doc/c0005311.html ibm.com Dead — Check Archive
  20. https://dl.acm.org/citation.cfm?id=128770 acm.org
  21. CMU 15-445/645 Database Systems (Fall 2018) :: Query Processing cmu.edu
  22. https://www.ibm.com/support/knowledgecenter/en/SSEPEK_11.0.0/apsg/src/tpc/db2z_storedprocedure.html ibm.com Dead — Check Archive
  23. End of support for DB2 for Linux UNIX and Windows 9.5.0 ibm.com
  24. IBM Documentation ibm.com
  25. Column-organized tables - IBM Documentation ibm.com
  26. How does a Db2 pureScale environment compare to a multi-partition database environment? - IBM Documentation ibm.com
  27. https://www.ibm.com/support/knowledgecenter/en/SSEPEK_11.0.0/perf/src/tpc/db2z_createmqt.html ibm.com Dead — Check Archive
  28. https://www.ibm.com/support/knowledgecenter/en/SSEPEK_11.0.0/sqlref/src/tpc/db2z_sql_createview.html ibm.com Dead — Check Archive
Revision #9 Last Updated: