hotshot has asked for the wisdom of the Perl Monks concerning the following question:

Hello fellow monks !

I need to examine LDAP and MySQL for parameters repository in our product. I wanted to ask for a little help in finding suitable modules for both suggestions, I tried searching CPAN and got a very long list of modules, lost my head there. Anyone knows good modules for working with LDAP and MySQL or give me a direction?
Also, does anyone have deeper insights of these two and their interaction with perl (pros and cons or what so ever)?

Thanks.

Hotshot

Replies are listed 'Best First'.
Re: LDAP and MySQL modules
by Molt (Chaplain) on May 23, 2002 at 15:32 UTC

    The MySQL answer is simple.. use DBI and DBD::MySQL. With these two you get to interface to it in Perl's standard DBI method, which is both nice and easily transferable to other databases should the occasion arise.

    There's also a lot of MySQL/DBI tutorials about, and you can happily use any non-MySQL DBI tutorial too. O'Reilly also have their nice 'Programming the Perl DBI' book which a nearby bookseller should be willing to exchange for a quick swipe of your credit card.

Re: LDAP and MySQL modules
by lachoy (Parson) on May 23, 2002 at 16:02 UTC

    SPOPS can provide an object-oriented layer over both the DBI and Net::LDAP modules. It takes a little time to learn how it works, but it can be quite powerful for you.

    If you're comparing the two technologies for the same purpose, a couple basic rules for LDAP being useful are: 90%+ of the activity is read-only, you require network and multi-client access (particularly WAN), you need replication and backup services, and (usually the clincher) you need to integrate with existing directory information. Otherwise use MySQL or some other RDBMS. Database skills are much more prevalent than LDAP.

    Chris
    M-x auto-bs-mode

Re: LDAP and MySQL modules
by strat (Canon) on May 24, 2002 at 10:22 UTC
    For LDAP, I prefer using Net::LDAP (on CPAN, called perl-ldap) to using Mozilla::LDAP (called PerLDAP; from http://www.mozilla.org/directory/faq/perldap-faq.html). But Mozilla::LDAP needs a Netscape SDK while Net::LDAP is pure perl (except some modules that are standard within each perl distribution), and in my eyes, Net::LDAP has got a better structure. The only advantage of Mozilla::LDAP I'm aware of is that you can do LDAPS as well.

    Btw: if you do big searches in LDAP-Directories, try to specify a list of wanted attributes. It might speed up your search a lot.

    Best regards,
    perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"

Re: LDAP and MySQL modules
by scottstef (Curate) on May 23, 2002 at 23:47 UTC
    I play with ldap servers and use Net::LDAP, it is fairly simple to use and has sound documentation. There is a Mozilla::LDAP module that you can use, I stay away from it due to the fact that you need to Netscape SDK to make it run. An ldap directory is very efficient for large amounts of relatively static information. It is optimized for frequent reads, and infrequent writes. Typically it is used for information such as enterprise/academic directories, where the information does not change all that frequently.

    "The social dynamics of the net are a direct consequence of the fact that nobody has yet developed a Remote Strangulation Protocol." -- Larry Wall