Design storage of polygon/circle geofences, efficient point-in-polygon tests for streaming locations, and alerting when users cross boundaries.
Functional requirements
- CRUD geofences linked to accounts or assets
- Evaluate location updates against relevant fences
- Emit entry/exit events to webhooks or queues
- Support buffering to reduce GPS jitter
Non-functional requirements
- Low latency evaluation on high-frequency location streams
- Spatial indexing for candidate fence lookup
- Horizontal scalability of evaluators