How is data deleted? Aerospike separates the data into two parts: index and value. The index is always stored in DRAM, the value can be stored in either SSD or DRAM (with or without disk for persistence). When a record is deleted, the reference to it is removed from the index. The actual data is not removed from the disk. Another process will find that the data on disk is not being used and reclaim the space.
Note that it is possible for deleted object to reappear. For this to happen the following has to occur:
- The node must be configured to load data from disk. This means that in the file “/etc/aerospike/aerospike.conf” that the variable “cold-start-empty” be set to false for the namespace.
- That data has been deleted, but not yet removed from disk. (i.e. the index entry has been removed). The node has failed.The process “asd” has stopped either due to machine failure or the process was killed.
In this case when the node starts, it will read the data from disk and rebuild the index. Because the data has not been removed from disk, the node will think it is still active and build a new index entry for it. So the deleted object will return. If you know you will be taking down a node, you can prevent deleted data from returning by using the fast restart feature. This will hold the index in memory even when the database process has gone down.