CMDB Data Model Design
The configuration management database needs to be able to store records for every configuration item and relationship in the systems it supports. The storage requirements for these systems may differ. For example, the properties of a network switch are different to the ones for a database. The structure of configuration item records will also differ. This can be a problem when you decide to store configuration item records in a database. It is difficult to design a database schema that is able to record metadata for a diverse range of configuration items.
One way around this is to incorporate XML Type columns into the design. The diagram below shows an example of this. It has 3 tables: CMDB_ITEMS, CMDB_RELATIONSHIPS and CMDB_TYPES. CMDB_ITEMS and CMDB_RELATIONSHIPS are arranged in a bill of materials structure.
CMDB_ITEMS stores configuration item records. Each record has a system generated id along with a name, version and type id. The name, version and type combination form an unique constraint for the table. The configuration record is stored as an XML document in the XRECORD column. An MD5 hash value is created for the XRECORD. This can be used to help identify configuration items that exist in more than one configuration.
CMDB_RELATIONSHIPS stores the relationships between configuration item records. It uses the source and target configuration item ids in conjunction with the relationship type to identify the relationship. An XML Type column in CMDB_RELATIONSHIPS can be used to store XML documents that include data to describe the relationship.
CMDB_TYPES stores metadata that describes configuration items and relationships. Each type has a system generated id and a unique name + version. The RECORD_SCHEMA column stores an XML schema that can be used to validate the structure of the item or relationship XML documents.
Records configuration items
|CIID||NUMBER||(38)||Yes||System generated configuration item ID|
|NAME||VARCHAR2||(256)||Yes||Configuration item name|
|VERSION||VARCHAR2||(64)||Yes||Configuration item version|
|TYPE_ID||NUMBER||(38)||Yes||Configuration item type - foreign key to CMDB_TYPES|
|MD5_HASH||VARCHAR2||(256)||No||MD5 Hash of the configuration item record.|
|XRECORD||XMLTYPE||CLOB||No||Configuration item record stored in XML format.|
Records relationships between configuration items
|SOURCE_CIID||NUMBER||(38)||Yes||Source configuration item ID - foreign key to CMDB_ITEMS|
|TARGET_CIID||NUMBER||(38)||Yes||Target configuration item ID - foreign key to CMDB_ITEMS|
|TYPE_ID||NUMBER||(38)||Yes||Relation type ID - foreign key to CMDB_TYPES|
|XRECORD||XMLTYPE||CLOB||No||Configuration item relationship record|
Records metadata for the CMDB_ITEMS and CMDB_RELATIONSHIP tables
|TYPE_ID||NUMBER||(38)||Yes||System generated primary key|
|NAME||VARCHAR2||(256)||Yes||A name to identify the CMDB type.|
|VERSION||VARCHAR2||(64)||Yes||CMDB type version|
|RECORD_SCHEMA||XMLTYPE||CLOB||No||An XML Schema that can be used to validate item and relationship instance documents|