Martin,

You may try to use range
queries<https://github.com/basho/riak-ruby-client/wiki/Secondary-Indexes>
for
this purpose in couple with LevelDB as a backend.
.../buckets/<bucket>/\$key/<start_key>/<end_key>

And in case you a ready to sacrifice performance, you may use Solr, which is
available through Riak Search<http://wiki.basho.com/Riak-Search---Querying.html>
.
.../solr/<index>/select/q=....&start=<start>&rows=<number_of_rows>


-Matthew



On Tue, Jul 17, 2012 at 11:54 PM, Martin Stabenfeldt <mar...@stabenfeldt.net
> wrote:

> Dear List,
>
> I´m planning to use Riak as my primary DB for my Rails app.
>
> The first issue I´ve encountered is pagination.
>
> I got a SubscriberList which may contain 1000´s of Subscribers. Any
> suggestion on how I can implement pagination? My plan was to use
> will_paginate <https://github.com/mislav/will_paginate/>.
>
>
>
>
> class  Subscriber
>
>
>
>
>   include Ripple::Document
>
>
>
>
>
>
>
>   # Belongs to a SubscriberList
>
>
>   one :subscriber_list
>
>
>
>
>
>   property :subscriber_list_key, String
>
>
>
>
>   property :email, String
>
>
>
>
>   property :referer, String
>
>
>
>
>   timestamps!
>
>
>   validates_presence_of  :email
>
>
>
>
> end
>
>
>
>
>
>
>
> class  SubscriberList
>
>   include Ripple::Document
>
>
>
>
>   one :user
>
>
>
>
>   property :user_key, String
>
>
>
>
>
>
>
>
>
>
>   # Has_many Subscribers
>
>
>   many :subscribers, :using => :reference
>
>
>
>
>   # Used by User to find which SubscriberList he has
>
>
>
>
>   property :subscriber_key, String
>
>
>
>
>   property :title, String
>
>
>
>
>   property :deleted, Boolean
>
>
>
>
>   timestamps!
>
>
>   validates_presence_of :user
>
>
>
>
> end
>
>
> --
> Martin Stabenfeldt
> Tlf: +47 93441707
>
>
> _______________________________________________
> 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

Reply via email to