Hello Ivaylo, Yes, you could use a pre-commit hook for this but it's important to understand the limitations of this design. A pre-commit hook blocks the write until the hook comes back successful and then it proceeds. This is going to add latency to write operations on the bitcask backend. An alternative design would be to do 2 PUTs for each object, one in bitcask and one in memory, to remove the hook all together. Either will work but obviously have different trade offs.
I recommend having a look at the riak_search pre-commit hook(specifically the pre-commit function)[0] for an example of how to write/install a pre-commit hook. Let me know if you have any questions. Thanks! Brian [0] https://github.com/basho/riak_search/blob/develop/src/riak_search_kv_hook.erl On Tue, Mar 4, 2014 at 11:39 AM, Ivaylo Panitchkov <ipanitch...@hibernum.com > wrote: > > Hello, > > I'm playing with the Bitcask storage backend and realized it will be nice > if there is a cache functionality realized with the Memory backend. If I > install both Bitcask and Memory storage backends as Mult Is there any easy > way, a simple script that could do the caching by simply installing it with > pre-commit hook? > > Thanks in advance, > Ivaylo Panitchkov > > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > >
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com