What's a Directory?
Finger: A Simple Directory Service
The WHOIS Directory Service
LDAP: A Sophisticated Directory Service
ADSI (Active Directory Service Interfaces)
Module Information for This Chapter
References for More Information
The larger the information system, the harder it becomes to find anything in that system or even know what's available. As networks grow and become more complex, they are well served by some sort of directory. Network users might make use of a directory service to find other users for email and other messaging services. Resources on a network, like printers and network-available disk areas, might be advertised via a directory service. Public-key and certificate infrastructures could use a directory service to distribute information. In this chapter we'll look at how to use Perl to interact with some of the more popular directory services, including Finger, WHOIS, LDAP, and ADSI.
In Chapter 7, "SQL Database Administration", I suggest that all the system administration world is a database. Directories are a good example of this characterization. For the purpose of our discussion we'll distinguish between "database" and "directory" by observing a few salient characteristics of directories:
Directories are almost always networked. Unlike some databases that live on the same machine as their clients (like the venerable /etc/passwd file), directory services are usually provided over a network.
Databases often have complex query languages for data queries and manipulation. We'll see the most common one, SQL, in the aforementioned Chapter 7, "SQL Database Administration", and in Appendix D, "The Fifteen-Minute SQL Tutorial". Communicating with a directory is a much simpler affair. A directory client typically performs only rudimentary operations and does not use a full-fledged language as part of its communication with the server.
Modern directory services encourage the building of tree-like information structures, whereas databases on the whole do not.
Modern directory servers are optimized for a very specific data traffic pattern. Under normal use, the number of reads/queries to a directory service far outweighs the number of writes/updates.
If you encounter something that looks like a database but has the above characteristics, you're probably dealing with a directory. In the four directory services we're about to see, these characteristics will be easy to spot.
Copyright © 2001 O'Reilly & Associates. All rights reserved.