I want my application which is wrote by NodeJS to use N1QL to query data from Couchbase cluster,
Following is two options for me:
-
Use Couchbase NodeJS SDK to query data from couchbase cluster;
PRO:
NodeJS SDK will manage couchbase cluster,application only focus on businuss;
CON:
N1QL will be inclueded in application,I want to separate data handle from application;
All N1QL will be executed with process of parsing and compiling execution plans; -
Use REST API to query data by PREPARE/EXECUTE statement;
PRO:
All query logic can package in REST API;
N1QL will be optimized execution without process of parsing and compiling execution plans;
CON:
application should manage couchbase cluster(query service node);
My choice is 2. I want to deploy a nginx server to loadbalnace and fail over the query service, there are two questions here:
- How to configrue nginx server to loadbalnace and fail over the query service?
As keshav_m suggest here,can some one give me some more detail information,such as health check of REST API endpoint/result explain/even nginx configuration - How to auto reload PREPARE statement after one node restart(fail over/restart/rebalnace etc)?
prasad suggest here,but how to add it into couchbase startup script?