Accessing Couchbase via Xojo (RESTful interface)?

Hi guys,

I'm using Xojo (xojo.com) at the moment to write a simple demo application that is parsing transactional records from the Telecommunications industry (so called Call Detail Records, CDR's).

It's a feasibility study where I want to find out if I can get Xojo (which compiles into executable code for Windows, Mac OS or Linux - can also become a web application) to push JSON documents directly to Couchbase via a RESTful interface and call it through HTTPS socket.

It's being briefly described in the Xojo forum like this (and again I hardly have a clue what they talk about):

Before going down the path of writing a database plugin, you might try to figure out if your favorite NoSQL database really matches that model or not. My thinking is or not.
From there, you might consider some other options rather than wrapping the platform C library in a plugin. One is to use declares into the platform C library. Another would be to use (or find) a server-side RESTful interface for your database, and call it through HTTP[Secure]Socket from your apps. From a debugging standpoint, that approach will save you weeks of work. Since you've got a client-server thing going, you shouldn't pay a performance penalty that negates the debuggability advantage.
But back to database plugins... With a fairly standard SQL database and nicely working C client libraries, you could easily get bogged down in the nuances of matching Xojo's Database model to your client libraries. There might be like 5 people who've done that at some point. As one of them, I can tell you, not fun, not cheap.

So my laymen's understanding is that I can push (PUT) a JSON document directly from my app (either desktop or web) to Couchbase. As well as retrieve it out again via a RESTful call (GET) from Couchbase back to my app.

Is that correct or am I completely wrong here? I know there is no plugin existing for Xojo to integrate directly with Couchbase. How can I manage this? Currently both the app as well as Couchbase is running on the same notebook.

Any help is appreciated,

Andreas

1 Answer

« Back to question.

Hello,

Your approach looks like the correct one to me. Note that today Couchbase 2.x does not provide a REST interface out of the box.

Today we have a simple HTTP interface that allows you to store and get data (including JSON), you can find this module here:
https://github.com/couchbaselabs/couchbase-nginx-module

Once you have installed it, you will be able to access the Couchbase cluster from your Xojo application.

Note that we have a specification about a complete REST interface, this specification is available here:
http://www.couchbase.com/wiki/display/couchbase/Design+of+REST+interface...

or it is very easy to develop your own interface.

Maybe it is also possible to look at another approach, where you use the Couchbase client library from your application. You just need to see if you can load external library from Xojo applications.

Regards
Tug
@tgrall