Reputation: 1750
According to Aerospike's website, Primary Indexes will occupy space in RAM given by:
64 bytes × (replication factor) × (number of records)
I was confused if this is the space which will be occupied on each replica or this is the space occupied by the Primary Index in total i.e. the sum of the space required on each replica.
Upvotes: 1
Views: 139
Reputation: 5415
Every record that you store in Aerospike has two components - the data part and a Primary Index in RAM (which takes 64 bytes) that is used to locate the data - where ever you have stored it. (You get to choose where you want to store the data part - it can be in the process RAM or an SSD drive and other exotic options.) Aerospike is a distributed database - so typically has more than one node over which you store your records and easily horizontally scalable. To avoid losing data upon losing a node, you will typically ask Aerospike to store two copies (r=2) of every record - each on different nodes. So when you look at the RAM usage across the entire cluster of nodes for just the primary index, you need n x r x 64 bytes of RAM just for the PI. This is all the RAM required to just store the primary index for master records and replica records over all the nodes in the cluster.
So if you had 100 records, 2 copies on a 5 node cluster, RAM needed just for PI will be 100 x 2 x 64 bytes over 5 servers, ie each server will need about (100 x 2 x 64)/5 bytes of RAM consumed for PI storage. (In reality RAM for PI is allocated in minimum 1GB chunks in Enterprise Edition.)
Upvotes: 4