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.

Caution

You're viewing documentation for a previous version of ScyllaDB gocql driver. Switch to the latest stable version.

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 tagged alongside the parent module. The parent module can still require an older published LZ4 version until its post-release pin update. Repository tags have an lz4/ prefix, while go.mod uses the unprefixed version. For the version currently pinned by the parent module:

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
    • v1.20.0
    • v1.19.0
    • v1.18.3
    • v1.18.2
    • v1.18.1
  • 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 08 Oct 2026.
Powered by Sphinx 9.1.0 & ScyllaDB Theme 1.9.3