[MonetDB-users] native socket protocol vs mapi
Hi, I want to be able to use monetdb from common lisp and was looking at the other language bindings for clues on how to write one for cl. Python and Ruby seem to communicate using a socket rather than use the C api. However, in common lisp it's relatively easy to use C bindings (though CFFI) so I'd rather use them if I thought they were going to continue to be supported. Are there any other factors I should consider in deciding which API to use? Many Thanks, Andy
Op 12-01-10 00:27, Andy Chambers schreef:
Are there any other factors I should consider in deciding which API to use?
Basically the dependencies you want to enforce to your users. One of the reasons the socket versions exist is based on the fact you don't have to have installed MonetDB or client libraries on that PC. Using sockets could be faster too. Stefan
On Mon, Jan 11, 2010 at 11:31 PM, Stefan de Konink
Op 12-01-10 00:27, Andy Chambers schreef:
Are there any other factors I should consider in deciding which API to use?
Basically the dependencies you want to enforce to your users. One of the reasons the socket versions exist is based on the fact you don't have to have installed MonetDB or client libraries on that PC.
Is the protocol documented somewhere other than the code? Cheers, Andy
Op 12-01-10 00:38, Andy Chambers schreef:
On Mon, Jan 11, 2010 at 11:31 PM, Stefan de Konink
wrote: Op 12-01-10 00:27, Andy Chambers schreef:
Are there any other factors I should consider in deciding which API to use?
Basically the dependencies you want to enforce to your users. One of the reasons the socket versions exist is based on the fact you don't have to have installed MonetDB or client libraries on that PC.
Is the protocol documented somewhere other than the code?
I thought the Python/PHP implementation was actually an effort te get it documentated. Stefan
On Mon, Jan 11, 2010 at 11:49 PM, Stefan de Konink
Op 12-01-10 00:38, Andy Chambers schreef:
I thought the Python/PHP implementation was actually an effort te get it documentated.
For a half-decent developer that would be enough (it's only about 100 lines of code). I'm just a lame hack without any bit twiddling experience so I don't quite grok __getblock and __putblock yet but I'll figure it out. The C API looked good to me because I've already written one of these for sqlite and the mapi is quite similar. Thanks everyone for the very quick responses. -- Andy
On 11-01-2010 23:38:17 +0000, Andy Chambers wrote:
On Mon, Jan 11, 2010 at 11:31 PM, Stefan de Konink
wrote: Op 12-01-10 00:27, Andy Chambers schreef:
Are there any other factors I should consider in deciding which API to use?
Basically the dependencies you want to enforce to your users. One of the reasons the socket versions exist is based on the fact you don't have to have installed MonetDB or client libraries on that PC.
Is the protocol documented somewhere other than the code?
Unfortunately not. There is a lot of explanatory documentation in the Java implementation though.
Andy Chambers a écrit :
Hi,
I want to be able to use monetdb from common lisp and was looking at the other language bindings for clues on how to write one for cl. Python and Ruby seem to communicate using a socket rather than use the C api.
However, in common lisp it's relatively easy to use C bindings (though CFFI) so I'd rather use them if I thought they were going to continue to be supported.
Are there any other factors I should consider in deciding which API to use?
Many Thanks, Andy
I guess that the standard way to go would be to communicate through a socket. Provides the advantage of running the client on another machine than the server, quite obviously. The C api is fairly exhaustively documented, but not necessarily easy to read. That's one thing to consider. But if you want in the end to have a tight, low-level integration with the server (for example an embedded server), then it's the natural way to go. In the end, I believe both approaches should be supported by a binding. I've chosen the C approach, because OCaml is compiled rather efficiently to machine code, and it would be a shame not to take advantage of it. Concerning Lisp, you may have another opinion. If you go the C way, I'd strongly suggest to first target reproducing example 1.78.6.1 of m5manual.pdf in Lisp. You can have a look at my Objective Caml binding there: http://yziquel.homelinux.org/gitweb/?p=ocaml-monetdb5.git;a=tree The 1.78.6.1 example is reproduced in the test/ directory. All the best, -- Guillaume Yziquel http://yziquel.homelinux.org/
On 12-01-2010 00:44:11 +0100, Guillaume Yziquel wrote:
You can have a look at my Objective Caml binding there:
http://yziquel.homelinux.org/gitweb/?p=ocaml-monetdb5.git;a=tree
I get a "La page est introuvable" (I think a 404) for this url.
Fabian Groffen a écrit :
On 12-01-2010 00:44:11 +0100, Guillaume Yziquel wrote:
You can have a look at my Objective Caml binding there:
http://yziquel.homelinux.org/gitweb/?p=ocaml-monetdb5.git;a=tree
I get a "La page est introuvable" (I think a 404) for this url.
It's on my laptop, and I sometimes take it away with me. Will move the binding to ocamlforge as soon as possible. All the best, -- Guillaume Yziquel http://yziquel.homelinux.org/
Fabian Groffen a écrit :
On 12-01-2010 00:44:11 +0100, Guillaume Yziquel wrote:
You can have a look at my Objective Caml binding there:
http://yziquel.homelinux.org/gitweb/?p=ocaml-monetdb5.git;a=tree
Should now be online. You can also access it over there: https://forge.ocamlcore.org/projects/ocaml-monetdb5/ https://forge.ocamlcore.org/scm/viewvc.php/trunk/?root=ocaml-monetdb5 All the best, -- Guillaume Yziquel http://yziquel.homelinux.org/
participants (4)
-
Andy Chambers
-
Fabian Groffen
-
Guillaume Yziquel
-
Stefan de Konink