Code snippets, examples, and demo applications will help you get things done faster with Apache Cassandra™

Have you ever been in a situation where you were looking to accomplish a technical task, and went searching on the Internet for a similar example that someone has put the work into, completed, and/or shared?  You simply need to copy and paste to get going, and it can be a huge time saver.

DataStax Examples is a one-stop shop of code snippets, examples, and demo applications with the sole purpose of helping you get things done faster with Apache Cassandra and DataStax products. 

Whether you are new to these technologies or have years of experience, these examples show how to build better applications with a range of tooling and frameworks. The code is open source and available on GitHub.

The Example of the Week program is meant to encourage individuals, both inside and outside of DataStax, to contribute sample code to the DataStax Examples Github organization. Together, we are building this awesome collection of Cassandra code samples as a community, to help the community.

Take part in our program!

We are striving to make DataStax Examples and an extensive and diverse library of code samples to help developers on their journey with using Cassandra, and we need your help! 

Give this example a try, and create a Github issue to capture a bug, or suggest an improvement. Alternatively, submit a pull request. Or fork the repository, make some changes yourself, and submit it to us! We would love to see what you come up with!

This week’s example: Java Driver Code Samples (comparing 3.x and 4.x)

Contributed by: Cedrick Lunven  - Twitter @clunven and Erick Ramirez - Twitter @flightc

This repository contains a collection of standalone classes, each illustrating a dedicated feature of the DataStax Java Driver for Apache Cassandra. Code samples have been implemented for both Java driver 3.x (previous OSS) and Java driver 4.x (latest)

The purpose is to provide an extended list of code samples with explicit names to help speed up your development process (simply copy and paste useful code snippets). This example also

serves to educate on the differences between the two versions of the driver, in case you are considering an upgrade. 

There is also a Docker option available if you wish to use it, to help speed up the process.

What you will learn:

  • How to start working with the DataStax Java Driver for Apache Cassandra
  • How the 4.x version of the driver compares to 3.x in terms of API, improvements and new features

Watch the demo!

 

More resources: 

 

Up for a challenge?

We would love to have an example like this for the Python, Nod.js, and C# DataStax drivers as well! 

 

Show us what you got!

Build something on Cassandra! Share your demos and sample code with those who are still learning. If your example is selected to be the Example of the week, you will get all the publicity - plus a cool t-shirt!

Got something to share with us, fill out the DataStax Examples Submission Form with the details, and we will start you on your way to contributing! If you prefer, you can email example@datastax.com.

Whether you’re building an application or operating the database, we want to hear from you! Ask questions at the DataStax Examples Community Space!