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

Contributor(s): Alan Boudreault - derived from here


  • How to limit async concurrent requests using the DataStax Python Driver

Project Layout

  • uses a Queue to cap the number of simultaneous requests triggered by the Python driver while executing asynchronously.

How this works

After running the docker command, there will be a running instance of the DataStax Distribution of Apache Cassandra.

The Python program executes requests in a non-blocking, asynchronous manner while limiting the number of in-flight requests.

Setup & Running



Make sure Cassandra Python Driver is installed

pip install cassandra-driver

Clone this repository

git clone

Go to the directory

cd concurrent-requests-python

Start the DDAC docker container

docker run -e DS_LICENSE=accept --name ddac -p -d datastax/ddac 


Run the Python program


Expected Output

Finished executing 10000 queries with a concurrency level of 32 in 2.61 seconds.