GoCQL and GoCQLX: Connecting Your Go Applications to Scylla
When creating applications that communicate with a database such as Scylla, 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 Scylla 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 Scylla with Frame Compression, and with Type Conversion, safe type conversion between Scylla 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 Scylla Summit 2017 below or watch the video above:
Want to learn more about Scylla? Check out our download page to run Scylla on AWS, install it locally in a Virtual Machine, or run it in Docker. You can also take Scylla for a test drive. Our Test Drive lets you quickly spin-up a running cluster of Scylla so you can see for yourself how it performs.