Has-A vs Links-To

Dmitry Demeshchuk demeshchuk at gmail.com
Sun Apr 3 23:55:57 EDT 2011


Something tells me that Riak's current design is not well-suited for
pub-sub, especially with frequent channels removing.

However, I think innostore backend can give you such functionalities.
What you'll need is:

1. Add first_key and next_key functionalities to Riak itself (they'll
give you the first and the next keys from the given bucket, which
means first/next keys from the table on the InnoDB level)

2. Add remove_bucket functionality to Riak, which in fact will call
'DROP TABLE' on the innostore level, giving you an ability to remove
buckets fast.

So, your pub-sub design will look like the following:

1. Each channel has an associated bucket named "channel-ChannelName"

2. When trying to get the next message from the channel, you get the
first key from the bucket and then read its value.

3. Depending on your needs, you may want to read the next key
immediately or stop reading keys until the next subscriber query.

4. If you unsubscribe, you just remove the bucket using 'DROP TABLE'.


On Mon, Apr 4, 2011 at 2:46 AM, Mike Oxford <moxford at gmail.com> wrote:
> Pub-sub style, with frequent unsub and channel destruction.
>
> -Mike
>
> On Sun, Apr 3, 2011 at 2:11 PM, Dan Reverri <dan at basho.com> wrote:
>>
>> Can you describe a bit more what you are trying to model?
>> Thanks,
>> Dan
>> Daniel Reverri
>> Developer Advocate
>> Basho Technologies, Inc.
>> dan at basho.com
>>
>>
>> On Fri, Apr 1, 2011 at 2:40 PM, Mike Oxford <moxford at gmail.com> wrote:
>>>
>>> In Riak design, with a given bucket of "subscribers" would it be better
>>> to use the bucket as an actual container of users (denormallized) or use
>>> Riak's linking feature?
>>> While both will work, there are surely some under-the-covers things to
>>> consider...
>>> Thanks!
>>> -mox
>>> _______________________________________________
>>> riak-users mailing list
>>> riak-users at lists.basho.com
>>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>>
>>
>
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>



-- 
Best regards,
Dmitry Demeshchuk




More information about the riak-users mailing list