Skip to content

v0.1.1

Latest

Choose a tag to compare

@yudhasubki yudhasubki released this 10 Jan 07:07

Major Features

High-Performance Write Buffering

  • Implemented batch write mechanism with configurable batch_size, flush_interval, and buffer_size
  • Async channel-based buffering reduces database roundtrips
  • Achieves ~39k msg/sec on SQLite (M1 MacBook Pro)

PostgreSQL Support

  • Full PostgreSQL driver support with connection pooling
  • Configurable max_open_conns, max_idle_conns, conn_max_lifetime
  • SQL query compatibility with sqlx.Rebind() for placeholder conversion

Subscriber Caching

  • In-memory cache for subscriber lookups with configurable TTL
  • Reduces database queries during message publishing
  • Automatic cache invalidation on subscriber changes

Enhanced Listener Configuration

  • Configurable poll_interval for message polling
  • Configurable dequeue_batch_size for batch consumption
  • Exponential backoff on empty queue (up to max_backoff)

Performance Improvements

SQLite Optimizations

  • WAL mode with periodic checkpointing
  • Configurable cache_size and mmap_size
  • busy_timeout configuration for concurrent access

Database Driver Improvements

  • Proper PRAGMA wal_checkpoint handling (SQLite only)
  • Connection string fixes for PostgreSQL empty password/timezone
  • Batch INSERT with parameter limit handling (PostgreSQL 65535 limit)

New Examples

  • example/basic/ - Simple usage with numbered steps
  • example/sqlite/ - SQLite with CLI flags and graceful shutdown
  • example/pgsql/ - PostgreSQL with connection configuration
  • example/http/ - HTTP client example

Configuration Updates

New config.yaml options:

sqlite:
  cache_size: -4000     # 4MB page cache
  mmap_size: 0          # Memory-mapped I/O size

write_buffer:
  batch_size: 100       # Messages per batch
  flush_interval: 100ms # Max time before flush
  buffer_size: 10000    # Channel buffer size

pgsql:
  max_open_conns: 25
  max_idle_conns: 10
  conn_max_lifetime: 5m
  conn_max_idle_time: 1m

Test Coverage

  • Added TestPartialAck - verifies partial acknowledgment behavior
  • Added TestVisibilityTimeout - verifies message status changes
  • Added TestLongPolling - verifies subscriber blocking read
  • Comprehensive benchmark suite (benchmark_test.go)

Breaking Changes

  • Removed legacy partition fields from BlockQueueOption
  • WriteBufferConfig replaces old partition configuration

Documentation

  • Completely rewritten README with HTTP and Library usage modes
  • API reference table with all endpoints
  • Driver configuration examples for SQLite, PostgreSQL, and Turso

Full Changelog: v0.0.5-beta...v0.1.1