Pattern - Storing configuration information in a Directory Service

Contents

Storing configuration information in a Directory Service

This is essentially one example of a CMDB. It is notable that directory services can be used for locating other services on a network (their original purpose), but they can equally easily store any hierarchical form of information.

Microsoft Active Directory is one example of this; Windows 2000 and successors have explicit support for directory services when the platforms are added to a Windows 2000+ domain.

Features

  • Hierarchial representation of information.
  • Information types may vary with the implementation, from ASN.1-described structures to simple strings.

Advantages

  • Distributed, usually in a hierachical/delegated form.
  • Hierachical representation
  • Directory Service may have a good security model.
  • Directory Service may be fault tolerant through replicated and cached data.
  • Common APIs often LDAP provide access to the service.
  • LDAP is Unicode aware.
  • Directory service may support save/restore of application-specific data.
  • There's some specific support in Java with the javax.naming APIs.

Disadvantages

  • Needs ubiquitous application/client-side support to be useful.
  • Directory Services tend to be unhappy about applications saving megabytes of data.
  • LDAP is a pretty painful API to work with.
  • Unless the Directory Service is fault tolerant, it becomes a Single Point of Failure
  • The javax.naming APIs are painful.

SmartFrog support

We've sometimnes contemplated adding an LDAP API for access to the SmartFrog data, so that client programs don't need to be built specifically for SmartFrog; they just get their context set for them. However, time spent looking at the javax.naming APIs have left us unsure that this particular approach would be a good use of anyone's time. One particular concern is the InitialContext, which is provides the starting point for resolution. This is effectively set on a thread-by-thread basis. Within an EJB implementation, the bean runtime must switch contexts before a bean method is invoked (remember, EJB does not allow beans to run/switch threads). In SmartFrog we are less thread strict, and as every component can have its own equivalent of an initial context, we'd have a hard time managing context switching -you'd have to play injection or interception tricks to pull this off.

History

The first directory service was probably Grapevine, from Xerox Parc. However, DNS is also a restricted form of a directory service, one that scales well, but which is limited in what services it describes.

Get SmartFrog at SourceForge.net. Fast, secure and Free Open Source software downloads