See all blog posts

GoCQL and GoCQLX: Connecting Your Go Applications to ScyllaDB

gocql

When creating applications that communicate with a database such as ScyllaDB, it is crucial that the programming language being used has support for database connectivity Go, for example, was introduced in 2009 but it took time for the community to add packages and drivers for database communication. Luckily In 2014, GoCQL was created to address developers needs.

GoCQL provides an efficient way to interact with ScyllaDB with Go applications. For example, it will automatically discover all of the data centers, racks and hosts in your cluster, and manages a pool of connections to them and distributes queries in an efficient way.

GoCQL also has enhanced query tracing. With this ability, developers can trace queries made and get a verbose output of the events. This is useful for troubleshooting purposes such as bug identification and examining performance issues.

Out of the box, GoCQL has a few defaults that serve the developer’s best interest. For example, users can reduce network traffic to ScyllaDB with Frame Compression, and with Type Conversion, safe type conversion between ScyllaDB and the application is automatic and safe without loss or precision.

GoCQL has a thriving community and other projects that use it such as GoCQLX, an extension to GoCQL that aims to boost developer productivity while not sacrificing query performance.

GoCQLX builds on top of GoCQL and provides:

  • Builders for creating queries
  • Support for named parameters in queries
  • Support for binding parameters from struct fields, maps, or both
  • Scanning query results into structs based on field names
  • Convenience functions for common tasks like loading a single row into a struct or all rows into a slice (list) of structs

There are many more interesting features to GoCQL. To learn more, you can view the entire presentation by GoCQL maintainer Chris Bannister from ScyllaDB Summit 2017 below:

Want to learn more about ScyllaDB? Check out our download page to run ScyllaDB on AWS, install it locally in a Virtual Machine, or run it in Docker.

 

Blog Subscribe Mascots in Paper Airplane

Subscribe to the ScyllaDB Blog

For Engineers Only. Subscribe to the ScyllaDB Blog. Receive notifications about database-related technology articles and developer how-tos.