loading erlang terms

Seth Falcon seth at userprimary.net
Tue Oct 26 12:13:17 EDT 2010


On Tue, Oct 26, 2010 at 8:11 AM, Charles Blair <chas at uchicago.edu> wrote:

[snip]

> Now, if I replace dets/ets with riak, I can do two things (I
> think). The first would be to write an erlang function that does
> something like the above. But the second (which is where my question
> comes into play) is, if I can load arbitrary data types into riak,
> then is there a way I can specify that what I'm loading are erlang
> terms. If I don't do that, and load strings, I run into this sort of
> nastiness:

Perhaps I'm missing something... How about using Erlang's native
binary term serialization.

B = term_to_binary(Terms),
% now store B in Riak

% ...

% now get B out and do:
binary_to_term(B)


+ seth

-- 
Seth Falcon | @sfalcon | http://userprimary.net/




More information about the riak-users mailing list