Scrivio Interview library
LeadershipPrincipal6 min read · updated 13 November 2026

A logistics platform that started with Redis geo commands for nearby searches now needs delivery zones as polygons, travel-time distances, historical location analysis and coverage in 40 countries.

How do you decide what stays in Redis and what moves to other geospatial technology, and how do you organise ownership of location data?

We map each need to the tool built for it: Redis geo sets stay as the hot, in-memory layer for nearest-point lookups by radius or box; polygons, spatial joins and history move to a spatial database such as PostGIS; and travel times come from a routing engine or provider. We check newer options first, such as geo shapes in the Redis query engine and H3 cell indexes, keep one system of record for locations and zones with Redis as a rebuildable serving layer fed by events, and give location data to an owning platform team.

Why this question is asked

Platforms that start with Redis geo commands often reach a point where every new requirement is forced into the same tool: polygon zones checked in application code, history kept in giant sorted sets, distances that ignore roads. The interviewer wants to see a senior leader who can separate needs, pick technology by evidence and cost, and organise teams so the result stays coherent across 40 countries. In this answer, we will map the needs to tools, check the newer options, set up the system of record and serving layers, weigh building against buying, and decide who owns location data.

1Mapping Needs to Tools

Each requirement has a natural home. Nearest-point search, 'which couriers are within 2 km', is what Redis geo sets do best: in memory, sub-millisecond, updated thousands of times a second. They support only radius and box searches, with no polygons, no per-member TTL and no history.

Delivery zones drawn as polygons, questions like 'which zone contains this address' or 'which orders were delivered inside zone 12 last month', and joins between locations and other data are the job of a spatial database. PostGIS, the spatial extension of PostgreSQL, stores polygons, indexes them, and answers containment and intersection queries correctly, including on the curved Earth when we use geography types.

Travel-time distance, 'how long will it take this courier to get there by road', is not a database question at all. It needs a road graph and a routing engine, self-hosted (such as OSRM, Valhalla or GraphHopper) or a commercial maps provider. Historical location analysis, months of courier tracks, belongs in a data warehouse or lake with spatial functions, not in memory.

Needs and their natural tools
NeedToolWhy
Nearest couriers, liveRedis geo setsin memory, fast updates, radius or box
Polygon zones, containmentPostGIS (or query-engine geo shapes)real polygons, spatial indexes
Travel time by roadrouting engine or providerneeds a road graph and traffic
History and analyticswarehouse or lakelarge, cheap, columnar storage
Area lookups at scaleH3 cell ids in any storefixed cells turn geometry into keys

2Checking Newer Options Before Deciding

The landscape moves, so we check before assuming. The Redis query engine, part of Redis Stack and of Redis 8, supports geo shape fields with polygon queries in recent versions; if our version and hosting support it, simple zone containment could stay in Redis (check your version and your managed service). Hierarchical cell indexes such as H3 divide the world into hexagonal cells at several resolutions, so 'is this point in zone 12' becomes 'is this point's cell in zone 12's set of cells', a lookup that works fast in Redis, a database or a cache.

Each option has an operating cost: a new database to run, a new module to upgrade, a precomputation pipeline. We run a short, time-boxed evaluation against real queries and data volumes from two or three representative countries, and compare latency, accuracy and cost.

3One System of Record, Derived Serving Layers

The biggest risk across 40 countries is several copies of the truth: zones edited in one tool, cached in another, and slightly different in a third. So we keep one system of record for zones and reference locations, typically PostGIS, and one event stream for live positions. Redis becomes a derived, rebuildable serving layer: it is fed by events and can be rebuilt from the record at any time. If Redis loses data, nothing is lost for good.

Zone changes flow the same way: an operator edits a zone in the record, an event is published, and serving layers update their copies, including any precomputed H3 cell sets. Each layer can be rebuilt by replaying from the record.

Step throughLocation platform layers
  1. Product servicesdispatch, ETA, pricing, tracking
  2. Location APIsnearby, zone-of, travel-time, history; owned by the platform team
  3. Serving layersRedis geo sets (live), H3 zone cache, routing engine
  4. Event streamposition updates and zone changes
  5. Systems of recordPostGIS for zones and places; warehouse for history

5 layers, from the top down. Step through them one at a time.

4Build or Buy

Maps and routing are where build-or-buy matters most. A commercial provider gives global road data, traffic and maintenance, priced per request; at millions of requests a day the bill can be large, and licensing may restrict storing results. A self-hosted routing engine on open map data is cheap per query but needs people to run it and may be less accurate in some countries. Accuracy really varies by country, so we test both in our hardest markets.

We compare cost per query at our volume, data licensing terms, accuracy against real delivery times in each country, latency, and the team we would need. A mixed answer is common: self-hosted routing in the largest markets, a provider elsewhere.

5Organising Ownership

Without an owner, each product team builds its own geo stack, and 40 countries become 40 interpretations. We create a location platform team that owns the system of record, the serving layers and a small set of standard APIs: nearby, zone-of, travel-time and history. Product teams use those APIs instead of talking to Redis or PostGIS directly, which also lets the platform team change the technology underneath without a migration in every team.

The platform team publishes its service levels, such as latency for nearby searches and freshness of positions, and a roadmap, so product teams can plan. Exceptions, a team needing direct access for a special case, go through a short review.

6Follow-up questions

What would make you keep polygon checks out of the request path?

Volume and latency. If every order needs a zone check at checkout, I would precompute: when a zone is published, compute the set of H3 cells it covers and store a cell-to-zone map in Redis or memory. The request path then computes the address's cell and does a hash lookup in microseconds, and only addresses in boundary cells, which a cell partly covers, need an exact polygon check, which can be done asynchronously or in PostGIS.

Why not move everything to PostGIS?

Because live nearest-courier search with thousands of position updates a second is exactly the workload where an in-memory structure shines, and a relational database would need heavy write capacity and tuning to match it. Using both, with clear roles, is cheaper than forcing one tool to do everything.

How do you migrate existing teams onto the platform APIs?

Start with the APIs that remove the most duplicated work, usually nearby search and zone lookup, migrate one or two teams with the platform team's help, then make the APIs the default for new work. Retire private geo code as teams touch it, tracking progress per country.

7Conclusion

In this answer, we mapped each location need to its tool: Redis geo sets for hot nearest-point searches, PostGIS for polygons, joins and reference data, a routing engine or provider for travel time, and a warehouse for history. We checked newer options such as query-engine geo shapes and H3 cells, kept one system of record with Redis as a rebuildable layer fed by events, weighed providers against self-hosted engines by cost, licensing, accuracy per country and latency, and gave location data to a platform team with standard APIs.

What to say in the interviewAbout 80 seconds aloud

Open with

I'd start by mapping each need to the tool built for it, rather than stretching Redis. Redis geo sets are excellent for hot, in-memory nearest-point lookups with radius or box searches, so live courier search stays there.

Then, if they want more

Polygon delivery zones, spatial joins and reference locations fit a spatial database like PostGIS. Travel time needs a routing engine or a maps provider, because it depends on the road network. Historical tracks belong in the warehouse.

Before deciding I'd check newer options, since the Redis query engine supports geo shapes in recent versions, and H3 cell indexes turn zone lookups into fast key lookups in almost any store, each with its own operating cost.

Architecturally, there's one system of record for zones and locations, and Redis is a derived, rebuildable serving layer fed by events, so losing it loses nothing permanent. For maps and routing I'd compare providers and self-hosted engines on cost per query at our volume, licensing, accuracy in each of the 40 countries and latency, and I'd expect a mix.

Finally, location data gets an owning platform team with standard APIs, nearby, zone-of, travel-time and history, so product teams don't each build their own geo stack and we can change the technology underneath without touching every team.

About this answer

Last updated
13 November 2026
Versions it names
Redis 8
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Redis documentation
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "How do you decide what stays in Redis and what moves to other geospatial technology, and...": https://scrivio-interview-library.netlify.app/databases/redis-patterns/0b279bec1a/