Skip to content

Modelling Databases

Figure 1 shows the types of metadata that describe databases.

Figure 1

Figure 1: Database metadata

The structure of a database schema consists of a number of database tables and database views. The difference is that the database table has its values stored in the database whereas the database view is a set of values that are derived from accessing other database tables using a query.

The structure of both the database tables and database views are described by database columns.

Database columns have a type that represents a single value. This can be stored, or derived using a query. If the column holds the unique identifier for a row within the table, it can be decorated with the PrimaryKey classification. If a column contains values that are the primary key of another table then the two columns can be linked using the ForeignKey relationship.

Figure 2 shows the open metadata types used to represent this metadata.

Figure 2

Figure 2: Database open metadata types for databases

A database schema is represented using the DeployedDatabaseSchema entity, the database table is represented using the RelationalTable entity and the database column is represented using the RelationalColumn entity. A database view is a RelationalTable entity with the Calculated Value classification attached.

If the DatabaseManager is catalogued, link each Database to it using the CapabilityAssetUse relationship. A DeployedDatabaseSchema is linked to its Database using the DataSetContent relationship. (The database schema is a DataSet over the database which is a type of DataStore).

Between the DeployedDatabaseSchema entity and its RelationalTable entities sit the Schema relationship, RelationalDBSchemaType entity and AttributeForSchema relationship. An integration connector creates these elements through the clients of its integration context. Egeria's database server connectors (for example, the PostgreSQL, Oracle, Microsoft SQL Server and Db2 server connectors) create the database-level elements by cataloguing from templates supplied on their catalog targets.

The SchemaType for a RelationalTable is RelationalTableType. The schema attributes for RelationalTable and RelationalColumn also use the TypeEmbeddedAttribute classification method for defining the schema type.


Raise an issue or comment below