go-mink

Event Sourcing & CQRS for Go β€” Built for developers who demand simplicity without sacrificing power.

Get Started β†’ GitHub


πŸš€ Production Ready Β· πŸ”Œ Pluggable Β· πŸ›‘οΈ Type Safe Β· ⚑ High Performance


The Problem We Solve

Building event-sourced applications in Go means wrestling with boilerplate code, manual projections, and scattered patterns. Most teams end up reinventing the wheelβ€”or worse, avoiding event sourcing entirely.

go-mink changes that.

β€œMake Event Sourcing in Go as simple as using a traditional ORM, while maintaining the flexibility that Go developers expect.”


✨ Features

Β  Feature What You Get
🎯 Event Store Append-only storage with optimistic concurrency & snapshots
πŸ“– Smart Projections Inline, async, and live read models that just work
πŸ”Œ Pluggable Adapters PostgreSQL, MongoDB, Redis β€” or build your own
πŸ› οΈ Powerful CLI Generate code, run migrations, diagnose issues
πŸ“‹ Command Bus Full CQRS with middleware, validation & retry
πŸ”„ Saga Orchestration Coordinate long-running business processes
πŸ“€ Outbox Pattern Reliable event publishing with at-least-once delivery
πŸ” Built-in Security Field-level encryption & GDPR compliance tools
πŸ“Š Event Versioning Schema evolution with automatic upcasting
πŸ§ͺ Testing First BDD fixtures & time-travel debugging

πŸš€ Quick Start

package main

import (
    "context"
    
    "github.com/AshkanYarmoradi/go-mink"
    "github.com/AshkanYarmoradi/go-mink/adapters/postgres"
)

func main() {
    ctx := context.Background()
    
    // πŸ”Œ Connect to your database
    store, _ := mink.NewEventStore(
        postgres.NewAdapter("postgres://localhost/orders"),
    )
    
    // πŸ“¦ Create an aggregate
    order := NewOrder("order-123")
    order.Create("customer-456")
    order.AddItem("SKU-001", 2, 29.99)
    
    // πŸ’Ύ Save events automatically
    store.SaveAggregate(ctx, order)
    
    // πŸ“– Projections update in real-time
    store.RegisterProjection(&OrderSummaryProjection{})
}

That’s it. No ceremony. No configuration hell. Just clean, idiomatic Go.


πŸ“¦ Installation

# Install the library
go get github.com/AshkanYarmoradi/go-mink

# Install the CLI (optional but recommended)
go install github.com/AshkanYarmoradi/go-mink/cmd/mink@latest

πŸ“š Documentation

Getting Started

Guide Description
πŸ“˜ Introduction Why go-mink exists and what problems it solves
πŸ—οΈ Architecture Core concepts and system design
πŸ’Ύ Event Store How events are stored and retrieved
πŸ“– Read Models Building and maintaining projections

Advanced Topics

Guide Description
πŸ”Œ Adapters Database adapters and custom implementations
⚑ Commands & Sagas CQRS command bus and process managers
πŸ” Security Encryption, GDPR, and event versioning
πŸ§ͺ Testing BDD fixtures and debugging tools

Reference

Guide Description
πŸ› οΈ CLI Reference All command-line tools
πŸ“– API Reference Complete API documentation
πŸ—ΊοΈ Roadmap What’s coming next

🌟 Why Choose go-mink?

Aspect Traditional Approach With go-mink
Event Storage Custom implementation Built-in, optimized
Projections Manual, error-prone Automatic, reliable
Database Support Locked to one DB Swap adapters anytime
Testing Complex setup BDD fixtures included
Learning Curve Steep Gentle, familiar API

🀝 Community & Support

Β  Β 
πŸ’¬ GitHub Discussions β€” Ask questions, share ideas
πŸ› Issue Tracker β€” Report bugs, request features
🀝 Contributing Guide β€” Help us improve
⭐ Star on GitHub β€” Show your support

πŸ“„ License

go-mink is open source under the Apache 2.0 License.


go-mink
Event Sourcing for Go, Done Right. 🦫