my question is - is it better to call redis from a JS library or using a Lua script? Redis supports Lua as a scripting language, but is it more efficient than using something like ioredis in Node.js? How exactly are these scripts executed?
For example we have the function call in Lua:
redis.call('ZADD', key, ...)
redis.call('ZREM', key, ...)
and the corresponding code in ioredis:
redis.zadd(key, ...)
redis.zrem(key, ...)
If we were to do those calls in a while loop in Lua or Node, how would they perform? Are the Lua scripts executed somehow internally in Redis or do they require connections everytime?