Chapter 1. Developing for Oracle NoSQL Database

Table of Contents

Installing the Driver
Using the Proxy Server
Connecting to the Store
Connecting to a Secure Store
Automatically Starting the Proxy Server
The Configuration Class
The ProxyConfiguration Class
Working with a Secured Store
Configuring SSL
Setting the Security Properties for a Proxy Server

You access the data in the Oracle NoSQL Database KVStore using node.js drivers that are provided for the product. In addition to the node.js drivers, several other drivers are also available. They are:

  1. Java Table Driver

  2. Java Key/Value Driver

  3. C Table Driver

  4. C Key/Value Driver

  5. Python Table Driver

Note

New users should use one of the Table drivers unless they require a feature only available in the Key/Value API (such as Large Object support). The Key/Value API will no longer be enhanced in future releases of Oracle NoSQL Database.

The Java and C Key/Value driver provides access to store data using key/value pairs. All other drivers provide access using tables. Also, the Java Key/Value driver provides Large Object (LOB) support that as of this release does not appear in the other drivers. However, users of the Java Tables driver can access the LOB API, even though the LOB API is accessed using the Key/Value interface.

Users of the Table drivers are able to create and use secondary indexing. The Java and C Key/Value drivers do not provide this support.

To work, the C Table, Python Table, and node.js Table drivers require use of a proxy server which translates network activity between the driver and the Oracle NoSQL Database store. The proxy is written in Java, and can run on any machine that is network accessible by both your client code and the Oracle NoSQL Database store. However, for performance and security reasons, Oracle recommends that you run the proxy on the same local host as your driver, and that the proxy be used in a 1:1 configuration with your drivers (that is, each instance of the proxy should be used with just a single driver instance).

Regardless of the driver you decide to use, the provided classes and methods allow you to write data to the store, retrieve it, and delete it. You use these APIs to define consistency and durability guarantees. It is also possible to execute a sequence of store operations atomically so that all the operations succeed, or none of them do.

The rest of this book introduces the node.js APIs that you use to access the store, and the concepts that go along with them.

Note

The node.js driver is compatible with Node.js 0.10.26 and later. It is also compatible with io.js 1.7.1 and later.

Installing the Driver

To run your node.js clients, you need to have the nosqldb-oraclejs module installed locally or globally. You can install nosqldb-oraclejs in the node.js driver directory by using the following command:

npm install [-g] nosqldb-oraclejs 

nosqldb-oraclejs is the module name of the Oracle NoSQL Database node.js Client driver published on http://www.npmjs.org. If -g is specified, the command installs the specified module so that it is globally accessible.

Then, to use the module, include nosqldb-oraclejs in your client code:

var nosqldb = require('nosqldb-oraclejs');