ripple, use same model as regular document and embedded.

Charlie Bowman charlesmbowman at gmail.com
Wed Oct 3 15:16:39 EDT 2012


I want to create a model that I can save to its own bucket, but also be
able to embed it in another model.  Is this possible with ripple?

Specifically I want to create a Message model, that I can save and lookup
easily.  I also want to embed a copy of that class in a ReceivedMessage
class.  I would like to work with these models as such:

message = Message.new
message.body = 'foo'
message.save!

received = ReceivedMessage.new
received.messages << message
received.save!


By doing this I know I have 2 copies of the message, but I'm alright with
that.  I'm optimizing for reads not storage space.
My endgame is that I want to look up messages without looking through the
recieved messages, and I want a user to quickly view all received messages
without looking up each individual message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20121003/2316b695/attachment.html>


More information about the riak-users mailing list