Thanks for all the suggestions. Let's not worry about the problem of ensuring uniqueness right now - I have that part solved separately.
Rohman, this approach is what I described as a "manual index". It adds a good deal of code that I'm hoping to avoid by using 2i or search. This whole thing is a balancing act between performance, code complexity and to some extent disk space. I'm trying to evaluate which approach gives me the best of all 3. Manual Index: - Adds lots of code complexity - Requires only 2 gets look up a user - one to the index to retrieve the primary key, then the lookup of the primary key - Not much extra space used. Search: - Barely any extra code - Have to index user objects, so about 2x as much space is required - Since search uses term-based partitioning, querying should be pretty fast in theory. Write performance will take a hit due to indexing. 2i: - Barely any extra code - Unsure of amount of extra space required - think it won't be too much - Because of document-based partitioning, there is overhead in talking to a coverage set when only one machine will have the result I'm looking for. The significance of this overhead is what I'm really trying to evaluate. -- Greg Clipboard On Monday, November 7, 2011 at 8:38 PM, Antonio Rohman Fernandez wrote: > Instead of using 2i, you could do the following when saving: > > POST http://{IP}:8098/riak/users/rohman > {"email":"roh...@mahalostudio.com > (mailto:roh...@mahalostudio.com)","otherdata":"...."} > > POST http://{IP}:8098/riak/emails/roh...@mahalostudio.com > (mailto:roh...@mahalostudio.com) > {"owner":"rohman"} > > So checking if an email address exists is only a GET > http://{IP}:8098/riak/emails/roh...@mahalostudio.com > (mailto:roh...@mahalostudio.com) ( and you can even know who is the user > owner -> rohman ) > > Just you need to create a simple new bucket/key for it... but is worth the > effort... not much work... no big key arrays, no loops, etc... instant > response ; ) > Rohman > > > Antonio Rohman Fernandez > CEO, Founder & Lead Engineer > roh...@mahalostudio.com (mailto:roh...@mahalostudio.com) > > Projects > MaruBatsu.es (http://marubatsu.es) > PupCloud.com (http://pupcloud.com) > Wedding Album (http://wedding.mahalostudio.com) > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com (mailto: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