Is it possible to keep recently used data in-memory and other on SSD


#1

I wanted to know if there is possibility to keep recently accessed data in memory while SSD having entire data. So say I have 100 GB data and I just have 50 GB RAM. So I want that out of 100GB data, 50GB should be in RAM (based on recent access) and SSD should have entire 100 GB. So while I query data from aerospike, if it already exists in RAM, it should return from RAM else should look on SSD.

What I have found is that if we enable data-inmemory and also enable ssd storage, then memory should be good enough to contain entire data set and not some portion of it. Else it will start evicting older data from memory as well as from ssd. So what I want is that it should evict old data only from memory but not from ssd. So that when we query old data, it should return from ssd if not found in RAM.

Is it possible to do this in aerospike?


#2

Hi, Presently such partial caching of data is not supported in aerospike.

What you could is break the namespace down into two namespaces-

You can keep the more often used data in a namespace with data-in-memory true. While the other namespace could be disk based only.


#3

Thanks Anshu for the reply. This is what we have already thought. However it requires 2 calls to aerospike server from client. One for in-memory namespace and another for ssd based namespace which is what we wanted to avoid. But if it is not supported in Aersopike, then this is the only solution we can go with for now.