All case studies

HR tech · Geospatial

Geolocation Attendance at Scale

A geocoding cache that absorbs the morning check-in spike instead of paying a third-party API for it.

60%lower geocoding cost

The challenge

Employee attendance reverse-geocoded every check-in through Google. At the morning peak of 20,000–30,000 requests per second, third-party costs became expensive.

How it works

  1. 01

    Geocode microservice

    The attendance service calls a dedicated Go geocode service, which runs a PostGIS ST_DWithin query for a cached address within a set radius, such as 100 m.

  2. 02

    Cache on miss

    On a hit, the cached address is returned immediately. On a miss, the service calls Google or HERE, stores the result as a geography point and returns it.

Engineering decisions

Proximity, not exact match

  • An address within 100 m is accurate enough for attendance, so nearby check-ins share a single paid lookup.

Built for the spike

  • Both services read from database replicas. Load-tested with k6 to 50,000 requests per second.

Outcomes

  • 60% reduction in third-party geolocation costs.
  • Handles 20–30k requests per second at peak, validated to 50k.
  • Provider fallback across Google and HERE.

Technology

Go · Chi
Geocode service
PostgreSQL · PostGIS
Geospatial queries
sqlx
Database access
Docker
Containers
k6
Load testing

Contact

Have something you want to build?

Tell us what you're building, or what you'd like to automate. Let's figure out the next step.