Taller
Taller

Reputation: 106

Aerospike database design

I would like to make aerospike database which will contain the following structure:

scheme = {
    "name": "name",
    "version": "version", 
    "fields": [
        {   
            "name": "clicks",
            "total_count": 67238882342,
         ...
        }
    ]
}

scheme name and scheme fields belong to different level. But aerospike doesn't support UNION/JOIN operations. How can I designed my DB?

Upvotes: 2

Views: 522

Answers (3)

user1788811
user1788811

Reputation: 31

Hey this is very simple you don't have to worry about joins in aerospike because It is schema less database .

if your object is like given below :

// Json Object

{ "name": "name", "version": "version",

// It is a list of json objects again

"fields": [
    {   
        "name": "clicks",
        "total_count": 67238882342,
     ...
    }
]

}

You can use Large order list which can solve this type of scenario

link :: https://www.aerospike.com/docs/guide/llist.html

Upvotes: 2

Carbonrock
Carbonrock

Reputation: 457

Eugeny,

The scheme you have given can be easily stored in aerospike. The fields will be of datatype list and any collection can be stored inside the list. In your case it is a map. One point I am not able to understand is why do you need UNION or JOIN to store this schema.

One thing you need to understand is Aerospike is a Key/Value store and you can create secondary indexes on required columns. On recent release, you can create secondary indexes on collections also. Please note secondary indexes stored in RAM.

You cannot JOIN on bins (column) from set to set.

Hope this helps.

Upvotes: 1

sunil
sunil

Reputation: 3567

Aerospike supports nested lists & maps. See the java example.

Upvotes: 1

Related Questions