ripple, use same model as regular document and embedded.
charlesmbowman at gmail.com
Wed Oct 3 17:22:03 EDT 2012
I think, I've figured out that the only way to accomplish what I'm shooting
for is to decouple the persistance layer from the business logic of my
message class. That way I can embed a message object into any other class,
including a "PersistedMessage" class.
I believe that riak search would do the trick, but I believe a straight
lookup will be considerably faster.
On Wed, Oct 3, 2012 at 2:16 PM, Martin Streicher <supergiantrobot at me.com>wrote:
> Can Riak search help here?
> On Oct 3, 2012, at 3:16 PM, Charlie Bowman wrote:
> > 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.
> > _______________________________________________
> > riak-users mailing list
> > riak-users at lists.basho.com
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the riak-users