Newbie Q: how to configure hybrid mode?

Hi colleagues, I’m a little confused with Aerospike configuration options… I have two kinds of data - one for fast access / update with a small amount of data (like 24G), another one is much bigger in size but for slower queries rate, thus do not need so ultra-fast access. For first one I clearly see in-memory storage engine, while I don’t understand how to enable hybrid mode for the storare-engine device and whether it require to be configured at all?

namespace fast {
        replication-factor 2
        storage-engine memory {
                file /opt/aerospike/data/fast.dat
                filesize 24G
        }
}
namespace slower {
    replication-factor 2
    indexes-memory-budget 5G
    storage-engine device {
        file /opt/aerospike/data/slower.dat
        filesize 500G
    }
}

Thank you!

Assuming you are using server version 7.x - you have 3 options for what you are trying to do:

You have separated the namespaces correctly. Each namespace must define one storage-engine.

1 - Data only in memory with no persistence to files.

storage-engine memory {
 # now you must provide data-size
  data-size 24G
}

2 - Data in memory for fast access with persistence to file for durability on cluster shutdown Like you have …

storage-engine memory {
                file /opt/aerospike/data/fast.dat
                filesize 24G
        }

Here filesize is automatically used to infer data-size by the server. Don’t have to specify data-size.

3 - You only want storage on device, in this case file(s)… like you have it configured.

storage-engine device {
        file /opt/aerospike/data/slower.dat
        filesize 500G
    }

Probably, I was unclear. My question is: whether it is required to explicitly enable in configuration Hybrid Mode architecture (Hybrid storage | Aerospike Documentation) or this is default mode, which is always enabled? Thank you.

Hybrid mode - this is just a descriptive term. In Aerospike you store the Primary Index (PI) of the record and the record data. You have configuration options where to store each - as you did in the configuration file.

All Memory Mode - PI and Data both configured to store in memory only.

Hybrid Mode - PI in memory, data on SSDs. ==> persistence of data with power down with memory like performance.

All Flash Mode (EE only) - Both PI and Data on SSDs.

So - All Memory Mode / Hybrid Mode / All Flash Mode / are just nomenclature phrases.

In your case, your namespace fast is All Memory Mode and your namespace slower is configured in Hybrid Mode. (In both cases for PI, index-type is memory (default) for you.) .

Starting with server version 7.x, there is no default mode for storage-engine, and therefore no default mode of a namespace. You must define storage-engine in the namespace configuration, and you must define at least one namespace for the aerospike server to start.

Pre 7.x storage-engine default was memory, so one could argue, a default namespace would be All Memory mode as long as you defined a namespace with a name and some other required parameters. Even pre 7.x, you had to define one namespace for server to start.

Hope that helps.

2 Likes

Piyush, thanks a lot!