3 ms·
Please don't get me wrong I'll love to use openresty, I love nginx, etc. But there are other reasons to use node: ecosystem and npm. Try searching a driver for
by jfroma 11y ago
Please don't get me wrong I'll love to use openresty, I love nginx, etc. But there are other reasons to use node: ecosystem and npm.
Try searching a driver for a not so popular db on npm and you might find two different implementations in addition to the official driver.
I'd love to see something like this on openresty.
- klibertp 11y ago> ecosystem and npm. Yeah. There are "Lua rocks" (https://luarocks.org/ https://luarocks.org/) for Lua, but they have a few hundreds of packages only. Compared to npm there's no comparison at all. On the other hand you wouldn't want to use RDBMS with OpenResty anyway, I think. The whole point of using Nginx scripting (especially with LuaJIT, which is awesome) is to be as fast as possible. True, DB connections are async in Resty, but they are still going to take some time. For simple data that don't need to be persistent it's better to use ngx.shared - an in process dictionary shared between all scripts. For more complicated or persistent data, you have Redis and other fast solutions. Additionally, Nginx offers a full non-blocking socket API to Lua scripts. You can write a "driver" for anything that wants to speak to you over a network.