Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

JNDI overview, Part 2: An introduction to directory services

Use JNDI directory services to better manage your distributed applications

  • Print
  • Feedback
Return with me, for a moment, to last month's point of departure. I introduced you (or reintroduced you, as the case may be) to that aged institution known as a library. I did so in order to draw an analogy between a physical tool known as a card catalog and a programming tool known as a naming service. The key to this analogy was the simple notion of looking something up by name in a centralized repository in order to more quickly determine its location. In a library, the card catalog maps the names of books to references to their locations on the shelves; in a distributed system, the naming service maps the names of objects to references to their locations in a network. Both tools are extremely useful in their respective domains.

TEXTBOX:

TEXTBOX_HEAD: JNDI overview: Read the whole series!

:END_TEXTBOX

It turns out that, with little effort, I can stretch this analogy even farther. You see, a card in a card catalog contains more than just a book's location; it also contains the author's name, the date the book was published, the book's length, and many other useful bits of information. I can find out a lot about the book without actually having to go and get it.

In the domain of computer software, tools that provide this type of information are known as directories. It appears that, once again, a technique popularized long ago by librarians has turned out to be useful to software developers. (It makes me wonder what other little gems lie hidden within the infrastructure of the corner library.)

An introduction to directory services

A directory service provides a way to manage the storage and distribution of shared information. Such information can range from the email addresses and phone numbers of a company's employees, to the IP addresses and print capabilities of a department's printers, to the configuration information for a suite of application servers.

The figure below depicts a generic directory service.

A generic directory service



A directory service manages a directory of entries. A directory entry can refer to a person, place, service, or almost any other concrete object or abstract concept. An entry also has attributes associated with it; an attribute consists of a name or identifier and one or more values. These attributes describe the entry, and the exact set of attributes depends on the type of the entry. For example, the entry for an individual might have the following attributes (note the two email addresses):

Name: John Doe
Address: 123 Somewhere Street
Email: john@xyz.com
Email: jdoe@abcd.com


Directory services are simple databases. Like their relational cousins, many common directory services provide search and filter functionality. Instead of locating an entry only by name, these directory services allow you to locate entries based on a set of search criteria.

  • Print
  • Feedback

Resources