10

I am preparing to build an Android/iOS app that will require me to make complex polygon and containment geospatial queries. I like Apache Cassandra's no single point of failure, fault tolerance and data center awareness. Cassandra does not have direct support for geospatial queries (that I am aware of) but MongoDB and Couchbase Server do. MongoDB has scaling issues and I'm not sure if Couchbase would be a better alternative than Cassandra with Solr or Elasticsearch.

Would I be making a mistake by going with Datastax Enterprise (DSE), Cassandra and Elasticsearch over Couchbase Server? Will there be a noticeable difference in load times for web pages with the Cassandra/ES back end vs. Couchbase?

Community
  • 1
  • 1
Louisrr
  • 145
  • 1
  • 8
  • 4
    You're asking a list of questions here, some of which duplicates other questions (http://stackoverflow.com/questions/22868588/is-there-a-reason-that-cassandra-doesnt-have-geospatial-support) and some of which is "primarily opinion-based." Did you look for other SO questions that are similar? – Don Branson Jun 09 '14 at 14:07
  • Can it be done successfully with Cassandra? – Louisrr Jun 09 '14 at 14:43
  • 2
    *Can* it be done with Cassandra? Likely, yes. Can it be done *easier and/or more efficiently* using another technology? That depends on your skills. – Philipp Jun 10 '14 at 08:55
  • What do you recommend? – Louisrr Jun 10 '14 at 14:40
  • @starjamz I don't know your projects scope and requirements or your teams skillset or preferred way of working, so I can not recommend you anything. – Philipp Jun 11 '14 at 12:15
  • I'm voting to close this question as off-topic because the question is primarily opinion-based. – coatless Oct 14 '16 at 12:56

4 Answers4

6

Aerospike just released Server Community Edition 3.7.0, which includes Geospatial Indexes as a feature.

Aerospike can now store GeoJSON objects and execute various queries, allowing an application to track rapidly changing Geospatial objects or simply ask the question of “what’s near me”. Internally, we use Google’s S2 library and Geo Hashing to encode and index these points and regions. The following types of queries are supported:

  • Points within a Region
  • Points within a Radius
  • Regions a Point is in

This can be combined with a User-Defined Function (UDF) to filter the results – i.e., to further refine the results to only include Bars, Restaurants or Places of Worship near you – even ones that are currently open or have availability. Additionally, finding the Region a point is in allows, for example, an advertiser to figure out campaign regions that the mobile user is in – and therefore place a geospatially targeted advertisement. Internally, the same storage mechanisms are used, which enables highly concurrent reads and writes to the Geospatial data or other data held on the record. Geospatial data is a lot of fun to play around with, so we have included a set of examples based on Open Street Map and Yelp Dataset Challenge data.

Geospatial is an Experimental feature in the 3.7.0 release. It’s meant for developers to try out and provide feedback. We think the APIs are good, but in an experimental feature, based on the feedback from the community, Aerospike may choose to modify these APIs by the time this feature is GA. It’s not intended for Production usage right now (though we know some developers will go directly to Production ...)

Mnemaudsyne
  • 513
  • 4
  • 13
  • 1
    I think the Geospatial Index is now included in the standard version of Aerospike. I am now running it as a system of engagement for a geospatial data-enabled application. – Louisrr Sep 18 '16 at 16:28
  • That is correct. The geospatial feature became generally available (GA) with the release of Aerospike server v3.8.1 in April 2016: http://www.aerospike.com/blog/aerospike-3-8-release/ – Mnemaudsyne May 04 '17 at 21:23
3

Aerospike provides a proven highly scalable NoSQL solution. Geospatial query has recently been added, and an Early Adopter release has just been announced. You might want to check that out.

Alvin R
  • 49
  • 3
2

Redis is probably one of the best alternatives. At the current time you would need to use Redis Unstable 3.2. The performance is oustanding. I have been using this with the lettuce java client and have seen incredible results. The larger the radius will decrease performance.

http://redis.io/commands/geohash

Chris Hinshaw
  • 6,967
  • 2
  • 39
  • 65
  • 1
    I used Redis at work one night with SpringBoot and it isn't a true database. Regis is essentially a data structure server and is fast but I believe Aerospike is faster. – Louisrr Sep 18 '16 at 16:30
0

You are asking quite a few questions, as has been pointed out. The provided link offers one potential answer to how generic geospatial operations could be implemented using Cassandra. I'll offer one possible answer using straightforward out-of-the-box Cassandra constructs.

  1. Using geohashes (or quad trees), or something similar, create an index of geohashes and their associated polygons. The specific relationship and level(s) of precision are dependent on your data set and use case.

  2. To determine which polygons intersect with a given point or polygon, first compute its geohash(es), then look those geohashes up in the index. For general proximity, this may be sufficient. Either way, this narrows the potential intersection points down to a manageable set.

rs_atl
  • 8,935
  • 1
  • 23
  • 28
  • 2
    Ok so I found the answer to my own question and a good solution is Aerospike. Aerospike is an in-memory computing (IMC), key/value (NoSQL) database that writes asynchronously to solid state disks (SSDs). Aerospike has a version of it's IMC database that includes geospatial indexes and enables fast geospatial queries in beta. I now have this database installed on my AWS account now. http://www.aerospike.com/ – Louisrr Jul 10 '15 at 18:10
  • 1
    @Louisrr Are you still happy with it ? I'm facing the same kind of problem (and considering the same databases - had not heard of aerospike). – nha Aug 20 '15 at 08:01
  • 1
    Sorry for the lengthy response time. Yes Aerospike 3.8+ is solid and includes the geospatial index for making geospatial queries at scale. If you need sub 10-millisecond response times use Aerospike and a fast server technology like C, GO, Node or C++ ([Seastar](http://www.seastar-project.org/)) – Louisrr Apr 12 '17 at 22:38