Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 38 ยท Getting Started

What Is a Directory Service?

Learn what a directory service is, how it differs from a database, and why organizations use LDAP and Active Directory to manage users and resources.

Every organization has to answer the same questions again and again. Who is this person? Which computers do they own? Which printers may they use? Which groups are they part of? A directory service is a specialized system that stores this kind of information and answers these questions quickly, from anywhere in the network.

In this track you will learn two names that appear together all the time: LDAP, the open protocol used to talk to directories, and Active Directory (AD), Microsoft's directory service that speaks LDAP and Kerberos. This first lesson explains the problem directories solve and what makes them different from the databases you may already know.

A note on honesty: a real directory server cannot run on this page. Everything you read about commands and menus describes the real products. The live examples are small stand-ins written in Python that mimic how a directory stores and finds entries, so you can experiment with the ideas. They are teaching models, not real servers.

What a directory holds

People Accounts, names, emails.
Devices Computers and printers.
Groups Who belongs to what.
Credentials Passwords and keys.

One shared source of truth for identity

1 / 2

The problem: identity everywhere

Imagine a company with 500 employees and twenty applications: email, file shares, the wiki, the VPN, the payroll system. If every application keeps its own list of users, then onboarding a new employee means creating twenty accounts, and offboarding means remembering to delete twenty accounts. Forget one and a former employee still has access. Change a phone number and it is wrong in nineteen places.

A directory service fixes this by keeping one authoritative copy of identity data. Applications ask the directory: "Does this user exist? Is this password right? Which groups is she in?" When HR disables an account in one place, every connected application sees the change.

What is stored in a directory

A directory is a collection of entries. Each entry describes one thing in the real world, such as a person, a group or a printer, using attributes, which are named values:

Entry Example attributes
A person name, email address, phone number, department, manager
A group name, list of members
A computer hostname, operating system, location
A printer name, model, room, queue address

Notice that these are all small, descriptive records. They are looked up far more often than they are changed. A user's phone number might be read thousands of times a day and updated once a year.

Directory versus relational database

You can store the same data in a SQL database, so why have a separate kind of system? The two are tuned for different jobs.

Property Directory (LDAP) Relational database (SQL)
Typical workload Mostly reads, rare writes Mixed reads and writes
Data shape A tree of entries Tables and rows
Schema Object classes define allowed attributes Table columns define fields
Transactions Simple, per-entry Rich, multi-table
Joins None Central feature
Replication Built in, usually multi-master Varies by product
Standard access protocol LDAP Vendor drivers and SQL

A directory is optimized to answer "find the entry whose uid is asmith" in a few milliseconds, even with millions of entries, and to scale reads by adding replicas. It deliberately gives up complex joins and multi-row transactions. If you need to compute quarterly revenue, use SQL. If you need to know whether asmith may log in, use a directory.

An LDAP directory is not "a database that is worse at SQL". It is a database specialized for lookup, with a standard network protocol and a standard way to describe people, groups and devices.

Naming: how entries are found

Entries in a directory are arranged in a tree. Every entry has a unique name that describes its position, called its distinguished name (DN). You will study DNs in detail in Distinguished Names. For now, picture a file system: the full path tells you exactly where a file lives, and the DN does the same for an entry.

A first stand-in directory

Let's model a tiny directory in Python. It is just a dictionary keyed by a name, where each value is a set of attributes. The lookup function mimics what a directory is good at: find entries whose attribute matches a value.

Python A tiny directory (Python stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A real server indexes attributes such as uid and mail, so these searches stay fast with millions of entries. Our dictionary scans every entry, which is fine for three records.

Directory services you will meet

Several products implement the directory idea:

  • OpenLDAP: a popular open-source LDAP server, common on Linux.
  • 389 Directory Server / Red Hat IdM / FreeIPA: open-source servers in the Red Hat family.
  • Microsoft Active Directory: the dominant directory for Windows networks.
  • Microsoft Entra ID (formerly Azure AD): a cloud identity service. It is related to AD but uses different protocols, mainly OAuth, OpenID Connect and SAML rather than LDAP.
  • Apache Directory Server, ApacheDS, Oracle Directory services and others.

This track focuses on the LDAP protocol and Active Directory, because together they cover most enterprise directories you will meet.

What a directory does for you

Common uses include:

  1. Authentication: checking a username and password (or a ticket) once, centrally.
  2. Authorization: deciding what a user may do, usually through group membership.
  3. Address book: names, phone numbers and emails for people and rooms.
  4. Configuration: storing settings that apply to many machines, such as Group Policy in AD.
  5. Resource lookup: finding printers, file shares and services.

A directory holds everything an attacker wants: names, group memberships and password hashes. Later chapters on security cover how to protect it. Treat directory servers as your most sensitive infrastructure.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which workload is a directory service optimized for?

    Directories are tuned for fast lookups of small entries. They are read far more often than written.
  2. 2. What is an attribute?

    An entry is described by attributes such as cn, mail and department.
  3. 3. Why is one central directory better than per-application user lists?

    One authoritative copy means a disabled account is disabled everywhere that trusts the directory.
  4. 4. Which of these is the open protocol used to talk to directories?

    LDAP is the Lightweight Directory Access Protocol. Active Directory also supports it.

Summary

  • A directory service stores identity and resource information once and shares it across many applications.
  • Entries describe real things (people, groups, computers) using attributes and are organized in a tree.
  • Directories favor fast reads, built-in replication and a standard protocol (LDAP) over complex joins.
  • Active Directory is Microsoft's directory; OpenLDAP and 389 DS are common open-source ones.
  • Directories handle authentication, authorization, address books, configuration and resource lookup.

Next: LDAP History and Versions