Our team is currently working on some iOS location apps that we are afraid to โexplodeโ in a good way, so we want to make an effort to understand scalability and accessibility.
After we read that something is based on couchbase NoSQL, we scanned the base api (in particular .net) on the couch and found solutions for all but one of our applications and describe the scenario:
- Suppose we have about 1,000,000 users worldwide, their location is determined by longitude and latitude;
- We have a range of custom circles c: its location (given by longitude and latitude) and radius rc
- We want to effectively determine which user is in the circle.
If we write it in the sql server, as now, it looks something like this:
CREATE TABLE UserLocations
[UserId] [bigint] NOT NULL,
[CurrentLocation] [geography] NOT NULL
ALTER PROCEDURE sp_GetCurrentUsersInRange
@userPoint geography,
@RangeInMeters int
AS
BEGIN
select UserId from UserLocations
where @userPoint.STDistance(CurrentLocation) <= @RangeInMeters
and UserId <> @userId
END
But this is NoSQL, there are only keys (such as the longitude key and the latitude key), but we cannot extract all the values โโand query them all in memory, can we?
So, the question for you is: Is there a way that you know how to do this in NoSQL?
thank
ps our related question in Stackoverflow: How to efficiently determine n places inside a circle?
EDIT: Couchbase support answered me! their answer is cited:
" - , 2.0 ( ) . , .
, ( ) , ".