1 What is LDAP
LDAP is a protocol used to publish directory information to many different resources. Usually it is used as a centralized address book, but it can be more powerful depending on the needs of the organizer.
The most basic form of LDAP is a standard way to connect to a database. The database is optimized for read queries. So it can get the results of the query quickly, but in other ways, such as updates, it's much slower. To be particularly focused, LDAP is often used as a hierarchal database rather than as a relational database. Therefore, its structure is better represented by a tree than by a table. Because of this, you cannot use SQL statements.
In short, LDAP is a quick way to get centralized, static data about people or resources.
LDAP is the abbreviation for Lightweight Directory Access Protocol (Lightweight Directory Access Protocol), in fact a phonebook, similar to what we use such as NIS (Network information Service), DNS ( Domain Name Service), and similar to the trees you see in the garden.
LDAP is an extraordinary database. But it's important to understand that LDAP is different from the general database. LDAP optimizes queries and has a much better read performance than write performance.
1.1 Storage rules for LDAP
Distinguished Name (dn,distinguished name)
Unlike the trees in nature, the file system/ldap/each piece of the phone book directory has at least one unique attribute that can help us to differentiate between the branches and leaves.
In the file system, these unique properties are the file names with the full path. For example/ETC/PASSWD, the filename is unique under the path. Of course we can have/usr/passwd,/opt/passwd, but according to their full path, they are still unique.
In LDAP, the distinguished name of an entry is called "DN" or is called a distinguished name. This name is always unique in a directory. For example, my DN is "Uid=aghaffar, Ou=people, o=developer.ch". It is impossible to have the same DN, but we can have a DN such as "Uid=aghaffar, Ou=administrators, o=developer.ch". This is similar to the example of/etc/passwd and/USR/PASSWD in the file system above.
We have unique attributes, UID in "ou=administrators, o=developer.ch" and uid in "Ou=people, o=developer.ch". This is not contradictory.
Cn=common name is the username or server name, up to 80 characters long, can be Chinese;
Ou=organization Unit for organizational units, up to four levels, each level of up to 32 characters, can be Chinese;
O=organization is the name of the organization, you can 3