[SERVER-926] geo search sharding support Created: 02/Mar/10  Updated: 12/Jul/16  Resolved: 20/Oct/10

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 1.7.2

Type: Improvement Priority: Major - P3
Reporter: Eliot Horowitz (Inactive) Assignee: Mathias Stearn
Resolution: Done Votes: 18
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-1982 fully support sharding on geo field Backlog
is related to SERVER-1981 Support $near and $nearSphere predica... Closed
Participants:

 Description   

sharding needs to be geo aware

  • when sharding by a geo field, pick split points on the geo space
  • when querying, pick the right shards and re-sort


 Comments   
Comment by Ken Williams [ 18/Jun/14 ]

Could you add a note in the docs (http://docs.mongodb.org/manual/tutorial/query-a-2dsphere-index/#proximity-to-a-geojson-point) that when a collection is sharded, you must use the geoNear command instead of the $near operator? A mention of sharding in the error message would be nice too.

Comment by Felipe Micaroni Lalli [ 04/Apr/12 ]

I'm sad that this issue is not really complete. =(

Comment by Eliot Horowitz (Inactive) [ 29/Feb/12 ]

@Leon - you can still use sharding with geo queries, you just distribute the query. can actually scale very well as you distribute the load and each server does 1/N

Comment by Leon van Zantvoort [ 28/Feb/12 ]

Are there any plans to support sharding on geo key?

As long as this isn't supported, geospatial searching doesn't scale with Mongo, or am I missing something here?

Comment by Mathias Stearn [ 20/Oct/10 ]

Marking as done as all geo functionality is now supported.

Notes:

1) Sharding on a geo key isn't recommended as we currently can't use geo to route queries. If you shard on e.g. user we can still use that field to route geo queries. Vote for SERVER-1982 if you need this feature.

2) You must use the geoNear command rather than $near. Supporting $near directly in mongos would require query rewriting, something we don't currently do. If this is a huge inconvenience, please vote up SERVER-1981.

Comment by auto [ 20/Oct/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: tests for sharded geoNear SERVER-926
http://github.com/mongodb/mongo/commit/23952f412edf43dfc875aa1a3d68e02aef03b40b

Comment by auto [ 20/Oct/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: Support $within on sharded collections SERVER-926
http://github.com/mongodb/mongo/commit/04a889eb0572c32c34fad9f97c0915340f5ac490

Comment by auto [ 20/Oct/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: Support geoNear on mongos SERVER-926
http://github.com/mongodb/mongo/commit/39d768653ee9ea24945d1e4ace80eb3b30eed852

Comment by Eliot Horowitz (Inactive) [ 09/Jun/10 ]

No - at least not in the end.
It will work if location is or isn't the shard key.

Comment by Joseph Hirn [ 09/Jun/10 ]

Will the implementation require that location is part of the shard key?

Generated at Thu Feb 08 02:55:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.