Executive Summary: Geospatial & Routing Architecture

Prerequisite: This is the executive summary and introductory overview of the Routing & Geospatial Architecture series. No prior reading is required to start here. Executive Summary: Geospatial & Routing Architecture Answer-first: High-concurrency routing systems combine Java-based GraphHopper engines for Contraction Hierarchies pathfinding with a Golang API Gateway using Uber H3 hexagonal indexing and Redis semantic caching. This architecture resolves 100x100 distance matrices in under 30ms while reducing compute load by up to 95%. ...

June 14, 2026 · 8 min · Lê Tuấn Anh

Warehouse Picker Routing: GraphHopper, OR-Tools & C++

Warehouse Picker Routing Optimization (GraphHopper & OR-Tools) Answer-first: Minimizing walking distance for warehouse pickers requires solving the Traveling Salesperson Problem (TSP) inside a physical building. The 2026 standard architecture uses a Java-based Indoor GraphHopper instance to generate a 100x100 Distance Matrix from custom OpenStreetMap (OSM) data, which is then fed into a C++ Google OR-Tools gRPC Microservice to calculate the absolute optimal pick sequence in under 15 milliseconds. The S-Shape Trap in Warehouse Picking In legacy Warehouse Management Systems (WMS), workers are directed to pick items using heuristic patterns like the S-Shape (Z-pattern) or Largest Gap. These heuristics force the worker to walk down every aisle that contains an item, traversing the aisle from end to end. ...

August 1, 2026 · 5 min · Lê Tuấn Anh

OSRM vs GraphHopper: Routing Engine Architecture Comparison

OSRM vs GraphHopper: Routing Engine Architecture Comparison Introduction: When Do You Outgrow Cloud Route APIs? Building early-stage logistics applications with cloud routing APIs provides immediate reliability, accurate ETAs, and zero infrastructure maintenance. However, when daily traffic exceeds 100,000 requests or requires massive distance matrices for vehicle route optimization, proprietary API costs explode while rigid routing profiles prevent injecting custom fleet constraints. Not only are they prohibitively expensive at scale, but these proprietary APIs also lack the flexibility required to inject custom routing rules. For instance, if your logistics fleet consists of 5-ton trucks that cannot enter certain city districts between 6 AM and 8 AM, or if you need to strictly penalize left turns at specific intersections to optimize fuel consumption, standard APIs fall short. They offer generic profiles for ‘driving’ or ‘bicycling’, but they do not allow you to define the exact physics and legal constraints of your unique vehicles. ...

July 17, 2026 · 9 min · Lê Tuấn Anh

Part 8: Zero-Downtime Map Updates & Multi-Region Kubernetes

Answer-first: Zero-downtime Kubernetes deployments for routing services combine Argo Rollouts canary strategies, pre-stop hook draining, and automated P99 latency validation. Prerequisite: Before reading this final part, review Part 7: Load Testing & Performance Tuning. Part 8: Zero-Downtime Map Updates & Multi-Region Kubernetes Answer-first: Deploying stateful routing engines to Kubernetes without downtime requires decoupling map graph compilation into offline jobs, hydrating Pod cache volumes via initContainers, and executing atomic Blue-Green traffic cuts via Argo Rollouts to preserve Redis semantic cache consistency. ...

June 15, 2026 · 8 min · Lê Tuấn Anh

Golang Routing Microservices with Kratos & Dapr Framework

Answer-first: High-throughput geospatial microservices in Go leverage H3 spatial indexes, concurrent goroutines, and Protobuf gRPC APIs for real-time ETA calculation. Prerequisite: Before reading this part, review Part 3: Spatial Indexing. Part 4: Golang API & Microservices Integration (Kratos & Dapr) Answer-first: Integrating a high-concurrency Golang API Gateway with a downstream Java routing engine requires robust defense-in-depth patterns: golang.org/x/sync/singleflight for request deduplication, sony/gobreaker circuit breakers for fail-fast isolation, and flattened 1D arrays for Protobuf distance matrix serialization to prevent Go GC pauses. ...

June 14, 2026 · 10 min · Lê Tuấn Anh

Part 2: Environment Setup with Docker, OSM & Golang

Prerequisite: Before starting this part, review Part 1: Core Routing Algorithms Visualized. Part 2: Zero to Hero Environment Setup (Docker, OSM, Golang) Answer-first: Setting up a production-grade routing environment requires extracting OpenStreetMap .osm.pbf map data via Osmium tools, provisioning GraphHopper Java containers with explicit JVM heap allocations (-Xmx6g), and connecting a Golang API client with exponential backoff health checks. Key Takeaways: Map Extraction: Bounding-box cropping with osmium extract reduces raw .osm.pbf file size by 90%, speeding up graph compilation. Container Tuning: Allocate sufficient JVM heap (JAVA_OPTS=-Xmx6g) to prevent Out-Of-Memory (OOM) failures during Contraction Hierarchies shortcut generation. Client Resiliency: Golang HTTP clients must use connection pooling (MaxIdleConnsPerHost: 100) to sustain high matrix throughput. What You’ll Learn: ...

June 14, 2026 · 8 min · Lê Tuấn Anh

Part 1: Core Routing Algorithms — A* & Dijkstra Visualized

Prerequisite: This part builds on the concepts introduced in the Executive Summary. Part 1: Core Routing Algorithms — A* & Dijkstra Visualized Answer-first: A* pathfinding uses Euclidean heuristics to accelerate 1-to-1 point routing, whereas Single-Source Dijkstra is mathematically superior for 1-to-N distance matrix calculations because it builds a single shortest-path search tree to all reachable destinations in one pass. Key Takeaways: Matrix Efficiency: Dijkstra expands radial wavefronts in a single pass, computing 1-to-N driver matrices 10x faster than running N independent A* searches. Turn Restrictions: Edge-based graph representation models turn penalties (e.g. prohibited U-turns) by representing turns as edges between directed road segments. Shortcut Hierarchies: Contraction Hierarchies contract local nodes offline, reducing real-time search space by orders of magnitude. What You’ll Learn: ...

June 14, 2026 · 10 min · Lê Tuấn Anh

GraphHopper Distance Matrix: Self-Host, API & Alternatives

GraphHopper Distance Matrix: Production Self-Hosting & API Guide How to Call the GraphHopper Matrix API (/matrix Endpoint) Running GraphHopper distance matrix in production requires configuring Docker deployment, the /matrix API endpoint, Custom Models for vehicle-specific routing (truck/motorcycle), H3-based Redis caching, and evaluating performance tradeoffs against OSRM, Valhalla, and Google Maps (for an in-depth analysis of routing engine selection, see our OSRM vs GraphHopper Architecture Comparison). The /matrix endpoint evaluates element-by-element matrix calculations between sets of origin and destination coordinates. When issuing requests, callers specify input point arrays along with requested output arrays such as times (travel duration in seconds) and distances (road distance in meters). Depending on graph preparation, GraphHopper can evaluate matrix queries using speed-optimized Contraction Hierarchies (CH) or flexible Landmark-based (LM) routing models. ...

June 11, 2026 · 16 min · Lê Tuấn Anh

Self-Hosting GraphHopper on Kubernetes with OSM Data

Self-Hosting GraphHopper on Kubernetes with OSM Data GraphHopper is arguably the most capable open-source routing engine available — it supports Contraction Hierarchies (CH) for sub-millisecond route queries, custom vehicle profiles, turn restrictions, and the full OpenStreetMap road network. The problem most teams encounter is not the algorithm; it is the operational challenge of running it in Kubernetes: loading a large OSM PBF file, sizing JVM memory correctly, handling the long CH pre-processing startup time, and updating map data without downtime. ...

June 1, 2026 · 10 min · Lê Tuấn Anh