Home / Companies / Cockroach Labs / Blog / Post Details
Content Deep Dive

How We Built Scalable Spatial Data & Spatial Indexing in CockroachDB

Blog post from Cockroach Labs

Post Details
Company
Date Published
Author
Sumeer Bhola
Word Count
2,625
Language
English
Hacker News Points
153
Summary

CockroachDB has introduced support for spatial data storage and processing, compatible with PostGIS. The new feature enables the use of spatial indexing in a horizontally scalable, dynamically sharded database. This is achieved by using a divide the space approach, which divides the space being indexed into buckets of various sizes. CockroachDB's implementation uses the S2 library from Google for cell covering and ID assignment. The new feature also includes two new distributed query processors, inverted filterer and inverted joiner, that apply to spatial SELECT and JOIN queries. These processors evaluate general set expressions derived from the expressions being evaluated and can be distributed for scalable evaluation.