Context
I have a namespace that has 1 billion records. I have 5 sets that cumulatively hold 999 million records. How do I backup only the records that do not belong to any set without backing up the entire namespace?Method
Asbackup does not have an option to backup records that do not belong to a set (records in the null set) without backing up the entire namespace. Records in Aerospike database can be stored in a namespace, and they can be optionally grouped into sets. If the use-case requires to have operations to be done on a group of items in the namespace, you should specify them to be in a set. Note that the entire namespace would need to be scanned even if the requirement is only for a specific set.
The workaround in such cases would be to implement a UDF/Client application to update such null-set records and assign them to a set in order to take advantage of the per-set asbackup
--set option .By using User-Defined Function (UDF) record.setname(), the set name of the record returns nil if the record does not belong to a set.
Client application also enables you to perform a scan on the records with null-set, and request a set name and write it back with new set name.
Notes
See here for details on Asbackup - https://docs.aerospike.com/tools/backup/asbackupSee here for Data Model - https://docs.aerospike.com/server/architecture/data-model
UDF API for database record: https://developer.aerospike.com/udf/api/record