Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Aerospike as persistent layer

Tags:

aerospike

Aerospike is a key store database with support for persistence. But can I trust this persistence enough to use it as an database altogether? As I understand it writes data to memory first and then persist it. I can live with eventual consistency, but I don't want to be in a state where something was committed but due to machine failure it never got written down to the disk and hence can never be retrieved. I tried looking at the various use cases but I was just curious about this one. Also what guarantee does client.put provides as far as saving of a new record is concerned.

like image 722
Anunay Avatar asked Aug 19 '17 17:08

Anunay


People also ask

Is Aerospike persistent?

Aerospike is a key store database with support for persistence.

Why Aerospike is better than Redis?

Aerospike best suits me because it is able to scale with performance and with no hard work, and different than Redis it is also designed to persist your data completely, minimizing data loss in any event.

What is Aerospike used for?

Aerospike is an excellent database for a recommendation engine. Key features are large lists ( for efficiently recording behavior), optimized Flash support to handle datasets from terabytes to petabytes, queries and aggregations for real-time reporting, and strong support for languages such as Python and Go.

What kind of database is Aerospike?

Aerospike Database is a flash memory and in-memory open source distributed key value NoSQL database management system, marketed by the company also named Aerospike.


1 Answers

Aerospike provides a user configurable replication factor. Most people use 2, if you are really concerned, you can use 3 or even more. Size the cluster accordingly. For RF=3, put returns when 3 nodes have written data to the their write-block in memory which is asynchronously flushed to persistent layer. So it depends on what node failure pattern you are trying protect against. If you are worried about entire cluster crashing instantly, then you may have a case for 1 second (default) worth of lost data. The one second can be configured lower as well. Aerospike also provides rack aware configuration which protects against data loss if entire rack goes down. The put goes to nodes in different racks always. Finally Aerospike provides cross data center replication - its asynchronous but does give an option to replicate your data across geo. Of course, going across geo does have its latency. Finally, if you are totally concerned about entire cluster shutdown, you can connect to two separate clusters in your application and always push updates to two separate clusters. Of course, you must now worry about consistency if application fails between two writes. I don't know of anyone who had to resort to that.

like image 199
pgupta Avatar answered Oct 11 '22 02:10

pgupta