Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the use cases where Redis is preferred to Aerospike?

We are currently using Redis and it's a great in-memory datastore. We're starting to look at some new problems where the in-memory limitation is a factor and looking at other option. One we came across is Aerospike - it seems very fast, even faster than redis on in-memory single-shard operation.

Now that we're adding this to our stack, I'm trying to understand the use cases where Aerospike would not be able to replace redis?

like image 332
Yehosef Avatar asked Feb 09 '23 22:02

Yehosef


2 Answers

Aerospike supports less data types than Redis, for example pub/sub is not available in Aerospike. However, Aerospike is a distributed key-value store and has superior clustering features.

The two are both great databases. It really depends on how big of a dataset you're handling, and your expectations of growth.

like image 149
Ronen Botzer Avatar answered Feb 12 '23 12:02

Ronen Botzer


Redis:

Key/value store, dataset fits into RAM in single machine or you can shard yourself across multiple machines (and/or cores since it's single-threaded), persists data to disk, has data structures like lists/sets, basic pub/sub, simple slave replication, Lua scripting.

Aerospike:

Key/value row-store (meaning value contains bins with values and those values can be more maps/lists/values to have multiple levels), multithreaded to use all cores, built for clustering across machines with replication, and can do cross-datacenter replication, Lua scripting for UDFs. Can run directly on SSDs so you can store much more data without it fitting into RAM.

Comparison:

If you just have a smaller dataset or are fine with single-core performance then Redis is great. Quick to install, simple to run, easy to just attach a slave with 1 command if you need more read scalability. Redis also has more unique functionality with list/set/bitmap operations so you can do "more" out of the box.

If you want to store more complicated or nested data or need more performance on a single machine or clustering, then Aerospike gets the job done really well with less operational overhead. Very fast performance and easy cluster setup with all nodes being exactly the same role so you can scale reads and writes.

That's the big difference, scalability beyond a single core or server. With Lua scripting, you can usually fill in any native feature that Redis has into Aerospike. If you have lots of data (like TBs) then Aerospike's SSD feature means you get RAM-like performance without the RAM cost.

like image 42
Mani Gandham Avatar answered Feb 12 '23 12:02

Mani Gandham