Cassandra Or MongoDB For Our Location Based Application

Viewed 5336

We are looking at using a NoSQL database system for a large project. Currently, we have read a bit about MongoDB and Cassandra, though we have absolutely no experience with either. We are very proficient with traditional relational databases like MySQL and Microsoft SQL, but the NoSQL (key/value store) is a new paradigm for us.

So basically, which NoSQL database do you guys recommend for our use?

We do both heavy writes and reads. Basically we have tens of thousands of devices that are reporting:

device_id (int), latitude (decimal), longitude (decimal), date/time (datetime), heading char(2), speed (int)

Every minute. So, at peak times we need to be able to process hundreds of writes a second.

Then, we also have users, that are querying this information in the form of, give me all messages from device_id 1234 for the last day, or last week. Also, users do other querying like, give me all messages from device_1234 where speed is greater than 50 and date is today.

So, our initial thoughts are that MongoDB or Cassandra are going to allow us to scale this much easier then using a traditional database.

A document or value in MongoDB or Cassandra for us, might look like:

{
   device_id: 1234,
   location: [-118.12719739973545, 33.859012351859946],
   datetime: 1282274060,
   heading: "N",
   speed: 34
}

Which system do you guys recommend? Thanks greatly.

5 Answers

I have post on a location based app using MongoDB, just like the one you described. MongoDB, with it's strong query and index support, might make it a better choice for you. Just like Cassandra, MongoDB has partitioning and replication, for scaling read and writes. Their underlying architecture is very different.

Although you have not mentioned any location based queries, if you are interested in queries like "give me all the devices within the radius r of location l and between time t1 and t2", you will find MongoDB's geospatial query and indexing extremely useful.

Related