cassandra-gocql-driver
GoCQL is the official Apache Cassandra driver for Go, providing a modern, production-ready client for building applications that use Cassandra as their database. It handles connection pooling, automatic type conversion, batching, and cluster management out of the box.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | apache/cassandra-gocql-driver |
| Owner | apache |
| Primary language | Go |
| License | Apache-2.0 — OSI-approved |
| Stars | 2.7k |
| Forks | 650 |
| Open issues | 156 |
| Latest release | v2.1.2 (2026-06-16) |
| Last updated | 2026-06-23 |
| Source | https://github.com/apache/cassandra-gocql-driver |
What cassandra-gocql-driver is
GoCQL implements the native Cassandra transport protocol (versions 3, 4, and 5) with automatic type marshaling, token-aware routing, connection pooling with configurable policies, and support for modern Cassandra features including vector types (5.0+) and per-query keyspace/timestamp overrides (4.0+). The driver is written in pure Go with no external database dependencies.
Get the cassandra-gocql-driver source
Clone the repository and explore it locally.
git clone https://github.com/apache/cassandra-gocql-driver.gitcd cassandra-gocql-driver# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Requires explicit keyspace configuration before session creation; no runtime keyspace switching via queries.
- Type conversions are strict with no loss of precision; custom types must implement Marshaler/Unmarshaler interfaces.
- Concurrent query execution is async underneath but exposed as synchronous API; tuning goroutine count and page size is critical for performance.
- Garbage collector pressure from network buffer allocations; GOGC tuning and iterator cleanup recommended for high-throughput workloads.
- Protocol version negotiation is automatic; ensure Go and Cassandra versions align with tested matrix (Go 1.25+, Cassandra 4.1.x or 5.0.x officially tested).
When to avoid it — and what to weigh
- Cassandra versions < 2.1 — Driver supports Cassandra 2.1+ only. Legacy clusters will require a different client or version downgrade.
- Dynamic keyspace switching via USE statements — As of v2.0, the driver no longer supports 'USE <keyspace>' queries. Keyspace must be set before session creation; breaking change from 1.x.
- Non-Go technology stacks — GoCQL is Go-only; projects in Python, Java, Node.js require their respective official drivers (cassandra-driver, datastax-java-driver, etc.).
- Simplified ORM-style workflows without external dependencies — Gocql provides low-level data binding; convenience layers (gocqlx, gocassa) are external community projects with separate maintenance and support models.
License & commercial use
Licensed under Apache License 2.0 (Apache-2.0), a permissive OSI license. See https://opensource.org/licenses/Apache-2.0 for full terms.
Apache-2.0 is permissive and generally suitable for commercial use, including proprietary software, with attribution required. No usage restrictions or commercial licensing fees. However, verify compliance with your legal team if bundling with other licensed code or in heavily regulated domains.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Strong |
| Assessment confidence | High |
TLS/SSL support is available for encrypted transport. Password authentication is supported. No explicit security audit or CVE history provided in the data; review GitHub security advisories and Apache Cassandra security bulletins independently. Type-strict unmarshaling reduces injection risk compared to loosely-typed clients. Depends on underlying Go standard library crypto and network stack.
Alternatives to consider
DataStax Java Driver (for Java/JVM)
Official, mature, heavier-weight; suited for JVM polyglot teams. GoCQL is lightweight and Go-native by comparison.
cassandra-driver (Python)
Official Python driver for data science and async workloads. GoCQL is superior for high-concurrency, production Go services.
ScyllaDB Go Driver (scylla-go-driver)
ScyllaDB-optimized fork with potential performance advantages for ScyllaDB clusters. GoCQL is broader Cassandra compatibility and Apache backing.
Build on cassandra-gocql-driver with DEV.co software developers
Get started with GoCQL for production Cassandra clusters. View the upgrade guide if migrating from v1.x, and explore community extensions for higher-level data binding.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
cassandra-gocql-driver FAQ
Is GoCQL production-ready?
What Go and Cassandra versions are officially tested?
Can I use GoCQL with an existing codebase using v1.x?
Does GoCQL support vector search?
Software development & web development with DEV.co
Need help beyond evaluating cassandra-gocql-driver? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source databases integrations — and maintain them long-term.
Ready to build Cassandra applications in Go?
Get started with GoCQL for production Cassandra clusters. View the upgrade guide if migrating from v1.x, and explore community extensions for higher-level data binding.