SQLite Forum

[Feature Request] make SQLite support asynchronous io
Login
Thanks for the reply.

It seems that this behavior (`libaio` + `fsync`) is not clear in Linux:
  
> [1] https://github.com/axboe/fio/issues/1179  
  [2] https://github.com/axboe/fio/blob/fio-3.25/engines/libaio.c#L256-L268

The point I want to make actually isn't to use `libaio` + `fsync`. Rather, it is to make SQLite support asynchronous IO. `libaio` is just one of the aio engines. `uring io` is another good one.

The reason is that new storage media like NVMe SSD provides a highly paralleled IO structure. Only the aio can utilize this, while synchronous IO makes IOs become serialized.

AFAK, (this libaio function)[https://man7.org/linux/man-pages/man2/io_submit.2.html]: `int io_submit(aio_context_t ctx_id, long nr, struct iocb **iocbpp);` In the argument `iocb`, there is a field `aio_rw_flags`, one of whose value is `RWF_SYNC` (write operation complete according to requirement of synchronized I/O file integrity). I think one possible solution of `libaio` is to leverage this flag. 

Further, I also did some `fio` tests in new NVMe devices using `uring_io` engine. It is very fast which can largely utilize the internal parallelism of NVMe. So could it possible to make SQLite support this?

Thanks!