The mobile revolution, epitomized by the rise of GPS-enabled smartphones, is transforming our lives – the way we travel, connect with like-minded people, track our goods and shipments, manage traffic congestion, get threat alerts, and hunt for Pokemon.

Many estimates place the number of smartphone subscribers at 2 billion, a number expected to grow to 6.1 billion by 2020. Each of these devices serves as a GPS-data emitting mobile sensor, providing geospatial data that can be used to track the movement of people, vehicles, and merchandise. Though this data presents rich opportunities for businesses to extract valuable insights and operational efficiencies, the sheer volume requires a modern scale-out analytic solution and technology that can process it without delay for timely actionable intelligence.

MemSQL is designed from the ground up as a massively parallel scale-out solution for real-time analytics with built-in support for geospatial queries. While geospatial capabilities are also available through other solutions, only MemSQL offers them in the context of an ACID-compliant in-memory scale-out operational data warehousing solution.

While MemSQL offers strong transactional semantics and ElasticSearch as a datastore offers no support for transactions at all, they both offer powerful geospatial analytics and it seems appropriate to benchmark MemSQL against ElasticSearch geolocation capabilities. In this analysis, we compare MemSQL geospatial query performance with ElasticSearch geolocation for tracking vehicles and creating alerts when the vehicles enter certain geofences. The alerts can be used to improve logistics and security, reduce congestion, and monitor vehicle fleets. We simulate an urban scenario with 10M-100M vehicles generating geospatial data points and 2000 geofences. The system is required to ingest updated geospatial data points from vehicles and identify vehicles that show up within specified geofences.

MemSQL queries for creating schema for geofences and vehicles

MemSQL query for updating vehicles geolocation

MemSQL query for checking intersection of vehicles with geofences

ElasticSearch geolocation mapping (schema) for geofences and vehicles

ElasticSearch query for inserting vehicle geolocation

ElasticSearch query for checking intersection of vehicles with geofences

We ran MemSQL 5.1 and ElasticSearch 2.3.5 on 1, 5, and 10 node clusters of m4.10xl instances on AWS. Our benchmarking results show that on 10 nodes, MemSQL is 24x faster than ElasticSearch for queries that update vehicle geolocations in terms of rows/second.

We found MemSQL to be more than 2X faster than ElasticSearch for queries that find intersection of geolocations with geofences in terms of queries/second.

MemSQL presents a compelling option because it offers superior geolocation query performance in addition to strong transactional support and the full feature set of a leading operational data warehouse. MemSQL is the preferred option for enterprises that need to monitor geolocations for people, vehicles, and goods in real time.

For complete details of the benchmark including scripts, please visit

Feel free to download MemSQL if you’d like to try it yourself: