Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using LDAP server as a storage base, how practical is it?

Tags:

database

ldap

I want to learn how practical using an LDAP server (say AD) as a storage base. To be more clear; how much does it make sense using an LDAP server instead of using RDBMS to store data?

I can guess that most you might just say "it doesn't" but there might be some reasons to make it meaningful (especially business wise);

A few points first;

  • Each table becomes a container entity and each row becomes a new entity as a child. Row entities contains attributes for columns. So you represent your data in this way. (This should be the most meaningful representation I think, suggestions are welcome)
  • So storing data like a DB server is possible but lack of FK and PK (not sure about PK) support is an issue. On the other hand it supports attribute (relates to a column) indexing (Not sure how efficient). So consistency of data is responsibility of the application layer.

Why would somebody do this ever?

  • Data that application uses/stores closely matches with the existing data in AD. (Users, Machines, Department Info etc.) (But still some customization is required to existing entity schema, and new schema definitions are needed for not very much related data.)
  • (I think strongest reason would be this: business related) Most mid-sized companies have very well configured AD servers (replicated, backed-up etc.) but they don't have such DB setup (you can make comment to this as much as you want). Say when you sell your software which requires a DB setup to these companies, they must manage their DB setup; but if you say "you don't need DB setup and management; you can just use existing AD", it sounds appealing.

Obviously there are many disadvantages of giving up using DB, feel free to mention them but let's assume they are acceptable. (I can mention more if question is not clear enough.)

like image 732
yusuf Avatar asked Feb 21 '11 11:02

yusuf


People also ask

How is LDAP server data stored?

LDAP stores and arranges data in a hierarchical structure called DIT (Directory Information Tree) to make it easy for admins to explore their directories and user access policies. This lightweight protocol is an alternative protocol that allows the admin to access x. 500 directory services with TCP/IP protocol.

Does LDAP store data?

LDAP, or Lightweight Directory Access Protocol, is an open protocol used to store and retrieve data from a hierarchical directory structure. Commonly used to store information about an organization and its assets and users, LDAP is a flexible solution for defining any type of entity and its qualities.

Is LDAP scalable?

Where LDAP really shines is scalability. If you specifically want a place to hold user accounts for authentication and want to scale to multiple replicated servers - and handle tends of thousands of authentication requests a second, LDAP is an great option.

What is the use of LDAP server?

An LDAP server, also called a Directory System Agent (DSA), runs on Windows OS and Unix/Linux. It stores usernames, passwords, and other core user identities. It uses this data to authenticate users when it receives requests or queries and shares the requests with other DSAs.


1 Answers

LDAP is a terrible tool for maintaining most business data.

Think about a typical one-to-many relationship - say, customer and orders. One customer has many orders.

There is no good way to represent this data in an LDAP directory.

You could try having a mock "foreign key" by making every entry of that given object class have a "foreign key" attribute, but your referential integrity just went out the window. Cascade deletes are impossible.

You could try having a "customer" object that has "order" children. However, you've just introduced a specific hierachy - you're now tied to it.

And that's the simplest use case. Once you start getting into more complex relationships, you're basically re-inventing an RDBMS in a system explicity designed for a different purpose. The clue's in the name - directory.

If you're storing a phonebook, then sure, use LDAP. For anything else, use a real database.

like image 78
superdupersheep Avatar answered Nov 14 '22 23:11

superdupersheep