HACKER Q&A
📣 mitjafelicijan

Should I choose NJS or Lua to extend Nginx


I am working on a simple key value store for a project. I want to avoid messing with python server like uwsgi and having a reverse proxy and would like to take this opportunity to work with nginx.

I noticed that they added NJS, and they are heavily promoting that. Which one should I use? I will be saving and retrieving files from a disk (cca 200mb per file).


  👤 mitjafelicijan Accepted Answer ✓
I know about the ngx_http_keyval_module. I, however, would need to make this distributable with something like Raft consensus protocol. Or something similar to that, and I would like to avoid coding this in C if possible.

Maybe the solution could be something hybrid between already existing plugins and then do only the distribution part of the thing.


👤 smt88
Nginx does that natively. The key is the file name and the store is the disk. You can transform URLs using config files, if needed.

👤 phillipseamore
There are nginx modules for interacting with Redis and memcached.