Registering UDFs


#1

Hi, Is there a way to put the UDF on the server and the Aerospike will register it automatically? if not, I was wondering what is the way to know if a UDF already registered? I guess re-registering is an expansive operation


#2

Aerospike has two types of UDFs, record udfs that operate on a record and can modify a record, stream udfs that work on a set of records in a read only mode and can be used to aggreagate data from the records. I would consider UDFs on advanced level side but very useful tool in Aerospike to do creative custom manipulation of data.

You register UDFs once, unless you modify them and want to re-register. I would not put registration API in the production application. Read further below.

If you are using record UDF, you can use the AQL tool that comes with the server installation. Module is a lua file containing your user defined functions.

$aql aql>help --> see register / show / remove module command and examples aql>exit

If you are using stream UDFs, register via client API, once, unless you modify it. For example, in python you can use udf_put(). You can also write a small standalone application to load / update your stream udfs. See detailed discussion on how stream udfs work and where they are located on server and client nodes in this thread: