Comments (9)
This is definitely on our roadmap to add. Thanks.
from aerospike-client-nodejs.
+1, and also scan api like Java. without a query mechanism, the NodeJS client is incomplete/not production ready, you'd better mark it as "alpha" or "preview release".
from aerospike-client-nodejs.
It's not that simple, since node.js is single threaded. Personally what I ended up doing for a project was make a C process that I spawn in my node.js module and converse back and forth via stdin/out and it performs well (300m results in batches of 1000 results each, performs for us ~30k results a second).
from aerospike-client-nodejs.
ic. so a technical challenge is NodeJS client uses C client, and it cannot easily sprawn new thread/process so operation that load a let of records will block the while NodeJS app. I think there are many uses of using NodeJS client that may tolerate the limitation, e.g.
- for admin or ad-hoc operation like data patching
- query for a very small set of data with index
the dev may consider to implement the query api, and give a strong warning on the limitation. And then address the process spawning issue and Scan API later.
from aerospike-client-nodejs.
+1 how do i do set scans?
from aerospike-client-nodejs.
A bunch of design discussions here at Aerospike Central, we think we've found the right implementation path to get various queries in soon. Thanks for the comment about reasonable limitations.
from aerospike-client-nodejs.
i guess it is possible to use the java driver in nodejs
like nodejs jdbc module works but it needs figuring out how to do it
simple working code:
//index.js
//npm init
//npm install java
//download latest jar with dependencies http://www.aerospike.com/download/client/java/
//help on java: https://github.com/joeferner/node-java
if(require.main === module) { var repl = require("repl");repl.start({ useGlobal:true, useColors:true, }); }
//some variables are without var to put them in global so it will be visible in repl
var java = require("java");
java.classpath.push("aerospike-client-3.0.28-jar-with-dependencies.jar");
var AerospikeClient = java.import('com.aerospike.client.AerospikeClient');
//var ClientPolicy = java.import('com.aerospike.client.policy.ClientPolicy');
//var WritePolicy = java.import('com.aerospike.client.policy.WritePolicy');
Bin = java.import('com.aerospike.client.Bin');//global
Key = java.import('com.aerospike.client.Key');//global
Record = java.import('com.aerospike.client.Record');//global
newBinsArray = function(arr){return java.newArray("com.aerospike.client.Bin", arr)}
/*
policy = new ClientPolicy();
policy.user = params.user;
policy.password = params.password;
policy.failIfNotConnected = true;
var ArrayList = java.import('java.util.ArrayList');
var list = new ArrayList();
list.addSync('item1');
java.newInstanceSync("java.lang.Long", 5);
var client = new AerospikeClient(policy, "10.0.2.15", "3000");
*/
//writePolicy =new WritePolicy();//global
client = new AerospikeClient("127.0.0.1", 3000);//global
var key = new Key("test", "demo", "putgetkey");
var bin1 = new Bin("bin1", "value1");
var bin2 = new Bin("bin2", "value2");
var binsArray = java.newArray("com.aerospike.client.Bin", [bin1, bin2]);
// Write a record
//client.putSync(writePolicy, key, binsArray);
client.putSync(null, key, binsArray);
// Read a record
var record = client.getSync(null, key);
if (record == null) {
console.log('record not found');
}
else
{
var received1 = record.getValueSync(bin1.name);
var received2 = record.getValueSync(bin2.name);
console.info("Bin matched: namespace=%s set=%s key=%s bina=%s valuea=%s binb=%s valueb=%s generation=%d expiration=%d",
key.namespace, key.setName, key.userKey, bin1.name, received1, bin2.name, received2, record.generation, record.expiration);
}
//client.closeSync();
//probably any operation that is over network or disk should be async here is an async version,
//just append callback to end with err and result as the return value.
//var client = new AerospikeClient("127.0.0.1", 3000);
var key = new Key("test", "demo", "putgetkey");
var bin1 = new Bin("bin1", "value11");
var bin2 = new Bin("bin2", "value22");
// Write a record
//client.putSync(writePolicy, key, binsArray);
client.put(null, key, newBinsArray([bin1, bin2]), function(err,result){
// Read a record
client.get(null, key,function(err,record){
if (record == null) {
console.log('record not found');
}
else
{
var received1 = record.getValueSync(bin1.name);
var received2 = record.getValueSync(bin2.name);
console.info("Bin matched: namespace=%s set=%s key=%s bina=%s valuea=%s binb=%s valueb=%s generation=%d expiration=%d",
key.namespace, key.setName, key.userKey, bin1.name, received1, bin2.name, received2, record.generation, record.expiration);
}
//client.closeSync();
});
});
from aerospike-client-nodejs.
Will there be any updates on the node aerospike client soon? I checked that last updates on this repository is about 3~4 months ago. And I want to know that query and streaming UDF feature will be included.
from aerospike-client-nodejs.
Hi,
We have just released scan and query feature today. Please use the new API and give us your feedback.
from aerospike-client-nodejs.
Related Issues (20)
- Error: Running aerospike client on Arm64(aarch) on MacOS HOT 7
- What is the latest version of Aerospike goes with Ubuntu 18.04 HOT 2
- error TS2304: Cannot find name 'Class' HOT 12
- Does aerospike-client-nodejs need python on runtime as well? HOT 1
- I cant install on windows 10 HOT 2
- Issue with using client.operate with policy exists: AS.policy.exists.CREATE HOT 1
- Serialized and blocking connection
- Unable to install aerospike with nexus3 HOT 16
- Unable to install v5.9.0 with yarn, published version requires "npm-run-all" HOT 3
- System's openssl version since static linking in v5.6.0 HOT 4
- Missing 'bool/AS_EXP_TYPE_BOOL' in exp bin type HOT 2
- Unable to use pnpm package manager because of preinstall script of the package HOT 2
- Client.close(true) does not release underlying event loop HOT 2
- Segmentation fault with secondary index query HOT 12
- Typescript build fails HOT 1
- Segmentation fault crash core dump with 5.11.0 HOT 3
- Can't install with node 22 HOT 2
- --build-from-source is broken on Rocky 9, node 20
- Unable to get a record by filter 'contains' if bin array includes > 1 element
- Unable to find record by regexp pattern
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aerospike-client-nodejs.