Sockudo v3.0.0 - Major Release ๐
โ ๏ธ CRITICAL BREAKING CHANGES
Configuration Structure Changes
1. cluster_health Configuration Location Changed (BREAKING)
The cluster_health configuration has been moved from adapter.cluster_health to the top-level of the configuration.
Old location (v2.x):
{
"adapter": {
"cluster_health": {
"enabled": true,
"heartbeat_interval_ms": 10000,
"node_timeout_ms": 30000,
"cleanup_interval_ms": 10000
}
}
}New location (v3.0.0):
{
"cluster_health": {
"enabled": true,
"heartbeat_interval_ms": 10000,
"node_timeout_ms": 30000,
"cleanup_interval_ms": 10000
}
}Action Required: If you're using Redis, Redis Cluster, or NATS adapters with cluster health monitoring, you MUST move the cluster_health configuration to the top level. Failure to do so will cause the application to fail during startup.
2. New Optional Configuration Sections
The following new configuration sections have been added. These are optional and have sensible defaults:
websocket- WebSocket buffer management (optional, has defaults)delta_compression- Delta compression settings (optional, disabled by default)tag_filtering- Server-side tag filtering (optional, disabled by default)unix_socket- Unix socket server (optional, disabled by default)
You do NOT need to add these sections if you're not using these features - they will use default values automatically.
3. Redis Configuration Cleanup
Empty redis_pub_options and redis_sub_options objects are no longer needed and should be removed from your configuration. Use the database.redis section for connection configuration instead.
Old (v2.x):
{
"adapter": {
"redis": {
"redis_pub_options": {},
"redis_sub_options": {}
}
}
}New (v3.0.0):
{
"adapter": {
"redis": {
"requests_timeout": 5000,
"prefix": "sockudo_adapter:",
"cluster_mode": false
}
},
"database": {
"redis": {
"host": "your-redis-host",
"port": 6379,
"db": 0,
"key_prefix": "sockudo:"
}
}
}Migration Guide
- Move
cluster_healthconfiguration fromadapter.cluster_healthto top-levelcluster_health - Remove empty
redis_pub_optionsandredis_sub_optionsif present - Ensure
database.redissection is properly configured for Redis connections - Optional: Configure new features like
delta_compressionortag_filteringif desired
Minimal Configuration Changes for Upgrade
If you're upgrading from v2.x, the minimum required change is:
{
- "adapter": {
- "cluster_health": {
- "enabled": true,
- "heartbeat_interval_ms": 10000,
- "node_timeout_ms": 30000,
- "cleanup_interval_ms": 10000
- }
- }
+ "cluster_health": {
+ "enabled": true,
+ "heartbeat_interval_ms": 10000,
+ "node_timeout_ms": 30000,
+ "cleanup_interval_ms": 10000
+ }
}All other new sections (websocket, delta_compression, tag_filtering, unix_socket) are optional and will use default values if omitted.
Sockudo v3.0.0 - Major Release ๐
๐ Major Features
๐ฅ Delta Compression with Conflation Keys
A groundbreaking bandwidth optimization feature that reduces network usage by 60-90% for high-frequency updates.
Key Features:
- Delta Compression: Send only message differences instead of full payloads
- Conflation Keys: Group messages by entity (stock symbol, device ID, etc.) for maximum efficiency
- Multiple Algorithms: Support for
fossil(fast) andxdelta3(high compression ratio) - Horizontal Scaling: Full support across Redis, Redis Cluster, and NATS adapters
- Per-Channel Configuration: Granular control over compression settings
- Automatic Encrypted Channel Detection: Automatically disables for
private-encrypted-*channels - Client-Side Control: Opt-in/opt-out per subscription with algorithm negotiation
Performance:
- 60-90% bandwidth savings for similar consecutive messages
- ~5-20ฮผs CPU overhead per message
- ~10-50KB memory per socket
- Full message intervals for late subscribers
Documentation: See DELTA_COMPRESSION.md and extensive docs in docs/DELTA_COMPRESSION_*.md
๐ท๏ธ Publication Filtering by Tags (Server-Side Filtering)
Intelligent server-side filtering that reduces bandwidth by only sending relevant messages to subscribers.
Key Features:
- Zero-Allocation Filtering: 12-94ns per filter evaluation in broadcast path
- Rich Filter Operators:
eq,neq,gt,gte,lt,lte,and,or,not,in - Pusher-Compatible: Disabled by default for backward compatibility
- Per-Channel Configuration: Clients can subscribe with custom filters
- Bandwidth Optimization: Option to strip tags from messages globally or per-channel
Performance:
- 10k subscriber broadcast: 112-924ฮผs with zero allocations
- 60-90% bandwidth savings for filtered channels
Documentation: See docs/TAG_FILTERING.md and docs/TAG_FILTERING_QUICKSTART.md
๐ก๏ธ Redis Sentinel Support
High availability support for Redis deployments with automatic master discovery and failover.
Key Features:
- Automatic master node discovery via Sentinel protocol
- Seamless failover handling
- Optional Sentinel authentication
- Configuration via config file or environment variables
Configuration Example:
{
"database": {
"redis": {
"sentinels": [
{ "host": "sentinel1.example.com", "port": 26379 },
{ "host": "sentinel2.example.com", "port": 26379 }
],
"name": "mymaster",
"sentinel_password": "optional",
"password": "optional-master-password"
}
}
}๐ง Unified Redis Cluster Configuration
Simplified and consistent Redis Cluster configuration across all components (adapter, cache, queue, rate limiter).
Key Improvements:
- Single
use_connection_managerflag for connection pooling - Consistent configuration structure across all Redis Cluster components
- Better error handling and connection management
- Improved performance with connection pooling
๐ฆ Cache Fallback Resilience
Automatic fallback to memory cache when Redis becomes unavailable, with intelligent recovery.
Key Features:
- Automatic detection of Redis failures
- Seamless fallback to in-memory cache
- Background health checks and automatic recovery
- Optional startup health check to avoid first-operation latency
- Configurable recovery intervals and retry policies
- Thread-safe recovery without blocking operations
Benefits:
- Zero downtime during Redis outages
- Graceful degradation under load
- Automatic recovery when Redis comes back online
๐ง Enhancements
Performance Improvements
- SocketId Refactor: Removed
Arc<RwLock<>>wrapper aroundSocketIdfor better performance - ConnectionManager Optimization: Changed from
&mut selfto&selffor concurrent access - sockudo_ws Migration: Replaced
fastwebsocketswith customsockudo_wscrate for better control and performance - sonic-rs Integration: Replaced
serde_jsonwithsonic-rsfor significantly faster JSON parsing and serialization - Zero-Allocation Broadcast: Optimized broadcast path with minimal allocations
- WebSocket Buffer Management: Bounded buffers to prevent memory exhaustion from slow consumers
WebSocket Library Replacement: fastwebsockets โ sockudo_ws
We've migrated from fastwebsockets to our custom sockudo_ws crate, providing:
- Better Performance: Optimized for Sockudo's specific use cases
- Enhanced Control: Full control over WebSocket frame handling
- Improved Debugging: Better error messages and diagnostics
- Custom Features: Tailored features for real-time messaging needs
- Reduced Dependencies: Smaller dependency tree
JSON Library Replacement: serde_json โ sonic-rs
Replaced serde_json with sonic-rs for substantial performance gains:
- Faster Parsing: Up to 2-3x faster JSON deserialization
- Faster Serialization: Up to 2-5x faster JSON serialization
- SIMD Optimizations: Leverages modern CPU instructions
- Lower Memory Usage: More efficient memory allocation patterns
- Drop-in Replacement: Minimal code changes required
Performance Impact:
- Message parsing: 40-60% faster
- Broadcast serialization: 50-70% faster
- Overall throughput: 20-30% improvement in high-traffic scenarios
WebSocket Buffer Management
Three Limit Modes:
- Message count only (default, fastest) - No size tracking overhead
- Byte size only - Precise memory control
- Both limits - Whichever triggers first
Configuration:
WEBSOCKET_MAX_MESSAGES=1000
WEBSOCKET_MAX_BYTES=1048576 # 1MB
WEBSOCKET_DISCONNECT_ON_BUFFER_FULL=trueDynamoDB App Manager Caching
- Added Redis caching support for DynamoDB App Manager
- Reduces DynamoDB read costs and latency
- Configurable cache TTL and invalidation
Environment Variable Standardization
- Unified environment variables to use
_USERNAMEsuffix (e.g.,DATABASE_REDIS_USERNAME) - More consistent configuration loading across components
๐ Bug Fixes
Critical Fixes
- WebSocket Close Codes: Fixed incorrect close codes to match Pusher protocol specification
- Musl Binary Builds: Fixed Alpine container compatibility for musl binaries
- Rate Limiting: Added independent rate limit flags and reliable distributed channel counting
- SQS Queue Driver: Restored support for AWS SQS queue backend
- IPv6 Sentinel Parsing: Fixed parsing issues with IPv6 addresses in Sentinel configuration
Test Improvements
- Fixed flaky tests in WebSocket connection handling
- Added comprehensive test suite for cache fallback resilience
- Added delta compression integration tests
- Added tag filtering benchmark suite
- Moved tests from
test/to standardtests/directory
Clippy and Formatting
- Resolved all clippy warnings across all feature flags
- Applied consistent formatting across the codebase
- Fixed unused import warnings when features are disabled
๐ Security Updates
Dependency Updates
- bytes: 1.10.1 โ 1.11.1 (security advisory fixes)
- time: 0.3.43 โ 0.3.47 (security advisory fixes)
- redis: Updated to 1.0.0-rc.3 with improved security
Security Advisories Addressed
- CVE-2025-24916 (bytes crate)
- RUSTSEC-2020-0071 (time crate)
๐ Documentation
New Documentation
DELTA_COMPRESSION.md- Comprehensive delta compression guidedocs/DELTA_COMPRESSION_BANDWIDTH_OPTIMIZATION.md- Bandwidth optimization strategiesdocs/DELTA_COMPRESSION_CLUSTER_COORDINATION.md- Cluster coordination detailsdocs/DELTA_COMPRESSION_HORIZONTAL_IMPLEMENTATION.md- Horizontal scaling implementationdocs/DELTA_COMPRESSION_LATE_SUBSCRIBERS.md- Late subscriber handlingdocs/TAG_FILTERING.md- Complete tag filtering documentationdocs/TAG_FILTERING_QUICKSTART.md- Quick start guide for tag filteringdocs/CACHE_BACKENDS.md- Cache backend configuration guide
Updated Documentation
CLAUDE.md- Updated with all new features and configurationsREADME.md- Enhanced with v3.0.0 features and examples.env.example- Added all new environment variables
๐งช Testing & Examples
New Examples
examples/client_delta_compression.js- Client-side delta compression exampleexamples/tag_filtering.rs- Server-side tag filtering exampleexamples/test_conflation.rs- Conflation keys demonstrationexamples/xdelta_format_test.rs- xdelta3 format testing
Enhanced Test Suite
tests/interactive/- Comprehensive interactive test suite with delta compression teststests/automated/delta-compression.test.js- Automated delta compression teststests/interactive/test-delta-decode.e2e.test.js- End-to-end delta decoding teststests/interactive/DELTA_COMPRESSION_TESTING.md- Delta compression testing guidebenches/delta_compression_bench.rs- Delta compression benchmarksbenches/filter_bench.rs- Tag filtering benchmarks
Benchmarking
benches/sender/- Standalone Rust benchmark sender using pushers cratebenches/ci-horizontal.js- Horizontal scaling benchmarkbenches/ci-local.js- Local benchmark suite
๐ Breaking Changes
Configuration Changes
- Test Directory: Moved from
test/totests/(standard Rust convention) - Redis Cluster Config: Unified configuration structure requires migration for existing Redis Cluster setups
- Environment Variables: Standardized to
_USERNAMEsuffix (old_USERstill supported with deprecation warning)
API Changes
- ConnectionManager Trait: Changed from
&mut selfto&self(affects custom implementations) - SocketId Type: Removed
Arc<RwLock<>>wrapper (internal change, should not affect most users)
Dependency Changes
- WebSocket Library: Migrated from
fastwebsocketstosockudo_ws(internal change, no API changes) - JSON Library: Replaced
serde_jsonwithsonic-rs(internal change, fully compatible)
Migration Guide
- Update Redis Cluster configuration to use new unified structure
- Update environment variables to use
_USERNAMEsuffix - Rebuild tests if using custom test directory structure
- Review custom ConnectionManager implementations if any
- No changes needed for WebSocket or JSON changes (internal only)
๐ฆ Dependencies
Major Dependency Changes
- Removed:
fastwebsockets- replaced with customsockudo_ws - Removed:
serde_json- replaced withsonic-rs
Updated Dependencies
redisโ 1.0.0-rc.3bytesโ 1.11.1timeโ 0.3.47sonic-rsโ Added for faster JSON parsing (replaces serde_json)xdelta3โ Added for delta compression
New Dependencies
sockudo_ws- Custom WebSocket implementation (replaces fastwebsockets)fossil-delta- Fast binary delta compressionxdelta3- VCDIFF (RFC 3284) delta compression
๐ Performance Metrics
Benchmark Results
- Delta Compression: 60-90% bandwidth reduction for typical workloads
- Tag Filtering: Zero-allocation filtering with 12-94ns per filter
- Broadcast Performance: 10k subscribers in 112-924ฮผs
- JSON Performance: 2-5x faster serialization, 2-3x faster parsing with sonic-rs
- WebSocket Performance: 10-20% improvement with sockudo_ws
- Memory Usage: ~10-50KB per socket with delta compression
- CPU Overhead: ~5-20ฮผs per message for delta compression
๐ ๏ธ Configuration
New Configuration Options
delta_compression.*- Delta compression settingstag_filtering.*- Tag filtering settingswebsocket.max_messages- WebSocket message buffer limitwebsocket.max_bytes- WebSocket byte buffer limitwebsocket.disconnect_on_buffer_full- Slow consumer behaviordatabase.redis.sentinels- Redis Sentinel configurationcache.initial_health_check- Startup cache health check
New Environment Variables
TAG_FILTERING_ENABLED- Enable tag filtering globallyWEBSOCKET_MAX_MESSAGES- WebSocket message buffer limitWEBSOCKET_MAX_BYTES- WebSocket byte buffer limitWEBSOCKET_DISCONNECT_ON_BUFFER_FULL- Disconnect slow clientsDATABASE_REDIS_USERNAME- Redis username (ACL support)- Plus many more delta compression related variables
๐ Statistics
- 82 commits since v2.9.2
- 211 files changed
- 49,561 insertions
- 5,713 deletions
- 7 major features added
- Multiple security advisories addressed
- 2 major dependency replacements (fastwebsockets โ sockudo_ws, serde_json โ sonic-rs)
๐ Contributors
Special thanks to all contributors who made this release possible:
- @lilfaf - DynamoDB caching and Redis improvements
- @hzmifork - Environment variable standardization
- And the entire Sockudo community for testing and feedback!
๐ Upgrade Notes
Recommended Steps
- Backup your configuration before upgrading
- Review breaking changes section above
- Update configuration files with new options
- Test delta compression in staging environment first
- Monitor performance after deployment
- Update client libraries to support new features
Feature Adoption
- Delta Compression: Opt-in feature, disabled by default
- Tag Filtering: Disabled by default for Pusher compatibility
- Redis Sentinel: No changes required for existing Redis setups
- Cache Fallback: Automatic, no configuration needed
- sockudo_ws: Automatic, no changes needed
- sonic-rs: Automatic, no changes needed
๐ Resources
- Documentation: See
DELTA_COMPRESSION.md,docs/TAG_FILTERING.md - Examples: Check
examples/directory - Tests: Explore
tests/interactive/for interactive testing - Benchmarks: Run
benches/for performance testing
๐ฏ What's Next?
Looking ahead to v3.1.0:
- Further performance optimizations
- Enhanced monitoring and observability
- Additional compression algorithms
- More filter operators and expressions
- Continued performance improvements with sockudo_ws and sonic-rs
Full Changelog: v2.9.2...v3.0.0
Installation
Using cargo-binstall (Recommended)
cargo binstall sockudo --version 3.0.0Using cargo
cargo install sockudo --version 3.0.0Using Docker
docker pull ghcr.io/sockudo/sockudo:3.0.0
docker pull sockudo/sockudo:3.0.0Direct Download
Download the appropriate binary for your platform from the assets below.
Platform Support
- โ Linux x86_64 (GNU)
- โ Linux x86_64 (musl)
- โ Linux ARM64 (GNU)
- โ Linux ARM64 (musl)
- โ macOS x86_64 (Intel)
- โ macOS ARM64 (Apple Silicon)
- โ Windows x86_64
- โ Docker linux/amd64
- โ Docker linux/arm64
What's Changed
- Delta compression, tag filtering, sockudo_ws integration, and benchmark sender by @countradooku in #171
Full Changelog: https://github.com/sockudo/sockudo/commits/v3.0.0