title: Cassandra Or MongoDB For Our Location Based Application
body: <p>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.</p>
  
  <p>So basically, which NoSQL database do you guys recommend for our use?</p>
  
  <p>We do both heavy writes and reads. Basically we have tens of thousands of devices that are reporting:</p>
  
  <p>device_id (int), latitude (decimal), longitude (decimal), date/time (datetime), heading char(2), speed (int)</p>
  
  <p>Every minute. So, at peak times we need to be able to process hundreds of writes a second.</p>
  
  <p>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.</p>
  
  <p>So, our initial thoughts are that MongoDB or Cassandra are going to allow us to scale this much easier then using a traditional database.</p>
  
  <p>A document or value in MongoDB or Cassandra for us, might look like:</p>
  
  <pre><code>{
     device_id: 1234,
     location: [-118.12719739973545, 33.859012351859946],
     datetime: 1282274060,
     heading: "N",
     speed: 34
  }
  </code></pre>
  
  <p>Which system do you guys recommend? Thanks greatly.</p>