Question

I am New to Riak. I am planning to implement an In-Memory computing concept. That is Storing the Complete data in the RAM instead of Hard Disk. I have done it with MYSQL using Memory Engine. But I want to try it with the NoSQL. So first I looked at Cassandra, and now I am working on Riak. What I want to know is, Where do the Riak store all the data? In Memory or In Disk?

I googled it for some time and found out that it stores the keys in the memory for low latency. But is there any way to store complete data in the Memory?

If Yes, then how can I setup the Riak to achieve the In-Memory Compatibility. I am doing this for a POC sack.

Thanks in advance.

Was it helpful?

Solution

Riak has a configurable backend system.

Riak's default backend is Bitcask. Bitcask persists all data to disk on write, while keeping all keys in memory. The system's file caching is relied on when reading data as to whether a particular value is in memory or not. While this article is a bit old, it covers how bitcask works pretty well at the high level.

If you want to simply store everything in memory and not persist to disk, you can configure Riak to use a memory-only backend. This is done via the app.config file in the riak_kv section:

{riak_kv, [
           %% Storage_backend specifies the Erlang module defining the storage
           %% mechanism that will be used on this node.
           % {storage_backend, riak_kv_bitcask_backend},
           {storage_backend, riak_kv_memory_backend},
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top