OBLYTECH Logo
OBLYTECH Logo

ServiceNow CMDB Relationship Table: How cmdb_rel_ci Works

The ServiceNow CMDB relationship table is cmdb_rel_ci, labelled CI Relationship. Each row joins one parent configuration item to one child configuration item through a relationship type, and the row can be read from either end. Dependency Views maps and the CI relations formatter both show these rows.

What the relationship table holds

The value of a CMDB comes from the links between CIs (the wider picture is in what the CMDB is): which service runs on which server, which database an application depends on. Those links live in the CI Relationship table, whose name in the database is cmdb_rel_ci.

Each record in that table has three parts: a parent CI, a child CI, and a relationship type. Take the record “Server1 Managed by Server2”. Server2 is the parent and Server1 is the child, and the type is the Manages / Managed by pair. Those three parts describe the link.

One row is enough to describe the link in both directions. The type names both directions, so you can read it parent to child using the first half of the type, or child to parent using the second half. That detail matters later, when you query the table or build a report, because the direction you choose changes the wording of the statement.

How the relationship type is written

A relationship type is a pair of descriptors written as the parent descriptor, two colons, then the child descriptor. “Depends on::Used by” is a standard example. The first descriptor describes the link from the parent toward the child. The second describes it from the child back toward the parent.

A worked reading helps. Suppose a business service called Bond Trading is the parent and a Linux server called lnux100 is the child, joined by Depends on::Used by. Read parent to child, the statement is that Bond Trading depends on lnux100. Read child to parent, it becomes lnux100 is used by Bond Trading. Both sentences describe the same single row.

Pairs that appear in the base list include:

Parent descriptor Child descriptor
Contains Contained by
Depends on Used by
Hosted on Hosts
Manages Managed by
Members Member of
Owns Owned by
Runs on Runs
Connects to Connected by
Defines resources for Gets resources from

The list also includes Applicative Flow To / From, Implement End Point To / From and Use End Point To / From, which belong to the internal service model.

Parent and child are about direction, not importance

New admins often assume the parent is the bigger or more important CI. The table does not say that. The parent is simply the CI on the first-descriptor side of the type. With Depends on, the parent is the thing that depends, such as a service, and the child is the thing it relies on, such as a server. With Hosted on, the parent is the hosted item. With Contains, the parent is the container.

A wrong type typically reads in reverse: pick Hosts when you meant Hosted on, and the row points the wrong way. Say the relationship aloud in the parent-to-child direction before saving it. If the sentence sounds wrong, the type or the order is wrong.

Where the rows come from

Rows reach the table through three routes: discovery, import from another system, and manual creation.

Discovery. Many relationships load automatically during ServiceNow Discovery.

Import. If you bring data in from another system, the import also brings in some form of relationships.

Manual creation. You can add, create or edit relationships with the CI relationship editor, which opens from the CI form, or with Unified Map in the CMDB Workspace, which is the option that carries the latest editing features.

Dependent and non-dependent relationships

Rows in cmdb_rel_ci differ in weight. ServiceNow separates relationships into two groups, and the difference decides whether you can safely delete one.

Dependent relationships take part in identification. The Identification and Reconciliation Engine uses them to recognise a CI and avoid creating duplicates (see the Identification and Reconciliation Engine explained). The classic example is a Tomcat instance that runs on a hardware server.

Non-dependent relationships are not used for identification. For these, the CMDB tracks the discovery source and the last scanned time in a separate table, Relationship Sources, whose name in the database is sys_rel_source.

That split drives the deletion rules:

  • A non-dependent relationship can be deleted once it is no longer needed. The Relationship Sources table helps you decide whether a non-dependent relationship is safe to delete.
  • A dependent relationship should not be deleted directly, because it is not tracked in Relationship Sources.
  • Deleting a non-dependent row from the CI Relationship table also removes its matching Relationship Sources records.

One setting is easy to miss. The Relationship Sources table does not populate on its own by default. To record full information on non-dependent relationships, the property glide.identification_engine.populate_sys_rel_source changes that behaviour.

Related tables around the relationship table

Further tables sit beside cmdb_rel_ci and show up in day-to-day CMDB work.

Table Database name Role
CI Relationship cmdb_rel_ci The parent, child and type rows
Relationship Sources sys_rel_source Discovery source and last scanned time for non-dependent links
Suggested Relationship cmdb_rel_type_suggest Suggested relationship types for each CI class
Qualifier cmdb_ci_qualifier Qualifier CIs that hold extra information about relationships

Creating a relationship in the CI relationship editor

The editor opens from the CI relations formatter on a CI form. The CI you launch it from becomes the base CI, and the type you choose decides whether that base CI is the parent or the child. Choose a parent-side type such as Contains, for example, and the base CI becomes the parent while the second CI becomes the child.

There are two ways to work, controlled by the Use suggested relationship check box.

  1. With the box selected, the editor lists the CI, user and group relationship types available for the base CI. You pick a type first, then the second CI.
  2. With the box cleared, you pick the second CI first, then choose a parent or child relationship type.

With the box cleared, the editor also lists existing links in two groups. Downstream relationships are those where the base CI is the parent, and the other CI is the child. Upstream relationships are those where the base CI is the child, and the other CI is the parent.

Reading the table through the CI relations formatter

On the CI form, the CI relations formatter shows the rows for that CI. The Settings icon opens view settings that are preserved through logging out and back in.

  • Layout is Flat by default, grouping related CIs by relationship type in alphabetical order. Tree shows a hierarchy.
  • Merge is the default for the upstream and downstream display, giving one combined list.
  • Max Level in flat view defaults to 3.

Three system properties control what the formatter displays:

Property Default Effect
glide.ecmdb.find_relationship_issues true Shows or hides the icon linking to open issues for the CI
glide.ui.max_relation_levels 5 Maximum level shown in flat view before the relations limit applies
glide.ui.max_relations 1000 Maximum number of related CIs displayed

When the glide.ui.max_relations limit is exceeded, a notification appears and a flat layout reverts to the tree layout. A custom relationship filter shows relationships from selected tables.

A CI that is not extended from the base Configuration Item table (cmdb_ci) does not appear in the formatter or in Dependency Views maps. If a record you expect to see is missing, check its class first, as covered in CMDB classes explained.

Dependency Views draw on the same rows

A Dependency Views map starts from one root CI and shows its upstream and downstream dependencies. The default maximum depth is three levels from the root CI, and administrators can change it. You can also create, define and delete relationships directly in the map. Reading those same links for outage questions is the subject of CMDB service impact analysis, and deciding who may add or remove them is a governance question covered in CI relationship governance.

Frequently asked questions

What is the ServiceNow CMDB relationship table?

It is the CI Relationship table, cmdb_rel_ci. Each record joins a parent CI and a child CI through a relationship type.

How do I read a relationship type such as Depends on::Used by?

The text before the double colons describes the link from parent to child, and the text after describes it from child to parent. In the Bond Trading example, the service depends on the server, and the server is used by the service.

Which relationships can I delete safely?

Non-dependent relationships can be deleted when no longer needed. Dependent relationships are used for identification and should not be deleted directly.

Why is a CI missing from the relations formatter or a Dependency Views map?

A CI that is not extended from the Configuration Item table does not appear in either.

Where do suggested relationship types come from?

They are stored in the Suggested Relationship table, cmdb_rel_type_suggest, per CI class.