2i for single-result lookup

Antonio Rohman Fernandez rohman at mahalostudio.com
Mon Nov 7 23:38:51 EST 2011


  

Instead of using 2i, you could do the following when saving:

POST
http://{IP}:8098/riak/users/rohman
{"email":"rohman at mahalostudio.com","otherdata":"...."}

POST
http://{IP}:8098/riak/emails/rohman at mahalostudio.com
{"owner":"rohman"}

So
checking if an email address exists is only a GET
http://{IP}:8098/riak/emails/rohman at 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 

 		
[1]

 ANTONIO ROHMAN FERNANDEZ
CEO, Founder & Lead
Engineer
rohman at mahalostudio.com [2] 		 
 PROJECTS
MaruBatsu.es
[3]
PupCloud.com [4]
Wedding Album [5] 

   

Links:
------
[1]
http://mahalostudio.com
[2] mailto:rohman at mahalostudio.com
[3]
http://marubatsu.es
[4] http://pupcloud.com
[5]
http://wedding.mahalostudio.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20111108/2b781914/attachment.html>


More information about the riak-users mailing list