Calculate percentiles on real time running performance with Aerospike!

You may have to get specific with your solution rather than figure out a general purpose solution. One trick can be duplicate storing all the male salaries in a separate record as a sorted list. The largest record size is 8MB in Aerospike - so you can see if it can cover your entire data set. LIkewise storing all female salaries in a second record as a sorted list. You still have your record of employees, just update the salary record also every time you insert or update the employee record. Now you have an easier problem at hand. If 8MB still falls short, you may have to get clever and see if you can segregate your data by storing it in pre-defined ranges into multiple 8MB records. Sorted lists are available in Aerospike. That will be an alternate to the UDF route. You can do sorting in the reduce function of a stream UDF but it will not be practical for the entire data set. You might want to read this thread: Order by option - #2 by helipilot50