Node.JS Thin Client
This is a legacy Apache Ignite documentationThe new documentation is hosted here: https://ignite.apache.org/docs/latest/
Overview
This thin client allows your Node.JS applications to work with Apache Ignite clusters via Binary Client Protocol.
A thin client is a lightweight Ignite client that connects to the cluster via a standard socket connection. It does not start in JVM process (Java is not required at all), does not become a part of the cluster topology, never holds any data or used as a destination of compute grid calculations.
What it does is it simply establishes a socket connection to a standard Ignite node and performs all operations through that node.
For more information, visit:
- Initialization and Configuration to learn how to configure and obtain references of the thin client APIs currently supported.
- Key-Value Operations to learn which JCache APIs are supported supported.
- SQL Queries to learn how use SQL with the Java thin client API.
- Binary Types to learn how use the Ignite Binary Objects API with the Node.JS thin client API.
- Security to see the thin client has enough protection to connect to an enterprise Ignite cluster over Internet.
Quick Start
Prerequisites
- Node.js version 8 or higher is required. Either download the Node.js pre-built binary for the target platform, or install Node.js via package manager.
- Latest version of Apache Ignite.
Once node and npm are installed, you can use one of the following installation options.
Installation via npm
Execute the following command to install the Node.js Thin Client package:
npm install -g apache-ignite-clientInstallation from Sources
If you want to build and install the Thin Client library from the Ignite repository, please follow the steps:
- Clone or download Ignite repository https://github.com/apache/ignite.git to
local_ignite_path. - Go to
local_ignite_path/modules/platforms/nodejsfolder. - Execute
npm linkcommand. - Execute
npm link apache-ignite-clientcommand (needed only for examples and tests).
cd local_ignite_path/modules/platforms/nodejs
npm link
npm link apache-ignite-client #linking examples (optional)Running an Example
Let's use existing Node.JS examples that are delivered with every Ignite distribution for the sake of quick getting started.
- Run Apache Ignite server.
Before connecting to Ignite from Node.JS thin client, start at least one Ignite cluster node. To start a cluster node with the default configuration, open the terminal and, assuming you are inIGNITE_HOME(Ignite installation folder), just type this:
./ignite.shignite.bat- Link Ignite Node.JS examples if you haven't done this yet:
cd {ignite}/modules/platforms/nodejs/examples # navigate to examples folder
npm link apache-ignite-client #link examplesIf needed, modify ENDPOINT constant in an example source file which represents a remote Ignite node endpoint. The default value is 127.0.0.1:10800.
- Run an example by calling
node <example_file_name>.js, as follows:
node CachePutGetExample.js
Node.JS example filesNode.JS thin client contains fully workable examples to demonstrate the behavior of the client.
Updated 9 months ago
