// the find
shijuvar/go-distributed-sys
Guidance for building event-driven distributed systems and microservices in Go with NATS JetStream, gRPC and CockroachDB
A reference implementation showing how to wire together NATS JetStream, gRPC, and CockroachDB for event-sourced microservices in Go. It demonstrates CQRS with a concrete order-payment-review saga flow. Aimed at Go developers who want working code to study, not a library to import.
The eventstream example covers the full CQRS loop end-to-end: command via gRPC event store, JetStream publish, independent query sync worker — each concern in its own binary. Go kit integration in gokit-ordersvc shows real middleware layering (logging, transport separation) rather than the usual toy HTTP handler. The bootstrapper pattern — a separate one-shot binary to provision JetStream streams and DB schemas — is the right call for operational clarity. NATS Micro examples are a nice addition showing the newer service-oriented NATS pattern alongside the raw JetStream approach.
Last commit was December 2023 and the saga coordinator is explicitly marked 'to be implemented' — the hardest part of distributed transactions is missing. The CockroachDB setup uses --insecure everywhere, which will mislead anyone who copies this toward production. There are no tests at all: no unit tests for domain logic, no integration tests for the event flow. The Go kit dependency pulls in a large framework for what is essentially a demo service, making it harder to separate 'how Go kit works' from 'how this pattern works'.