3 Designing the directory schema

The site survey conducted in Chapter 2 “Planning the directory data” revealed information about the data which will be stored in the directory. The directory schema describes the types of data in the directory, so determining what schema to use reflects decisions on how to represent the data stored in the directory. During the schema design process, each data element is mapped to an LDAP attribute, and related elements are gathered into LDAP object classes. A well-designed schema helps to maintain the integrity of the directory data.

This chapter describes the directory schema and how to design a schema for unique organizational needs.

For information on replicating a schema, see “Schema replication”.

3.1 Schema design process overview

During the schema design process, select and define the object classes and attributes used to represent the entries stored by HP-UX Directory Server. Schema design involves the following steps:

1.Choosing predefined schema elements to meet as many of data needs as possible.

2.Extending the standard Directory Server schema to define new elements to meet other remaining needs.

3.Planning for schema maintenance.

The simplest and most easily-maintained option is to use existing schema elements defined in the standard schema provided with Directory Server. Choosing standard schema elements helps ensure compatibility with directory-enabled applications. Because the schema is based on the LDAP standard, it has been reviewed and agreed to by a wide number of directory users.

3.2 Standard schema

The directory schema maintains the integrity of the data stored in the directory by imposing constraints on the size, range, and format of data values. The schema reflects decisions about what types of entries the directory contains (like people, devices, and organizations) and the attributes available to each entry.

The predefined schema included with Directory Server contains both the standard LDAP schema as well as additional application-specific schema to support the features of the server. While this schema meets most directory needs, new object classes and attributes can be added to the schema (extending the schema) to accommodate the unique needs of the directory. See “Customizing the schema” for information on extending the schema.

3.2.1 Schema format

Directory Server bases its schema format on version 3 of the LDAP protocol. This protocol requires directory servers to publish their schema through LDAP itself, allowing directory client applications to retrieve the schema programmatically and adapt their behavior accordingly. The global set of schema for Directory Server can be found in the cn=schema entry.

The Directory Server schema differs slightly from the LDAPv3 schema, because it uses its own proprietary object classes and attributes. In addition, it uses a private field in the schema entries, called X-ORIGIN, which describes where the schema entry was defined originally.

For example, if a schema entry is defined in the standard LDAPv3 schema, the X-ORIGINfield refers to RFC 2252. If the entry is defined for the Directory Server's use, the X-ORIGINfield contains the value Netscape Directory Server.

For example, the standard person object class appears in the schema as follows:

3.1 Schema design process overview 27