CockroachDB + GeoServer = Horizontally Scalable Spatial Apps

CockroachDB is a relational database that looks very much like PostgreSQL but with the added benefits of horizontal scalability, zero-downtime upgrades, and the ability to survive the loss of a node, an availability zone, or even an entire cloud region. With its recently added spatial capabilities, which are very closely aligned with PostGIS, developers of spatial applications now have an option for when they need a scale out data store. GeoServer is a popular open-source server that allows users to edit and display spatial data. GeoServer is OGC compliant and interoperable with commonly used mapping software such as OpenLayers, Leaflet.js, MapBox, and Google Earth.

If you're curious about how to integrate these two technologies, please read on. The process is very much like adding PostgreSQL as a vector data source, with the exception of the two details I'll elaborate on below. First, you need to log into the CockroachDB instance via a SQL client as a user with "admin" credentials, then make the following change: