Tile38 (created by Josh Baker / tidwall and open-source contributors under the MIT license) is an ultra-fast, open-source in-memory geolocation data store, spatial index, and real-time geofencing server written in Go. Built for fleet tracking platforms, ride-hailing/delivery backends, IoT telemetry systems, and real-time GIS developers, Tile38 stores Lat/Lon points, bounding boxes, GeoJSON, Geohash, and WKT geometries in memory with optional AOF disk persistence—evaluating `NEARBY`, `WITHIN`, and `INTERSECTS` spatial queries and firing instant geofence alerts over webhooks, gRPC, Redis Pub/Sub, Kafka, NATS, or MQTT.
1. In-Depth Review: Why Real-Time Location & Fleet Backend Teams Use Tile38
- Sub-Millisecond In-Memory Spatial Indexing: Uses a high-speed R-Tree spatial index in RAM to track hundreds of thousands of moving vehicles, drones, or IoT assets simultaneously with microsecond-level spatial lookups.
- Built-In Live Geofencing (`SETHOOK` & `NEARBY`/`WITHIN` Roaming): Monitors moving objects continuously and triggers instant `enter`, `exit`, `inside`, `outside`, and `cross` notifications via HTTP webhooks, Redis Pub/Sub, Kafka, NATS, or MQTT without polling loops.
- Drop-In Redis RESP Protocol & Rich Spatial Formats: Speaks the standard Redis protocol (`tile38-cli` or any Redis client library) while supporting `Lat/Lon`, `GeoJSON`, `Bounding Box`, `Geohash`, `QuadKey`, `XYZ Tile`, and `WKT` geometries natively.
2. Key Features & Capabilities
- Real-Time Spatial Queries (`NEARBY`, `WITHIN`, `INTERSECTS`, `SCAN`): Query moving objects by radius, polygon fence, bounding box, or map tile coordinates with optional `WHERE` field filters.
- Event-Driven Geofencing (`SETHOOK` & `SETCHAN`): Register persistent geofences that push JSON events to HTTP/HTTPS endpoints, Kafka, NATS, MQTT, RabbitMQ, or Pub/Sub channels when objects enter, exit, or cross boundaries.
- Roaming Geofences (Moving-to-Moving Proximity Alerts): Detect when two moving objects (such as a delivery driver approaching a customer or two drones nearing each other) come within a specified distance.
- Full GeoJSON, WKT, Geohash & Object Field Support: Store arbitrary GeoJSON points, polygons, lines, and numeric metadata fields alongside object IDs.
- Append-Only File (`AOF`) Persistence & Leader-Follower Replication: Persists mutations to disk automatically for crash recovery and supports read-replica scaling.
- 100% Free & Open-Source (MIT License): Runs as a single cross-platform binary or official Docker container on Linux, macOS, and Windows.
- Official Links: Free Trial, Free / Education & Pricing
Always download Tile38 binaries, Docker images, and documentation directly from official portals:
- Official Tile38 Website & Documentation: https://tile38.com/
- Official Tile38 GitHub Repository & Releases: https://github.com/tidwall/tile38
- Official Tile38 Commands Reference: https://tile38.com/commands/
- Official Tile38 Docker Hub Image: https://hub.docker.com/r/tile38/tile38
4. Step-by-Step Installation Guide
- Check Operating System & Memory Requirements: Confirm your Linux, macOS, or Windows (64-bit) server has sufficient RAM for your tracked spatial objects and SSD storage for the Append-Only File (`data/appendonly.aof`).
- Download Official Binary, Homebrew Package, or Docker Image: Install via Homebrew (`brew install tile38`), pull the official Docker image (`docker pull tile38/tile38`), or download the pre-compiled release archive for Linux, macOS, or Windows from https://github.com/tidwall/tile38/releases.
- Start the Tile38 Server: Run `./tile38-server` (or `docker run -p 9851:9851 tile38/tile38`) to start listening on default port `9851`.
- Connect with `tile38-cli` & Verify: Open a second terminal and run `./tile38-cli` followed by `PING` (returning `PONG`) to confirm server readiness.

5. How to Use Tile38: Beginner Workflow
- Insert Moving Point Coordinates (`SET`): Inside `tile38-cli`, add vehicle locations to a `fleet` collection: `SET fleet truck1 POINT 16.556 104.752` and `SET fleet truck2 POINT 16.562 104.760`.
- Run a Radius Spatial Search (`NEARBY`): Query vehicles within 2,000 meters of a coordinate: `NEARBY fleet POINT 16.558 104.755 2000`.
- Store a GeoJSON Polygon Zone: Save a delivery or restricted zone polygon using `SET zones depot1 OBJECT {"type":"Polygon","coordinates":[[[104.74,16.54],[104.77,16.54],[104.77,16.57],[104.74,16.57],[104.74,16.54]]]}`.
- Create a Live Geofence Webhook (`SETHOOK`): Register a live geofence alert whenever any `fleet` vehicle enters or exits `depot1`: `SETHOOK depot_alert http://localhost:3000/webhook WITHIN fleet FENCE DETECT enter,exit GET zones depot1`.
- Integrate with Your Backend API or Web Map: Connect your Node.js, Python, Go, or PHP backend via standard Redis clients (or HTTP REST endpoint) and render live vehicle positions on MapLibre GL JS or Leaflet.
6. Frequently Asked Questions (FAQ)
- Is Tile38 completely free for commercial fleet tracking and IoT products?Yes. Tile38 is free and open-source software released under the permissive MIT License with no licensing fees or object limits.
- How does Tile38 differ from PostgreSQL/PostGIS?PostGIS is a full relational disk-backed SQL database ideal for complex spatial joins, large static cadastral layers, and ACID transactions, whereas Tile38 is an in-memory spatial engine built specifically for high-frequency real-time GPS updates and instant geofence event notifications.
- Does Tile38 save data if the server restarts?Yes. By default, Tile38 writes every mutation to an Append-Only File (`appendonly.aof`) on disk so all collections, objects, and geofence hooks reload automatically on restart.