Hello group, I'm having trouble tracking down info on building Erlang applications embedding CouchDB, as distinct from simply using CouchDB as a datastore. I'm reasonably confident it's because I'm just not picking the right keywords for Google, but any pointers would be highly appreciated.
Here's what I'm trying to achieve... I want to be able to build an application around CouchDB that lets me load in XML documents (i.e. converting XML to JSON within Erlang, rather than via e.g. a Rails application talking to CouchDB). I also want to be able to extract data from CouchDB as XML documents, again doing all the JSON<->XML conversion within Erlang rather than a separate language. The whole thing should work as a Web service (either REST or SOAP would be fine, although I imagine REST should be easier as CouchDB itself has a REST interface). The main reason for wanting to stay totally within Erlang is that we'll be potentially loading in 100s of XML documents per second at peak times, and it needs to be highly available. Eventual consistency is fine, so I can put together a cluster of servers with a load balancer out the front, and have them all replicate with each other. I know how to put together suitable infrastructure under Erlang; what I don't know is how best to tackle it with CouchDB in the mix. Initial questions: - is there a "best practice" way of sending HTTP PUTs containing XML data to CouchDB, and have it convert the XML to JSON within CouchDB? For all I know, it may be as trivial as calling some Javascript library... I'm guessing I'm not the first to want to do this, so hopefully there's a "known good" way of doing this - can I build CouchDB views that output XML directly, or do I need to take JSON out of the view and then convert it to XML "outside of" CouchDB? - is there existing documentation on how to embed CouchDB within Erlang applications, or is the only option to go through the source? As I said, I suspect this info is already out there, but I can't find the right combination of Google keywords to track it down. Thanks in advance David Mitchell
