0
0
Redisquery~5 mins

Geo-proximity with sorted sets in Redis - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AGEOADD
BGEOGET
CGEORADIUS
DGEOSEARCH
What does the GEORADIUS command return by default?
AMembers within radius without distances
BAll members in the sorted set
CMembers within radius sorted by distance
DDistances only
Which option returns distances with members in a GEORADIUS query?
AWITHCOORD
BWITHDIST
CWITHHASH
DASC
What type of score does Redis use internally for geo members in sorted sets?
ARandom number
BTimestamp
CGeohash encoded score
DMember name length
Which command can replace GEORADIUS in newer Redis versions for geo queries?
AGEODIST
BGEOADD
CGEOPOS
DGEOSEARCH
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.