As per the thread: Get bin insert time/modification time, we don’t have any inbuilt support for
created timestamp or
modification timestamp, we can write (update policy) unix epoch in a bin, with each write invocations.
created timestamp we can do either of following things:
Create a UDF, which when invoked checks if a record exists or not, if record doesn’t exists then add a column
created_timestampand put unix epoch in it.
Make two operations to Aerospike, one will check existence of record and another operation to put columns with
created_timestamp(if record doesn’t exists). (Created timestamp is generated on the application)
Note that while doing write (via any of the above two method) it is made sure that new/updated values are also getting written in their respective column(s).
created_timestamp is a non-aerospike provided metadata for use-case of my application.
Now, the problem is that UDF is not much optimized as compared to Native Operations, I was earlier using UDF to achieve the goal, but when I switched to combination of Native Operations (2nd point), the CPU utilization decreased by approx 15%, so it is a big no for me to use UDF for such a small task.
If you notice that the task or goal which I am trying to achieve here is being done by two aerospike operations (batching won’t help as it creates one connection to aerospike node, but does the passed number of operations individually on a record).
I am looking forward to optimize the two operations into one and at the same time achieving
created_timestamp (rather than
Please suggest something better which I may be missing here.