title: Why would I want to use a non-relational database?
body: <p>The latest craze in databases seems to be centered around non-relational databases. Why? It seems kind of counterproductive. For example, it makes much more sense to me to express my data in a relational way (example code in Django + SQL for tables):</p>
  
  <pre><code>class Post(models.Model):
      name = models.CharField()
      created = models.DateTimeField(auto_now_create = True)
  
  class Comment(models.Model):
      text = models.TextField()
      post = models.ForeignKey('Post')
      created = models.DateTimeField(auto_now_create = True)
  </code></pre>
  
  <p>SQL:</p>
  
  <pre><code>create table post (id int primary key auto_increment,
          name varchar,
          created datetime);
  
  create table comment(id int primary key auto_increment,
          text text,
          post_id int,
          created datetime,
          foreign key post_id references post(id));
  </code></pre>
  
  <p>The power of SQL is that this information can be expressed in  <em>so</em> many ways. Sure, the whole object-relational-mapping problem exists, but I look at it as a feature and not as a problem. With SQL, I can fetch all distinct comments of a given post which are older than yesterday, collate all of those together, and generate statistics. Can the same be done for non-relational databases?</p>
  
  <p>It also would seem to really impact performance to use a non-relational database like MongoDB because you would immediately grab an entire object graph, rather than what you minimally need. </p>
  
  <p>Can someone explain to me what the benefits are of using a non-relational database? </p>