GoWindGoWind
Home
Framework
GoWind Toolkit
  • Open Source

    • GoWind Admin (Admin Platform)
    • GoWind CMS (Content Management)
    • GoWind UBA (Behavior Analytics)
    • GoWind Shop (E-commerce)
    • GoWind Kanban (Kanban Boards)
    • GoWind Ledger (Personal Finance)
    • GoWind ShortPlay (Short Drama)
    • GoWind Ops (Operations Platform)
    • RushWind (Rust Ecosystem)
  • Open Core (Community + Enterprise)

    • GoWind OA (Office Collaboration)
    • GoWind ERP (Procure-to-Pay)
    • GoWind WMS (Warehousing)
  • Commercial

    • GoWind IM (Instant Messaging)
    • GoWind IoT (IoT Platform)
    • GoWind Edu (AI Education)
    • GoWind MES (Manufacturing Execution)
    • GoWind CDC (Data Pipeline)
    • GoWind SDP (Zero-Trust Gateway)
    • GoWind Quant (Quant Research)
    • GoWind Trade Radar (Export Sourcing)
    • GoWind Game Radar (Game Greenlight)
  • 简体中文
  • English
GitHub
Home
Framework
GoWind Toolkit
  • Open Source

    • GoWind Admin (Admin Platform)
    • GoWind CMS (Content Management)
    • GoWind UBA (Behavior Analytics)
    • GoWind Shop (E-commerce)
    • GoWind Kanban (Kanban Boards)
    • GoWind Ledger (Personal Finance)
    • GoWind ShortPlay (Short Drama)
    • GoWind Ops (Operations Platform)
    • RushWind (Rust Ecosystem)
  • Open Core (Community + Enterprise)

    • GoWind OA (Office Collaboration)
    • GoWind ERP (Procure-to-Pay)
    • GoWind WMS (Warehousing)
  • Commercial

    • GoWind IM (Instant Messaging)
    • GoWind IoT (IoT Platform)
    • GoWind Edu (AI Education)
    • GoWind MES (Manufacturing Execution)
    • GoWind CDC (Data Pipeline)
    • GoWind SDP (Zero-Trust Gateway)
    • GoWind Quant (Quant Research)
    • GoWind Trade Radar (Export Sourcing)
    • GoWind Game Radar (Game Greenlight)
  • 简体中文
  • English
GitHub
  • Introduction

    • GoWind Framework
    • Framework Architecture
  • go-wind Core

    • go-wind Core Framework
    • App Lifecycle Management
    • Context Propagation
    • Transport Abstraction
    • Log Facade Interface
  • go-wind-plugins

    • go-wind-plugins Plugin Overview
    • Plugin Configuration System
    • Plugin Registration Mechanism (SPI)
    • Logging Adapter Plugins
    • Transport Protocol Plugins
    • Message Middleware Plugins
    • Encoding Plugins
    • Security and Authentication Plugins
    • Distributed Tracing Plugins
    • Cache Plugins
    • Object Storage Plugins (OSS)
    • Rate Limiting Plugins
    • Metrics Plugins
    • AI Plugins
    • Workflow Plugins
    • Database and Cache Plugins
    • Bootstrap Integration and Gateway Plugins
    • Compression and Serialization Plugins
    • Template Rendering and Validation Plugins
  • go-wind-bootstrap

    • go-wind-bootstrap: The Declarative Bootstrap
    • The Bootstrap Configuration System
    • The Bootstrap SPI Mechanism
    • Declarative Middleware Orchestration
    • Bootstrap Command-Line Integration
    • Bootstrap Practical Examples
  • go-wind-flow Workflow Engine

    • GoWind Flow Process Engine
  • Tutorials

    • Quick Start Tutorial
    • Custom Plugin Development Tutorial
    • Multi-Protocol Listening Tutorial
    • Framework Migration Guide

Compression and Serialization Plugins

Family Status Note (defer to the repository)

The go-wind-plugins repository no longer contains a compress/ plugin family — there are no plugin directories for gzip / snappy / lz4 / zstd / brotli. Compression is not provided as standalone plugins, and their whereabouts are not officially documented:

  • Message compression: supported by each message middleware engine in its connection/producer configuration (e.g. the Kafka producer's compression: none | gzip | snappy | lz4 | zstd; NSQ's snappy and RocketMQ's brotli exist as part of the engine dependencies);
  • HTTP response compression: there is no built-in compression middleware plugin; handle it at the business/gateway layer following standard Accept-Encoding semantics;
  • Serialization: handled by the 12 codec plugins of the encoding/ family (see the comparison table in Section 2 and Encoding Plugins).

The plugin list in Section 1 "Compression Plugins" below is retained from historical documentation; defer to the actual repository state.

go-wind-plugins provides compression and serialization helper plugins to reduce network transfer size and storage footprint.

1. Compression Plugins

1.1 Adapter List

AdapterImport PathCompression RatioSpeed
Gzipplugins/compress/gzipHighMedium
Snappyplugins/compress/snappyMediumVery fast
LZ4plugins/compress/lz4MediumVery fast
Zstdplugins/compress/zstdHighFast
Brotliplugins/compress/brotliHighestSlow

1.2 Usage

import compressPlugin "github.com/tx7do/go-wind-plugins/compress/gzip"

compressor := compressPlugin.New(
    compressPlugin.WithLevel(6),        // 1-9
)

// Compress
compressed, _ := compressor.Compress(data)

// Decompress
original, _ := compressor.Decompress(compressed)

1.3 HTTP Response Compression

// The transport supports Accept-Encoding: gzip automatically
// The client sends Accept-Encoding: gzip
// The server compresses the response body automatically

1.4 Kafka Message Compression

broker:
  kafka:
    producer:
      compression: zstd         # none | gzip | snappy | lz4 | zstd

2. Serialization Comparison

FormatSizeSpeedHuman-ReadableSchema
JSONLargeFastYesNone
ProtobufSmallestFastestNo.proto
MessagePackSmallFastNoNone
YAMLMediumSlowYesNone
TOMLMediumSlowYesNone
AvroSmallFastNo.avsc

3. Schema Evolution

Protobuf (Recommended)

// user.proto
syntax = "proto3";

message User {
    string id = 1;
    string name = 2;
    string email = 3;
    // new fields use new numbers, preserving compatibility
    string phone = 4;
}

Compatibility Rules

OperationCompatibility
Add a fieldForward compatible
Remove a fieldBackward compatible (field number must be reserved)
Change a field typeIncompatible
Change a field numberIncompatible

Related Documents

  • Encoding Plugins
  • Message Middleware Plugins
  • Plugin Overview
Edit this page
Last Updated:: 11/3/26, 2:14 PM
Contributors: Bobo
Prev
Bootstrap Integration and Gateway Plugins
Next
Template Rendering and Validation Plugins