We have a lua script which filters the records , returns the map. I have two questions
Does aerospike executes the lua script like an independent script (similar to 'lua ' ) on every query?
There is a need to read a file and cache it using a function -- I want this function to be called only once , how can it be achieved?
Aerospike executes Lua script in a sandboxed environment. The context is reset across calls. So, you cannot read a file and cache values which you can use during next invocation. If you need to pass some information to each call, consider passing them via arguments. Needless to say, its better to not pass huge data structures as arguments. The overhead of encoding/decoding them will be high.