Skip to content

Namastack Outbox v0.2.0

Latest

Choose a tag to compare

@rolandbeisel rolandbeisel released this 27 Oct 18:44
· 19 commits to main since this release
acee3d7

πŸŽ‰ Major Architectural Improvements

Version 0.2.0 introduces a complete architectural overhaul that transforms how the Outbox pattern scales across multiple instances. We've replaced distributed locking with hash-based partitioning, delivering significant performance improvements and true horizontal scalability.

πŸš€ Key Features

Hash-based Partitioning

  • 🎯 Consistent Hashing: Each aggregate maps to the same partition using MurmurHash3
  • ⚑ Lock-Free Design: Eliminates distributed lock overhead and deadlock risks
  • πŸ“ˆ Linear Scaling: Performance scales directly with instance count
  • πŸ”„ Automatic Rebalancing: Partitions redistribute automatically when instances join/leave
  • πŸ›‘οΈ Ordering Guarantee: Maintains strict event ordering per aggregate
  • 256 Fixed Partitions: Provides fine-grained load distribution

Instance Coordination

  • πŸ’“ Heartbeat System: Automatic detection of healthy/failed instances
  • πŸ” Dynamic Discovery: New instances automatically join the cluster
  • βš–οΈ Load Balancing: Even distribution of partitions across all instances
  • πŸ›‘ Graceful Shutdown: Clean partition handover during instance shutdown

Multi-Database Support

  • πŸ—„οΈ Programmatic Transactions: Replaced @Transactional with TransactionTemplate
  • πŸ”§ Multi-Persistence Units: Support for multiple database configurations
  • βš™οΈ Configurable Transaction Managers: Custom transaction template support

πŸ”§ Technical Improvements

Performance Enhancements

  • ⚑ Eliminated Lock Contention: No more distributed lock overhead
  • πŸš€ Optimized Queries: New database indexes for partition-based queries
  • πŸ“Š Batch Processing: Efficient partition-aware record processing
  • 🎯 Reduced Latency: Direct partition assignment without lock acquisition

πŸ”„ Migration from v0.1.0

Simple Migration (Recommended)

-- Stop all instances, then drop and recreate tables
DROP TABLE IF EXISTS outbox_record;
DROP TABLE IF EXISTS outbox_lock;  -- If exists from v0.1.0

-- Tables will be recreated automatically with new schema

Custom Migration

For production environments requiring data preservation, contact the maintainer for migration assistance.

⚠️ Breaking Changes

Removed Features

  • Distributed Locking: Completely replaced with hash-based partitioning
  • Lock Tables: outbox_lock table no longer needed
  • Lock Configuration: All lock-related configuration options removed

Changed Behavior

  • Record Structure: OutboxRecord now includes partition information
  • Processing Logic: Events processed based on partition assignment
  • Scaling Model: Horizontal scaling through partitions instead of locks
  • Transaction Management: Switched from declarative to programmatic transactions

Updated Dependencies

  • Spring Boot: 3.0+ required
  • Java: 21+ required
  • Kotlin: 2.2+ required

πŸ“ˆ Performance Improvements

Real-world Impact

  • Multiple Instances: Seamless scaling from 1 to N instances
  • Load Distribution: Even workload distribution across instances
  • Failure Recovery: Sub-second partition reassignment on instance failure
  • Resource Usage: Reduced CPU and memory overhead

πŸ™ Acknowledgments

Special thanks to the community for feedback and testing that made this release possible. The architectural improvements in v0.2.0 lay the foundation for even better performance and scalability in future releases.

@AZapata27 @icepuma @wimdeblauwe

πŸ“š Resources


Download: GitHub Releases
Maven Central: io.namastack:namastack-outbox-starter-jpa:0.2.0