0

I would like to know the differences between LDAP and DB.

Why people say LDAP is faster than DB. Why is it called lightweight.

I have read many docs through google and stackoverflow but I could not conclude the exact differences between.

I want to get a clear understanding of the differences between them.

Sawyer
  • 171
  • 2
  • 12

3 Answers3

1

LDAP is an abbreviation for Lightweight Directory Access Protocol and there are several different LDAP capable servers implementations.

LDAP is a protocol. LDAP is lightweight as it was derived from Directory Access Protocol and because the message exchange is lightweight.

LDAP has only 14 basic requests-response messages.

LDAP data is arranged in a Hierarchical fashion vs SQL which is data that is relational.

For almost all comparable operations, LDAP server implementations are faster than most SQL server implementations.

Community
  • 1
  • 1
jwilleke
  • 10,467
  • 1
  • 30
  • 51
0

Not sure what you have read about LDAP, but as you refer to a SQL DB, you most likely think that LDAP is a kind of relational database which can be used as a data storage for everything.

The Lightweight Directory Access Protocol is a technology that originated from the development of X.500 protocol specifications and implementations. LDAP was designed as a means of rapidly searching through X.500 information. Later LDAP was adapted as an engine that could drive its own directory database. LDAP is not a database per se; rather it is a technology that enables high-volume search and locate activity from clients that wish to obtain simply defined information about a subset of records that are stored in a database. LDAP does not have a particularly efficient mechanism for storing records in the database, and it has no concept of transaction processing nor of mechanisms for preserving data consistency. LDAP is premised around the notion that the search and read activity far outweigh any need to add, delete, or modify records. LDAP does provide a means for replication of the database to keep slave servers up to date with a master. It also has built-in capability to handle external references and deferral. [Source]

In other words, there are LDAP protocol and LDAP server. The protocol is used for accessing a directory, which can be external, such as Microsoft Active Directory, or internal, on LDAP server that has own application specific database. Read What is LDAP used for?, When to use LDAP over a database?, and many other similar topics.

P.S. it's called "lightweight" because it's a subset of another protocol (X.500) which is complex and heavyweight. See https://support.microsoft.com/en-us/kb/196455

Community
  • 1
  • 1
user2316116
  • 6,726
  • 1
  • 21
  • 35
0

LDAP search is based on tree data structure which makes it faster than a relational database where search is sequential.

For example if you have stored telephone numbers from all over the world using both LDAP and relational database and now you want to find telephone number of a person who lives in London:

  1. Relational database would use 'WHERE' clause to sequentially traverse the records unless it finds the matching record
  2. LDAP would search the number base on the Location(Continent/Country/City/Area/Street) attribute of the person and would skip the irrelevant tree nodes and quickly reach the node having the given telephone number.