Every database has its own mechanism for reading or writing. The exact method will directly impact the performance of these operations. Aerospike has optimized for both operations to occur on the cluster at the same time. Regardless as to whether you are reading or writing to the cluster, your code will not need to worry about the state of the cluster. All the work will be handled by the Aerospike intelligent API. It will keep track of which node to connect to for the operations.
Write When you issue a write command for a key/value pair, the Aerospike API will hash the key and use its value to determine which node is the master (primary) for that key. It will then connect to the node and commit the value to memory. If the replication factor is 2 or greater, the node will then communicate with the other nodes to commit the data in memory.When these have all been committed in memory, the node returns the client as committed. If using SSDs rather than RAM to store the data, the writes will be streamed to disk for persistence.
Read When you issue a read command for a key, the Aerospike API will again hash the key and use the value to determine which node is the master for that key. It will then connect to it to get the value. No other connection is necessary, even if there are replicated copies in the database. If the master is down, the API will automatically reroute the request to a replicated copy. No changes to the client code or configuration are needed.