[ANN] orewa 0.1.0, a redis binding (initial release)

Hi there,

For a while I was frustrated by the somewhat lacking state of Redis support in OCaml especially when it comes to supporting Async so I decided to reinvent the wheel again and see how a binding to Redis would look like if it was designed with non-blocking execution in focus.

The result is Orewa, which I have released as 0.1.0 recently. So far it supports most or even all of the Redis 5.0 string operations and a somewhat randomly picked set of other instructions.

There are a couple of considerations I had when building it:

  • Be non-blocking first. It supports Async for now since that is what I use and what is lacking the most in the current ecosystem. I tried to be thread-safe, we’ll see if I was successful in doing so.
  • Avoid exceptions to avoid unwanted surprises.
  • Have a somewhat typesafe API. The Redis protocol is mostly stringly-typed and this binding tries to wrap this into a bit of a more typed interface:
    • No distinction between millisecond and second resolution commands, you specify the duration as a timespan and Orewa does the rest
    • The results are parsed into the expected data type if possible
    • The arguments try to reduce the possible misuse. There is still some misuse possible, so this current release tries to strike a balance of typing vs similarity with the Redis documentation

The documentation is on GitHub and it is installable from OPAM.

8 Likes

As an update, @fugmann contributed pipelining support and also simplified the parser so starting with 0.2.0 you can issue as many requests as you want, they will get answered by Redis in order.

2 Likes