tile38 is a free, open source databases project written in Go and released under MIT. It has 9,732 GitHub stars, 622 forks and 163 open issues, and was last pushed 16 days ago. On this registry it ranks #84 of 203 tracked projects in Databases, with 5 head-to-head comparisons available.

What is tile38?

Tile38 is an open source, MIT licensed, in-memory geolocation data store and spatial index that doubles as a realtime geofencing server, written in Go and aimed at developers who need to store, query, and react to location data in real time.

What it is

Tile38 is an in-memory geolocation data store, spatial index, and realtime geofencing server released under the MIT licence and written in Go. It holds objects as lat/lon points, bounding boxes, Geohashes, GeoJSON, QuadKeys, or XYZ tiles, keeps them in memory while persisting to disk, and answers spatial queries against them directly. It ships as three components — tile38-server, tile38-cli, and tile38-benchmark — and speaks HTTP, websockets, telnet, and the Redis RESP protocol, returning responses as either RESP or JSON. It is listed in this registry under Infrastructure & Operations / Databases.

The concrete problem it solves is answering "what is near this point, inside this box, or crossing this boundary" without bolting a spatial index onto a general-purpose store or computing distances in application code. It lives in the Redis ecosystem in the sense that it implements the Redis RESP wire protocol and interoperates with Redis-oriented tooling such as redis_exporter, so the specific thing it replaces is a general-purpose data store paired with hand-written distance arithmetic and a separate polling loop for fence checks. Geofence transitions are pushed out rather than polled, through webhooks or pub/sub channels.

Key capabilities

  • Spatial index with Nearby, Within, and Intersects searches, driven over collections: nearby fleet point 33.462 -112.268 6000 returns objects within six kilometers of a point.
  • Object types covering lat/lon points, bounding boxes (bbox), Geohash, GeoJSON, QuadKey, and XYZ tile.
  • Realtime geofencing delivered through webhooks via the SETHOOK command or through pub/sub channels.
  • Wire protocols of HTTP (usable with curl), websockets, telnet, and Redis RESP, with server responses in RESP or JSON.
  • Full command line interface: tile38-cli connects to localhost:9851 by default, and tile38-benchmark measures server throughput.
  • Leader / follower replication together with an in-memory database that persists on disk.
  • Fields for extra object data, always a double precision float, with no limit on how many fields an object carries.
  • Native Prometheus metrics behind the --metrics-addr flag, disabled by default, exposing a /metrics endpoint.

Who uses it and how

  • Fleet and vehicle tracking: the README example places truck1 and truck2 as points in a fleet collection on the Loop 101 and I-10 in Phoenix, then runs a nearby search within six kilometers to return the closer vehicle — proximity and dispatch lookup.
  • Geofence alerting pipelines: services register SETHOOK webhooks or subscribe to pub/sub channels so that downstream systems receive fence events without polling the store.
  • Multi-language application teams: the project documents client libraries in many languages, all reaching the server over HTTP, websockets, telnet, or RESP.
  • Operations and platform teams running a leader with followers for read scaling, scraping /metrics with Prometheus, and driving synthetic load with tile38-benchmark.

Getting started

The README's quickest path is Docker: docker pull tile38/tile38 then docker run -p 9851:9851 tile38/tile38. Prebuilt release binaries cover OSX, Linux, FreeBSD, and Windows, Homebrew provides brew install tile38 tile38-server on macOS, and the source builds with make and tests with make test.

How it compares

The facts provided name no paid products that Tile38 replaces and name no directly comparable geospatial server, so it stands alone in this registry. Its nearest adjacency is protocol-level rather than product-level: RESP compatibility means Redis clients and redis_exporter can talk to it, which is a fit question rather than a price question.

When to use it — and when not to

A self-hoster operates the tile38-server process, its on-disk persistence, any leader/follower topology, and must switch on the --metrics-addr flag explicitly to get Prometheus metrics. Because the working set is in-memory, teams whose location datasets exceed available RAM, or who need relational joins and SQL semantics, should look elsewhere. The README is explicitly a quick start document that defers to tile38.com, and the repository carries 163 open issues, so operators should expect to read the full documentation rather than rely on the README alone.

project readme (upstream, from github) — read inline

Slack Discord

Tile38 is an open source (MIT licensed), in-memory geolocation data store, spatial index, and realtime geofencing server. It supports a variety of object types including lat/lon points, bounding boxes, XYZ tiles, Geohashes, and GeoJSON.

This README is quick start document. You can find detailed documentation at https://tile38.com.

Features

Components

  • tile38-server: The server
  • tile38-cli: Command line interface tool
  • tile38-benchmark: Server benchmark tool

Getting Started

Getting Tile38

Perhaps the easiest way to get the latest Tile38 is to use one of the pre-built release binaries which are available for OSX, Linux, FreeBSD, and Windows. Instructions for using these binaries are on the GitHub releases page.

Docker

To run the latest stable version of Tile38:

docker pull tile38/tile38
docker run -p 9851:9851 tile38/tile38

Visit the Tile38 hub page for more information.

Homebrew (macOS)

Install Tile38 using Homebrew

brew install tile38
tile38-server

Building Tile38

Tile38 can be compiled and used on Linux, OSX, Windows, FreeBSD, and probably others since the codebase is 100% Go. We support both 32 bit and 64 bit systems. Go must be installed on the build machine.

To build everything simply:

$ make

To test:

$ make test

Running

For command line options invoke:

$ ./tile38-server -h

To run a single server:

$ ./tile38-server

# The tile38 shell connects to localhost:9851
$ ./tile38-cli
> help
Prometheus Metrics

Tile38 can natively export Prometheus metrics by setting the --metrics-addr command line flag (disabled by default). This example exposes the HTTP metrics server on port 4321:

# start server and enable Prometheus metrics, listen on local interface only
./tile38-server --metrics-addr=127.0.0.1:4321

# access metrics
curl http://127.0.0.1:4321/metrics

If you need to access the /metrics endpoint from a different host you'll have to set the flag accordingly, e.g. set it to 0.0.0.0:> to listen on all interfaces.

Use the redis_exporter for more advanced use cases like extracting key values or running a lua script.

Playing with Tile38

Basic operations:

$ ./tile38-cli

# add a couple of points named 'truck1' and 'truck2' to a collection named 'fleet'.
> set fleet truck1 point 33.5123 -112.2693   # on the Loop 101 in Phoenix
> set fleet truck2 point 33.4626 -112.1695   # on the I-10 in Phoenix

# search the 'fleet' collection.
> scan fleet                                 # returns both trucks in 'fleet'
> nearby fleet point 33.462 -112.268 6000    # search 6 kilometers around a point. returns one truck.

# key value operations
> get fleet truck1                           # returns 'truck1'
> del fleet truck2                           # deletes 'truck2'
> drop fleet                                 # removes all 

Tile38 has a ton of great commands.

Fields

Fields are extra data that belongs to an object. A field is always a double precision floating point. There is no limit to the number of fields that an object can have.

To set a field when setting an object:

> set fleet truck1 field speed 90 point 33.5123 -112.2693             
> set fleet truck1 field speed 90 field age 21 point 33.5123 -112.2693

To set a field when an object already exists:

> fset fleet truck1 speed 90

To get a field when an object already exists:

> fget fleet truck1 speed

Searching

Tile38 has support to search for objects and points that are within or intersects other objects. All object types can be searched including Polygons, MultiPolygons, GeometryCollections, etc.

Within

WITHIN searches a collection for objects that are fully contained inside a specified bounding area.

Intersects

INTERSECTS searches a collection for objects that intersect a specified bounding area.

Nearby

NEARBY searches a collection for objects that intersect a specified radius.

Search options

WHERE - This option allows for filtering out results based on field values. For example
nearby fleet where speed 70 +inf point 33.462 -112.268 6000 will return only the objects in the 'fleet' collection that are within the 6 km radius and have a field named speed that is greater than 70.

Multiple WHEREs are concatenated as and clauses. WHERE speed 70 +inf WHERE age -inf 24 would be interpreted as speed is over 70 and age is less than 24.

The default value for a field is always 0. Thus if you do a WHERE on the field speed and an object does not have that field set, the server will pretend that the object does and that the value is Zero.

WHERE expressions support the =~ operator for regex matching. It uses Go's re2 regular expression engine to match string values in fields or GeoJSON properties within objects. For example, WHERE properties.name =~ 'truck.*' filters objects where the 'name' property matches the pattern, and WHERE field_name =~ 'value.*' works similarly for fields.

MATCH - MATCH is similar to WHERE except that it works on the object id instead of fields.
nearby fleet match truck* point 33.462 -112.268 6000 will return only the objects in the 'fleet' collection that are within the 6 km radius and have an object id that starts with truck. There can be multiple MATCH options in a single search. The MATCH value is a simple glob pattern.

CURSOR - CURSOR is used to iterate though many objects from the search results. An iteration begins when the CURSOR is set to Zero or not included with the request, and completes when the cursor returned by the server is Zero.

NOFIELDS - NOFIELDS tells the server that you do not want field values returned with the search results.

LIMIT - LIMIT can be used to limit the number of objects returned for a single search request.

Geofencing

A readme truncated — read the full docs on github

Frequently asked questions

Is tile38 free to use?

tile38 is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does tile38 do?

Real-time Geospatial and Geofencing

What is tile38 written in?

tile38 is primarily written in Go. Its source is publicly available at https://github.com/tidwall/tile38, and it has 9,732 GitHub stars.