How to write a Cassandra Service

Firstly, Congratulations for creating a GREAT product. I have been exploring the DSP and it’s amazing. I would like to use Cassandra as my data store. Please guide me in moving forward. Is there any existing driver or service to do so. If not, then, how can I connect to Cassandra using DSP. Thank you.

sorry for the delay. lee will post info on this shortly.

@kumaranna We currently do not support Apache Cassandra out of the box, nor is it currently on the roadmap, though it would be a great addition to the NoSQL offering. Do you have PHP experience and knowledge of working with Cassandra? If so, I can walk you through our setup so that you could get it working or even better contribute back to the project. Let me know, thanks, otherwise I will take a look when I get a chance.

Hey Ben, You are a star. Thank you very much.

Hey Lee, Thanks for your update. I am interested in working on Cassandra Service. Currently, I am trying to dissect and digest the CouchDB service. Any pointers in the right direction will be helpful. Thank you very much.

CouchDB probably is not the best example to go by as it doesn’t have a filter language per se. To start, check out drivers available here (some are old or abandoned) or the DataStax driver on the same page (popular and recent).

You can create a new repo modeled after the df-couchdb or df-aws (DynamoDb is somewhat similar in nature) and pull your new service type into the project via composer, check out the migrations and seeder files to inject your service type, etc. From there, check our df-core for src/Services/BaseDbService.php (for connection setup) and the src/Resources/BaseDbSchemaResource.php (for pulling together table and index listings) and the src/Resources/BaseDbTableResource.php (for record CRUD operations including filters). Code for the abstract methods and override any necessary methods.

Let me know how it goes.

1 Like

Hey Lee. Awesome. DataStax driver appears to be the best bet as of now. Will try and get this working. Thank you very much.

1 Like

Lee, I was under the impression that with DreamFactory 2.0’s support for Nodejs scripting, I would be able to shortcut this in a way. I created a Custom Scripting Service with a nodejs script. The script uses the nodejs cassandra-driver, but when calling the API, the response is never returned. The line is question is the client.connect…removing this line allows the call to complete successfully. Am I missing something here? Is there a better way to interface with a Cassandra backend?

var cassandra = require('/path/to/nodejs/modules/cassandra-driver');
var options = {
        contactPoints: ['cassandraserver'],
        authProvider: new cassandra.auth.PlainTextAuthProvider('username', 'password')
var client = new cassandra.Client(options);
client.connect(function(err, result) {
return {success: 'yay'};