go-mink
Event Sourcing & CQRS for Go β Built for developers who demand simplicity without sacrificing power.
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. π¦«