ScyllaDB University Live | Free Virtual Training Event
Learn more
ScyllaDB Documentation Logo Documentation
  • Deployments
    • Cloud
    • Server
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
    • Supported Driver Versions
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Install
Search Ask AI
ScyllaDB Docs ScyllaDB gocql driver Connecting to the cluster Compression
For AI agents: a documentation index is available at https://gocql-driver.docs.scylladb.com/master/llms.txt. A Markdown version of this page is at https://gocql-driver.docs.scylladb.com/master/connecting/compression.md.

CompressionΒΆ

Set ClusterConfig.Compressor before creating a session to enable Snappy or LZ4 compression:

cluster.Compressor = &gocql.SnappyCompressor{}

LZ4 is a separate module imported from the ScyllaDB fork:

import "github.com/scylladb/gocql/lz4"

cluster.Compressor = &lz4.LZ4Compressor{}

When native protocol v5 is explicitly enabled, use LZ4 or no compression. Snappy does not support v5 transport segments. Protocol v5 is not selected by automatic protocol discovery and must currently be configured explicitly.

The LZ4 module is versioned independently. Repository tags have an lz4/ prefix, while go.mod uses the unprefixed version:

require github.com/scylladb/gocql/lz4 v1.19.0

Do not replace github.com/gocql/gocql/lz4; upstream folded that package into its main module. Import github.com/scylladb/gocql/lz4 directly instead.

Was this page helpful?

PREVIOUS
Connecting to the cluster
NEXT
Authentication
  • Create an issue
  • Edit this page
ScyllaDB gocql driver
Search Ask AI
  • master
    • master
  • Quick start
  • Connecting to the cluster
    • Compression
    • Authentication
    • TLS
    • Client routes (PrivateLink / Private Service Connect)
  • Executing CQL statements
    • Paging
    • Batch statements
    • Lightweight transactions
    • Request timeouts
  • Data types
  • Load balancing
  • Retry policy configuration
  • Speculative execution
Docs Tutorials University Contact Us About Us
© 2026 ScyllaDB | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 14 Sep 2026.
Powered by Sphinx 9.1.0 & ScyllaDB Theme 1.9.3