What can you say about this library https://github.com/mmottl/sqlite3-ocaml
How has been your experience?
Are there other better libraries for Sqlite3 that you’d recommend?
In general, what’s the difference bindings to a db library and original implementation of that library?
At LexiFi we have been using these bindings in production for a while now and they have worked very well.
I’ve used it and happy with it. It is a low-level interface to the library, though, so you might want to wrap it up to suit your use case.
I’m not sure what you mean. Sqlite is a library that implements a database and offers an API for users to interact with. sqlite3-ocaml is a library that lets Ocaml users use it.
Why is it called “bindings” to Sqlite3?
Because it does not reimplement the
sqlite library in OCaml, it merely exposes (“binds”) the existing C library to OCaml by using the OCaml FFI (OCaml - Interfacing C with OCaml).
That is the noun used to describe a library in one language that allows using a library written in a different language.
Does it hurt performance?
As with most things: it depends.
Generally there is some overhead because each language may not represent its data in memory the same. Whether or not this is a problem depends on how you’re using it. If you’re doing incredibly high performance work, sqlite may be the wrong choice in the first place.
For comparison, using a database like Postgresql or Mysql involves your program reaching out over a socket and talking to another computer, which is, often, much more expensive than talking to something running in the same memory as your program.
My question is about Sqlite only. Why do you compare “Sqlite” with “Postresql, Mysql”?
You asked a question about performance, I was offering a comparison to other databases of the relative cost of performing a database operation.