mods vs bots

Suppose I wanted to query a database from a client. Would the following approach be viable?

A bot that:
1) that maintains a db connection pool
2) connects as a client to an ejabberd server
3) recieves incoming queries from other clients
4) returns results as messages to clients

It is given that those who use the bot know the JID of the bot so that they can interactively query the database. What are the advantages and disadvantages of this versus creating a module for ejabberd? Is it advantageous to let ejabberd only act as a router/switch for messages and then have bots handle the processing of information and then return results? I suppose one major disadvantage would be the lack of discovering the new module; but what if this was not an issue?

any database?

A database... any database, what database? MySQL with the list of incomings in your company, or the Jabber server DB with rosters, accounts...?

From a client? a Jabber client? a MySQL client?

If it's not a time critical, high consuming, high traffic service you can simply write a stand-alone bot accessible via Jabber. There are Jabber bots in several languages that you can write your module for: Neutron in Python, Chatbot in Perl, Sulci in Ocaml, Jhatbot in Java...

details

the bot is supposed to connect to any database at any given time. Also, it's not time critical, high consuming, or high traffic. I think perhaps writing it as a service would be the best way. Thanks for your help...

Syndicate content