Hello,
I wanted to share my opinion on this matter.
I have personally found myself in a situation where I would like to use sqlite for dev with openresty. I've also had similar situations with a litany of other applications not including sqlite. I agree with Robert that embedding things into openresty for convenience are antithetical to nginx and openrestys design goals. There is already a fairly steep learning curve to nginx and openresty. New users must understand lua, luajit, nginx, code cache, shared dict, how to find a proper module that fits openresty (ie not using socket etc). Adding sqlite will add a new world of bugs and development issues around multiple worker processes reading/writing the same sqlitedb at the same time. This may be an acceptable issue for development but it is certainly not viable for software aimed at horizontal scalability.
IMHO, I think there are two 'issues' here.
- The desire for a single statically compiled binary
- The need for a 'buffering layer' in IO intensive operations.
The first issue is somewhat achievable with lua byte code and AR. Lately I've been wondering what would go into creating ngx modules in golang. It's certainly possible, but I have not tried. This would open a lot of new possibilities.Another possibility is encapsulating the entire openresty package inside a compiled go binary (a'la bindata). Or maybe even something like afero fs.
The second issue is a bit more involved. There is a need to perform blocking operations in a non-blocking way. There is one project that provides an insecure C daemon that accepts subshell commands over a unix socket. I think this module has great importance and has been overlooked. I think an interesting compromise here is a new type of worker process like the master proc. It would be very nice to have a monitored process within nginx that is capable of executing subshell calls or heavy weight IO operations without blocking the workers entirely.
If this additional process had a flexible API, none of these ecosystem gripes would exist. Plainly put, if you want sqlite, you should be able to delegate these transactions to a dedicated process and wait for a response in a non-blocking way.
Anyways, just my opinion.
-Brandon