Recall & Review
beginner
What Redis data structure is used to store geo-location data for proximity queries?
Redis uses sorted sets to store geo-location data, where each member has a score representing its longitude and latitude encoded as a geohash.
Click to reveal answer
beginner
Which Redis command adds a geo-location point to a sorted set?
The
GEOADD command adds a geo-location point to a sorted set with longitude, latitude, and a member name.Click to reveal answer
intermediate
How does Redis find members within a radius of a point?
Redis uses the
GEORADIUS command to find members within a specified radius from a given longitude and latitude, optionally sorting results by distance.Click to reveal answer
intermediate
What does the
WITHDIST option do in a GEORADIUS query?The
WITHDIST option returns the distance of each member from the center point along with the member name.Click to reveal answer
advanced
Why are sorted sets suitable for geo-proximity queries in Redis?
Sorted sets store members with scores that represent geohashes, allowing efficient range queries and sorting by distance for geo-proximity searches.
Click to reveal answer
Which Redis command adds a location to a geo set?
✗ Incorrect
The GEOADD command adds a geo-location point to a sorted set.
What does the GEORADIUS command return by default?
✗ Incorrect
By default, GEORADIUS returns members within the radius without distances unless WITHDIST is specified.
Which option returns distances with members in a GEORADIUS query?
✗ Incorrect
WITHDIST returns the distance of each member from the center point.
What type of score does Redis use internally for geo members in sorted sets?
✗ Incorrect
Redis encodes longitude and latitude into a geohash score for sorting.
Which command can replace GEORADIUS in newer Redis versions for geo queries?
✗ Incorrect
GEOSEARCH is a newer command that supports geo queries with more flexible options.
Explain how Redis uses sorted sets to perform geo-proximity queries.
Think about how locations are stored and how you find nearby points.
You got /4 concepts.
Describe the steps to find all locations within 5 kilometers of a point using Redis commands.
Focus on adding data first, then querying with radius.
You got /4 concepts.