aerospike-client-rust icon indicating copy to clipboard operation
aerospike-client-rust copied to clipboard

Client side aggregation for Lua UDFs

Open jhecking opened this issue 7 years ago • 2 comments

Support for MapReduce style of programming using Stream UDFs: http://www.aerospike.com/docs/guide/aggregation.html

jhecking avatar Jan 23 '17 07:01 jhecking

I would like to start some discussion on this topic. My current use case requires this, so now i'm checking if it makes more sense to use another client or implement lua here.

Rust has multiple lua interface libraries, with different targets. lua, hlua and rlua. rlua is the safe one, hlua is at least partly safe and faster than rlua and lua is probably the fastest. Interesting post by the rlua author here: https://www.reddit.com/r/rust/comments/8coe49/lua_bindings_lua_hlua_or_rlua/

I think the lua crate is probably not that good for this use case. rlua looks like the best choice to me, but i would like to hear your opinion on that.

jonas32 avatar Nov 17 '21 12:11 jonas32

First, you should check if UDFs on Aerospike could actually solve your issue. They are somewhat flaky when it comes to deterministic performance which can potentially cause headaches. Second, I don't think performance is much of a problem in this case, since the server usually bunches up reduced values and sends them over to the client, which means the client does not call into lua enough times to cause real-world performance issues. IMO, which library to use depends on the license and how active, complete and well supported the libraries are. In this case, rlua seems to be ok, although after a brief search I can't find any benchmarks on the internet to get an idea of how much performance penalty we are talking about.

khaf avatar Nov 17 '21 13:11 khaf