Regardless of the type of information that you contain in your Directory Server, you should never change the standard schema. If this standard schema proves to be too limiting for your uses, you should extend it to support your unique requirements. You should never delete standard schema elements from your server, nor should you ever completely replace the standard schema with a schema of your own design. Doing so can lead to interoperability problems with other directory services or other LDAP clients.
To help you extend your schema, the Netscape Directory Server includes a schema management tool. For more information, see the Netscape Directory Server Administrator's Guide.
When You Should Extend Your Schema
While the object classes and attributes supplied with the Directory Server should meet most of your needs, you will probably find that a given object class does not allow you to store specialized information about your organization. Or you may be using the Directory Server to support an LDAP-capable application, in which case you will need to extend your schema to support the object classes and attributes required by the application's information needs.
When to Add New Object Classes and Attributes
Add new attributes only when you add new object classes. If you find that you need to add an attribute to a standard LDAP object class, then you should:
Create a new object class. Define its parent object class to be the object class on which you wanted to add the attribute.
Add the new attribute on the new object class.
You should do this whenever you find that an existing object class structure does not support every kind of information that you want to store in your directory. Most frequently this occurs when you find that you want to store more information on a person entry than the person, organizationalPerson, or inetOrgPerson object classes support.
For example, you might want to store birth dates in your directory. No attribute for this information exists within the standard Netscape Directory Server schema, so you may choose to create a new attribute called dateOfBirth and allow this attribute to be used on entries representing people.
You should always look for an existing attribute that meets your needs before you extend your schema to include new attributes and object classes.
Object Class Strategies
There are two approaches you can take to new object class creation:
For example, suppose your site wants to create the attributes dateOfBirth, preferredOS, buildingFloor, and vicePresident. Then you can create several object classes to allow the usage of some subset of these attributes. For example, you might create an object class called airiusPerson and have it allow dateOfBirth and preferredOS. The parent of airiusPerson could be inetOrgPerson.
Note. You should avoid requiring attributes on new object classes if possible.
Requiring attributes tend to make your schema inflexible. It is best to allow
rather than require attributes when you create new object classes.
You might also create an object class called airiusOrganization and have it allow buildingFloor and vicePresident. The parent of airiusOrganization might be the organization object class.
For example:
airiusPerson
superior
inetOrgPerson
allowed
dateOfBirth,
preferredOS
airiusOrganization
superior
organization
allowed
buildingFloor,
vicePresident
Alternatively you can create a single object class that allows all of these attributes and use it with any entry on which you want to use one or more of these attributes. It is best not to define any required attributes for this kind of an object class because you cannot be sure that you will want to always use a given attribute for every entry on which the object class will be included. For example:
airiusEntry
allowed
dateOfBirth,
preferredOS,
buildingFloor,
vicePresident
Both strategies work equally well, and neither seems to offer a clear administrative advantage over the other. However, depending on your situation and your personal preferences, you will probably find one approach works a little better for you. Some things to consider are:
- Multiple object classes will result in more schema elements that you must create and maintain. However, the total number is likely to be reasonably small in even the most complex situations (one for each kind of object class structure that you might be using), and once the object classes are created there is very little administrative overhead to managing them. Still, you may find that it is easier for you to use a single object class if you find yourself considering adding more than two or three object classes to your schema.
- The multiple object class approach requires that you to be more careful and a lot more rigid in your approach to data design. This is because a structured approach forces you to consider the object class structure on which every piece of data will be placed. Depending on your personal preferences, you will find this to be either helpful or cumbersome. Pick the approach that works best for you.
- Using a single object class for everything is very useful if you find that you have data that you want to put on more than one type of object class structure. For example, suppose you want preferredOS on both a person and a group entry. Then you may want to create only a single object class to allow this attribute.
- There are no prohibitions, either technically or administratively, to mixing the strategies. If you find, for example, that it is best to create a few structural object classes, as well as another single object class to be used everywhere, then you should do that. There is nothing in the protocol or in the Netscape implementation that prevents you from doing this.
A Consistent Schema
It is important that you use a consistent schema within your Directory Server because LDAP clients locate entries in your directory by searching for object classes or attributes and their associated values. If you use an inconsistent schema, then it becomes very difficult to locate information in your directory tree efficiently.
An example of an inconsistent schema is a situation where you use an attribute to store a specific kind of information, and then later use a different attribute to store the exact same kind of data. Another example of an inconsistent schema is if you use multiple formats to store the same kind of information. That is, do this:
telephoneNumber: +1 555 123-4567
telephoneNumber: +1 555 123-2468
telephoneNumber: +1 555 123-3579
telephoneNumber: +1 555 123-1470
Do not do this:
telephoneNumber: (555) 123-4567
phone: +1 555 123-2468
phoneNumber: 123-3579
telephone: 1 555 123 1470
Further, LDAP clients are designed to work with a specific, well-defined schema. For the most part, the schema that these LDAP clients are designed to work with is the standard LDAP schema which is based on the X.500 standard. For this reason, most LDAP-based directory services begin with the standard LDAP schema, but then the schema is extended as the site discovers site-specific needs that are not met by the standard schema.
The Netscape LDAP schema takes this approach as well. Most of the schema elements are based on the LDAP standard. However, Netscape has extended the schema to allow for directory activities that are commonly performed by Netscape's customers. In addition, Netscape ships LDAP clients that expect the schema to appear as defined by Netscape.
You can enforce your Directory Server's schema by turning schema checking on. When schema checking is turned on, you cannot add an object class or attribute to your Directory Server that does not conform to the schema. For more information on schema checking, see the Netscape Directory Server Administrator's Guide (http://home.netscape.com/eng/server/directory/4.1/admin/ ).
Schema Extension Frequently Asked Questions
These are common questions that people new to the Directory Server tend to ask when they first extend their schema:
I want to represent x in my directory. Is there a standard attribute that I can use to do this?
What you should do when you are looking for an attribute for use with your directory is to first become familiar with the more common attributes as defined in the Netscape Schema Reference Guide.
If none of those common attributes seem to be appropriate for your needs, then try browsing through the total list of attributes using the Directory Server schema management tool. To narrow your search, consider the type of entry that the data represents (a person, an organization, a device, and so forth), and then examine those object class structures that define that type of an entry.
If you still cannot find a likely candidate, then extend your directory schema to support your informational needs. After all, if a standard attribute does actually exist that could support you, then it is probably so obscure or poorly named that few people will actually expect to find it in your directory.
Should I delete unused attributes/object classes from my schema?
In short, no. Unused schema elements represent no operational or administrative overhead for your directory. You gain nothing by deleting them, and you potentially create future coexistence problems by supporting only a subset of the standard LDAP schema.
Of course, if you have defined a new schema element for your directory and you have found that you are not using it, then by all means delete it from your schema. (However, first make sure that your directory data is not using it!) No harm can come from removing unused schema elements from your directory that are specific to your enterprise.
I am building a global directory, and I have data that I use in one part of the world that is not used in another part of the world. Do I have to make sure my schema extensions are defined worldwide?
It is not strictly necessary to use the same schema enterprise-wide, but in practice it is a very good idea to do so. This is because to support a large-scale directory, you are using replication to move data between servers. This means that whenever some piece of data is replicated to a server, that server must recognize the attribute used to represent the data. If the consuming server does not recognize the attribute, then the replication operation fails and the servers in your directory become out of synch.
The most likely reason why you might be replicating data to a server that does not recognize the schema used by that data is if you defined new data in your supplier server and you forgot to update the schema in your consumer server.
Remember that your goal should be to make your directory easy to administer. It is best to ensure that your schema is defined consistently across your entire enterprise, just in case you one day want to replicate a piece of data that you had not originally intended to replicate.
|