title: Couchbase - When should i use N1QL vs Views?
body: <p>I'm learning Couchbase, now on version 3.x</p>
  
  <p>My doubt is, when should i use a <strong>N1QL</strong> query vs a <strong>View</strong> query? </p>
  
  <p>And, are there performance differences between them?</p>
  
  <hr>
  
  <p>Note: I have a situation:</p>
  
  <p>A <strong>Bucket</strong> with two <em>document types</em> for my Traveling App: <strong>Route</strong> and <strong>City</strong></p>
  
  <p>A <strong>Route</strong> doc holds the information about the traveling route and an array of <strong>City</strong> ids that are part of it, then another doc holds the city's information (each city having its own doc). Example:</p>
  
  <pre><code>//Bucket : "Traveling App"
  
  {
    "type" : "route"
    "name" : "The Great Adventure",
    "cities" : ["234", "h4345", "h42da"]
  }
  
  {
    "type" : "city",
    "name" : "Little Town",
    "UID"  : "234"
  }
  </code></pre>
  
  <p>When i query for a certain traveling route, should i do a <strong>N1QL</strong> query or a <strong>View</strong> query?</p>
  
  <p>Because i would have to first open the <strong>Route</strong> doc, get the <em>cities array</em> than get each <strong>City</strong> doc.</p>
  
  <p>And i think this architecture would be best, because some routes can have very few cities and others can have a lot of cities.</p>