35
Route handlers
platform · 2025 · client unnamed
Property search with real geospatial querying, so location filters answer from the database rather than from application code.
35
Route handlers
Geospatial
Querying
spatial index, database-side
The problem
Property search is a location query first and a filter query second. A platform that stores coordinates as plain numbers and computes distance in application code works in testing and degrades continuously as listings grow.
The approach
Modelled locations as proper geospatial points with a spatial index from the start, so radius and bounding queries execute in the database. Listings carry media through object storage rather than the application, keeping upload traffic off the API path.
Architecture
Spatial indexing on listing coordinates, with media offloaded to object storage. The geospatial decision is made once at the schema level rather than retrofitted after the first slow query.
Each with what it cost
A decision without a stated tradeoff is a preference.
01
Why
Retrofitting geospatial querying means rewriting every location filter and backfilling every record. Deciding it up front costs nothing.
What it costs
Slightly more care required on write, in exchange for the query pattern the product is built on.
Outcome
Location-based property search that stays responsive as the catalogue grows, with media served from storage rather than through the application.