A relational database schema contains information about the structure of the database, including information about the tables, about the columns of each of those tables, and the data types and constraints of each of those columns. In LDAP, the schema provides much the same kind of information, but because information is arranged very differently in a directory server than a relational database, the expression of those schema elements is substantially different.

An LDAP schema may contain several types of elements. Every schema must include at least the following:

  • Attribute Syntaxes define the types of data that can be represented in a directory server.
  • Matching Rules define the kinds of comparisons that can be performed against LDAP data.
  • Attribute Types define named units of information that may be stored in entries.
  • Object Classes define named collections of attribute types which may be used in entries containing that class, and which of those attribute types will be required rather than optional.

LDAP schemas may also include additional elements that can impose further restrictions on the structure of the data in the server. These types of elements are much less common, and some LDAP servers may not support them. They include:

  • Name Forms may be used to restrict the kinds of attributes which may be used as the naming attributes for entries of a particular type.
  • DIT Content Rules may be used to augment object class definitions and further indicate the kinds of attributes that must, may, and must not appear in entries of a particular type.
  • DIT Structure Rules may be used to define information about hierarchical relationships that are allowed to exist in the server.
  • Matching Rule Uses may be used to impose restrictions on the kinds of attributes with which particular matching rules may be used.

Each of these kinds of schema element is described in greater detail in its own section using the links above. However, because many schema elements make use of object identifiers (OIDs) as a means of identifying themselves, you should also read the Object Identifiers section. Similarly, most types of schema elements allow you to include custom extensions with additional information about the element, and the Schema Element Extensions page describes the syntax for these extensions. There are also sections for Retrieving Schema Over LDAP and Updating Schema Over LDAP.