I'm going to eventually want to do something similar so I took particular note of a thread that came up earlier in this forum. I haven't fully investigated it but I think it's a great start for what you need to do.
http://www.mail-archive.com/user@cassandra.apache.org/msg00201.html <http://www.mail-archive.com/user@cassandra.apache.org/msg00201.html>In particular, it talks about representing coordinates as hashes. I believe that points that are close to each other have similar hash stems (eg. "abcdefg" is with x distance of "abcdeff"). I haven't looked it in detail. Peter 2010/4/9 Onur AKTAS <onur.ak...@live.com> > Hi, > > I want to use Cassandra for a new project, as you can guess I have a RDBMS > background however do not have any experience with NoSQL databases except > key/value pair in memory data grids/caches. (Oracle Coherence /Memcached.). > > I'm trying to find out how do you perform queries with calculations on the > fly without inserting the data as calculated from the beginning. > > Lets say we have latitude and longitude coordinates of all users and we > have Distance(from_lat, from_long, to_lat, to_long) function which > gives distance between lat/longs pairs in kilometers. > > Ex: > user1_lat = 40 user1_long = 20 > user2_lat = 30 user3_long = 50 > > So, if we want to do same operation in regular RDBMS we can use this kind > of query to get users near to user_1's location. > > * select user from users where Distance(40, 20, u ser.lat, user.long) = 5 > > How do we do this kind of operations in cassandra? > > If we insert data as calculated from the beginning, lets say we have 1 > million users, then do we need to do 1 million insert operations for just > updating 1 users coordinates? (Ofcourse no but then how?). > > I believe huge complexity calculations are possible with Cassandra, but do > not know about querying out of accessing the data by it's key. > > Thanks, > > > ------------------------------ > Windows 7: Size en uygun bilgisayarı bulun. Daha fazla bilgi > edinin.<http://windows.microsoft.com/shop> >