Mirage OS and Xen - Storing data on a DB

202 Views Asked by At

Which are the best options available if I want my MirageOS unikernel to store some information on an external DB (doesn't matter the type)? I had a look at different solutions but it seems that none of the libraries offering DB bindings are XEN-compatible. Last one I tried is Redis but apparently the ocaml library cannot be compiled for XEN.

1

There are 1 best solutions below

2
On

The Redis code looks like it should work on Xen. It appears (from a quick look) that there is a Redis core module and a separate Redis_lwt that applies it to Lwt_unix. You probably need to write a Mirage-equivalent version of this:

https://github.com/0xffea/ocaml-redis/blob/master/src/redis_lwt.ml

Most bits would be the same, but things using Unix APIs would need changing. E.g the Lwt_unix.socket would need changing to using Mirage's TCP/IP API.