Home > OS >  How to connect to and access information on a NoSQL database using C
How to connect to and access information on a NoSQL database using C

Time:02-10

I want my code to be able to connect to a wide-column store database like Cassandra or DynamoDB and read/write information to it.

I have been working on a project primarily written in C and was able to use a MySQL database simply by including mysql.h header file and using some functions defined in this file to connect to the database and perform queries. I'm not sure if this is even the right way, but it gets the job done.

However, my project requires data to be stored in such a way that an entity can have multiple values under a single attribute (eg. hobbies: {fishing, camping, coding} )and so, I've come to a realization that RDBMS is not efficient in this scenario and decided to shift to a wide-column store database. But, I am not able to find any sort of guildlines on how I can connect to Cassandra or DynamoDB and perform queries using C .

CodePudding user response:

You can use Datastax C/C driver for connecting your application with Cassandra database.

CodePudding user response:

There's a full working example of a C app which shows how to connect to an Apache Cassandra database here -- Developing your app with the C driver. You can re-purpose/re-factor the app for your needs.

If it's your first time developing apps for Cassandra, there are free tutorials, code samples and other resources on datastax.com/dev for developers.

And in case you're interested, Stargate.io is an open-source data gateway which allows you to connect to a Cassandra DB using REST API, JSON/Document API or GraphQL API. Stargate allows you to code apps in your language of choice using APIs you're already familiar with and since it's open-source, it's free to use. Cheers!

  • Related