Thursday, 23 April 2015

Why LDAP?Why not Database?

I liked the below explanation which I read on why to choose LDAP ..Read and enjoy the concept..

The use model is similar like how people use library cards or phonebooks. When you have a task that requires “write/update once, read/query many times”, you might consider using LDAP. LDAP is designed to provide extremely fast read/query performance for a large scale of dataset. Typically you want to store only a small piece of information for each entry. The add/delete/update performance is relatively slower compared with read/query because the assumption is that you don’t do “update” that often.

Imagine you have a website that has a million registered users with thousands of page requests per second. Without LDAP, every time users click a page, even for static page viewing, you will probably need to interact with your database to validate the user ID and its digital signature for this login session. Obviously, the query to your database for user-validation will become your bottleneck. By using LDAP, you can easily offload the user validation and gain significant performance improvement. Essentially, in this example, LDAP is another optimization layer outside your database to enhance performance, not replacing any database functions.

LDAP is not just for user validation, any task that has the following properties might be a good use case for LDAP:

1) You need to locate ONE piece of data many times and you want it fast

2) You don’t care about the logic and relations between different data

3) You don’t update, add, or delete the data very often

4) The size of each data entry is small

5) You don’t mind having all these small pieces of data at a centralized place
========================================================================
Some Q&A

First Question: Why do we have to use LDAP instead of Database?
LDAP is more of hierarchical and database is relational.
Faster Reads in LDAP and Faster writes in Database.Database can be used to implement the same functionality, only not with the same performance (i.e. not read-optimized).

Second Question: What factors determine to use LDAP over DB and DB over LDAP?
If your application does mostly reads on the information being stored into LDAP/DB and performance is a priority, then LDAP could be considered for its better performance.
On the other hand, if you're out of budget, you may not be able to get the "extra" LDAP server but are forced to stick with the database.

No comments:

Post a Comment