Designing a Spacetime Overlap Index for iOS App Presque
An architectural look at building a spacetime overlap index for the iOS app Presque, matching locations and timestamps in real-time.

Stock photo for illustration only, not from the actual event
- Memories are stored records containing latitude, longitude, timestamp, radius, and time window.
- Time dimensions are dynamic, with windows living on individual memories rather than global accounts.
- User consent strictly governs visibility, requiring real-time updates to the indexing system.
Building a system to find overlapping memories across space and time involves a straightforward product question that proves intricate to implement. Each memory within the system acts as a compact record comprising latitude, longitude, a timestamp, a radius, and a time window.
Spatial data serves as the simpler half of the equation. Coordinates feed directly into a geospatial index, transforming scans into bounded radius queries. With default parameters set tightly to fifty metres and adjustable by users, candidate sets remain manageable even within densely populated urban environments.

Stock photo for illustration only, not from the actual event
Time dimensions represent where naive architectural designs typically fail. The window is not configured as a global constant; instead, it resides independently on each individual memory rather than on the user account. For instance, a photograph captured at a concert might remain discoverable for merely two minutes, whereas an imported trip might span an entire afternoon.
Analyzing this spacetime overlap index architecture highlights the engineering complexity of balancing geospatial search performance with strict privacy controls. Implementing per-pair range intersections allows applications to handle highly dynamic, user-specific constraints without relying on rigid global intervals.
This design choice directly influences how modern location-aware mobile applications handle proximity alerts and user consent propagation.
The third critical dimension involves consent, which strictly governs all preceding constraints. Every memory is sealed by default, contributing nothing to the index until the owner explicitly makes it discoverable. Returning a memory to the vault immediately removes it from matching processes without waiting for scheduled batch jobs.

Stock photo for illustration only, not from the actual event
A notable architectural side effect of this approach is that near misses come at zero additional cost. A candidate clearing the spatial query while failing the window intersection is retained rather than discarded. For instance, a result located eleven metres away and nine minutes off is systematically routed to an inbox instead of being dropped.
The underlying infrastructure is currently being integrated into Presque, an iOS application designed to locate individuals who occupied the exact same place and time as you.
Source: Dev.to
Found something wrong in this article? Report an issue with this article
Comments
Leave a Comment