You’ve pretty much listed all the APIs. Typical use-cases for each API would be:
Key-Value - Use when you already know the key of the document(s) you are interested in. Typically the fastest access method.
Map/Reduce - Used for pre-defined views on your data, where there’s small number of common ways you want o view your data; as each view needs to be pre-defined on the cluster.
N1QL - Used for ad-hoc queries. Queries can be dynamic, only requires indexes to be pre-defined.
Thanks for your explanation.
When it comes to query a data with some conditions(ex. students who belongs to class A), which way is better in performance?
Using N1QL(WHERE class = ‘A’ ) or using another way to get the doc ID list and then retrieve it with Key-Value(bucket.get…)?