Using the Proxy Server

The proxy server is a Java application that accepts network traffic from the node.js Table driver, translates it into requests that the Oracle NoSQL Database store can understand, and then forwards the translated request to the store. The proxy also provides the reverse translation service by interpreting store responses and forwarding them to the client.

The proxy server can run on any network-accessible machine. It has minimal resource requirements and, in many cases, can run on the same machine as the client code is running.

Before your node.js client can access the store, the proxy server must be running. It requires the following jar files to be in its class path, either by using the java -cp command line option, or by using the CLASSPATH environment variable:

Note

The proxy server, kvclient and their dependencies reside in the MODULE_INSTALL/node_modules/nosqldb_oraclejs/kvproxy directory.

The proxy server itself is started using the oracle.kv.proxy.KVProxy command. At a minimum, the following information is required when you start the proxy server:

A range of other command line options are available. In particular, if you are using the proxy server with a secure store, you must provide authentication information to the proxy server. (Note that the proxy server itself connects to a single store using a single user credential. If multiple stores or users are required, then multiple proxy servers must be used.) In addition, you will probably have to identify a store name to the proxy server. For a complete description of the proxy server and its command line options, see Proxy Server Reference.

The examples provided in this guide were written to work with a proxy server that is connected to a kvlite instance which was started with default values. The location of the kvclient.jar and kvproxy.jar files were provided using a CLASSPATH environment variable. The command line call used to start the proxy server was:

nohup java oracle.kv.proxy.KVProxy -port 7010 \
-helper-hosts localhost:5000 -store kvstore

Usage of kvlite is described in Introduction to Oracle KVLite.