-2

I am building a PHP application using CouchBase (mostly), but still not completely clear on the best approach for fetching contents. There are 2 different ways to get data (if I am correct)

  1. Using View functions
  2. Querying Data with N1QL

That mean I can get same content using these 2 options..

For my developments purpose (n1sql) second option is more suitable. But still I am willing to rewrite my models to use more view functions, if that approach works well (in terms good performance, less RAM and CPU usage, less maintenance costs, etc. )

Please share your thoughts about this.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
tradebel123
  • 435
  • 1
  • 5
  • 20
  • My thoughts: 1) CouchDB doesn't support N1QL, that's a Couchbase thing. 2) Whether you should use views or Mango/N1QL depends on many variables, not a single one of which you have provided in your question. 3) Premature optimization is the root of all evil. 4) Whenever you have the question "Is X or Y faster?" the _ONLY_ way to answer is to test both X and Y and measure. – Jonathan Hall Dec 18 '17 at 08:50
  • yeah updated it was typos, was couchbase i refer.. please answer the question if you know something or have some experience, please..? @Flimzy – tradebel123 Dec 18 '17 at 11:24
  • 1
    Check this out https://blog.couchbase.com/comparing-couchbase-views-couchbase-n1ql-indexing/ – vsr Dec 20 '17 at 05:59

1 Answers1

0

the answer depend of your implementation and how do you display your data you can use views for map reduce implementation or for example if the requirement is only display one field of document (more simply) you only need a n1ql request there are many clause that you can use with n1ql even if you have arrays in your documents

¿can you be more explicit in your question?