Skip to content

Execute multiple concurrent requests asynchronously with Cassandra using the Node.js DataStax Driver

License

Notifications You must be signed in to change notification settings

DataStax-Examples/concurrent-requests-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Concurrent Requests in Node.js

This example shows how execute multiple concurrent requests asynchronously with Apache Cassandra™ using the Node.js DataStax Driver.

Contributor(s): Jorge Bay Gondra - derived from here

Objectives

  • How to limit async concurrent requests using the Node.js DataStax Driver

Project Layout

How this Works

The Node.js programs write rows to the database asynchronously while limiting the amount of concurrent requests in flight.

Setup & Running

Setup

Make sure Cassandra Node.js Driver is installed

npm install cassandra-driver

Running

  • execute-concurrent-builtin-way.js
node execute-concurrent-builtin-way.js <database-ip> <datacenter-name> <concurrency-level>
  • execute-concurrent-promise-way.js
node execute-concurrent-promise-way.js <database-ip> <datacenter-name> <concurrency-level>

About

Execute multiple concurrent requests asynchronously with Cassandra using the Node.js DataStax Driver

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published