A fast and robust Go client driver for Apache Cassandra, implementing the native CQL binary protocol.
gocql is a Go client driver for Apache Cassandra that implements the native CQL binary protocol. It provides a robust interface for Go applications to interact with Cassandra clusters, handling connection management, query execution, and data type conversions automatically. The driver supports modern Cassandra features including vector types for AI/ML workloads and is production-tested across many Cassandra versions.
Go developers building applications that need to interact with Apache Cassandra or ScyllaDB databases, particularly those requiring high-performance data access in distributed systems.
Developers choose gocql because it's the most mature and feature-complete Cassandra driver for Go, offering native protocol support, excellent performance, and reliability for production use. Its extensive ecosystem of extensions and tools provides flexibility while maintaining a clean, idiomatic Go API.
GoCQL Driver for Apache Cassandra®
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Full compatibility with Cassandra 2.1+ through 5.0+, including protocol versions 3,4,5 and vector types for AI/ML, ensuring optimal performance and access to modern features.
Seamless mapping between Cassandra and Go types for collections and custom types via Marshaler/Unmarshaler interfaces, reducing boilerplate code and errors.
Token-aware routing, automatic node discovery, and exponential backoff reconnection enhance reliability and performance in distributed Cassandra deployments.
Structured logging with Zap and Zerolog, query tracing, and a vibrant ecosystem of extensions like gocqlx for higher-level abstractions and productivity.
Version 2.0.0 introduced breaking changes requiring an upgrade guide, which can disrupt existing codebases and increase migration effort.
No longer supports 'use <keyspace>' statements, forcing keyspace specification at session creation and complicating multi-tenant or dynamic schema applications.
Prioritizes code readability over performance in some cases, as admitted in the README, necessitating manual tuning like GOGC adjustment and query optimization.
Lacks built-in ORM or struct binding, relying on external packages like gocqlx for convenience, which adds dependency management and learning curve.