Skip to content

Introduction

What is go-sequent

A Go CQRS + Event Sourcing library for financial ledgers with SyncInTxn projections and hash-chain integrity.

What is go-sequent

go-sequent is a Go library for CQRS + Event Sourcing aimed at financial ledger workloads. You define commands, aggregates, events, and projections; the framework wires the write path.

What you get

  • One DB transaction + context-scoped UnitOfWork per Execute
  • Optimistic concurrency and unique keys on append
  • Ledger projections synchronously in the write txn (SyncInTxn)
  • Decimal Money, tenant-scoped idempotency, AuthZ hooks, JSON snapshots, tombstone GDPR hooks, optional outbox polling
  • Optional OpenTelemetry (obs) for write-path latency, outcomes, and OCC conflicts — not a business audit source

Use when

  • Balances must not lag the write path (read-your-writes)
  • You want shared-schema multi-tenancy
  • You need auditable command/event records

Not a web framework

No HTTP/gRPC server in-repo, no Rails/Sinatra generators, no ORM for general CRUD. Embed the library in your own process.

Relation to Sequent (Ruby)

Section names follow the spirit of the Sequent reference guide. APIs and schemas are Go-native. Never import a Ruby Sequent database.

See vs Sequent (Ruby) and Locked decisions.

Docs track the go-sequent library. When APIs drift, the source wins.