mapreduce - How to queryl based on time interval in riak -


i trying implement following functionality. have bucket storing objects. 1 of object field timestamp. want retrieve objects timestamp between interval (20130605 08:00:00 20130605 08:05:00) mean need objects 8.00 8.05.

can implement using map reduce or using secondary indexes?

another approach considering bucket created 20130605:0800:0805 , store objects under bucket. now, dont want implement conditional time interval based queries. please suggest way.

depending on type of data storing, there few options. correctly point out, secondary indexes 1 way approach this, these support both exact match , range queries. can e.g. create binary index (possibly integer index) containing timestamp outlined in example , fetch based on range query on index.

if data allows it, option might store several objects in single record , give record key represents specific time interval. allow retrieve records covering specific time period directly using keys, efficient , scales well. have described method possibly similar scenario here.

you determine period covered single record based on amount , frequency of data inserted size of record not grow big (a couple of mb). e.g. collect data minute in single record , give key in format 'yyyymmddhhmi'. if looking data covering period 20130605 08:00 20130605 08:05, directly fetch records 201306050800, 201306050801, 201306050802, 201306050803 , 201306050804.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -