Assuming this conceptual setup:
- ejabberd cluster (either instances in cloud or hosted SaaS)
- ejabberd MySQL database (some hosted solution elsewhere)
- website instances
- website MySQL database (same place as ejabberd database, but different database)
Also relevant is that currently the website instances already directly access the ejabberd MySQL database, in order to add new users (no need for rosters and other stuff like that, so xml_rpc overhead is avoided- though that might change in the future).
Now I want to write a module which will store presence info in a database that can be accessed from the website.
Which solution would be better for scalability and stability?
Add a new table to the ejabberd MySQL table and use the same sort of code that's used elsewhere in ejabberd for talking to the database to write presence info
Spin off http requests and let the webserver do the writing
I'm not familiar with Erlang and where the hangups/bottlenecks might be... I guess the two approaches are somewhat similar, and the database approach will be better since there's already internal support for connection pooling... but just wanted to check before starting to code.