A standalone course · Catch up on this repo + interview prep

NATS JetStream, from newcomer to interview-ready

The eventing bus your own services live on — how a domain event fans out from one service to another, durably, with tenancy and tracing intact.

Your services — conversationmgmt and notification — wake up to NATS events all day: a user is created, a staff record changes, a notification is requested. This course is the bus underneath them: core NATS pub/sub, the JetStream persistence model (streams, durable consumers, acknowledgements), the golibs/nats wrapper, and the subscribers you actually own. It's the eventing half of the platform (Kafka is the other half — and we'll compare them), and it's grounded in your real code.

How to use this Do one lesson, take its quiz from memory (no peeking), then skim the matching row of the cheat sheet. Come back a day later and re-take it — spacing beats cramming. You know the rhythm by now. Stuck? Ask me — I'm your teacher, not just the author.
The one thing that'll surprise you NATS is asynchronous — a subscriber handles an event long after the request that caused it. Yet tenant isolation (RLS) and distributed tracing still work, because this repo smuggles resource_path and the trace context through the message envelope and re-injects them on the consumer. That trick (Lesson 7) is the cleverest bit of the whole layer.

Part 1 — Core NATS & the JetStream model available now

What NATS is, and the persistence model JetStream layers on top.

1 · The NATS map

Core NATS vs JetStream, NATS vs Kafka, and where the pieces sit in this repo.

ready

2 · Subjects & pub/sub

The dotted subject hierarchy, wildcards, and queue-group load balancing.

ready

3 · JetStream & streams

Persistence, retention policies, storage & replicas — provisioned by fink.

ready

4 · Consumers

Push vs pull, durable vs ephemeral, ack policy — and QueueSubscribe.

ready

Part 2 — Publishing, consuming & delivery available now

The golib wrapper — how a message is published, consumed, and made reliable.

5 · The golib & the connection

The JetStreamManagement interface, lazy connect, reconnect.

ready

6 · Publishing

The DataInMessage envelope, dedup by Nats-Msg-Id, traced publish.

ready

7 · Subscribing & the handler

handleMsg — where tenancy & tracing survive the async hop.

ready

8 · Delivery semantics

At-least-once, ack/nak/term, redelivery, dedup — and the gaps.

ready

Part 3 — The repo in practice available now

Your own subscribers, the publish link between your services, and the whole picture.

9 · conversationmgmt subscribers

User.Created, Staff.Upserted, UserGroup.Upserted.

ready

10 · notification & the publish link

Notification.Created, and the transport-agnostic handler.

ready

11 · The activity-log firehose

Interceptors publish; zeus is the one pull consumer.

ready

12 · NATS vs Kafka + ops

When each, the migration, ops & testing — and the recap.

ready

Reference shelf

Cheat sheet

The flow, streams/consumers config, handleMsg + interview one-liners.

Glossary

The canonical vocabulary, mapped to interview terms.

Repo NATS map

Ground truth: the golib, streams, subscribers, activity log, ops — with file:line.

Resources

docs.nats.io, nats.go, Synadia — high-trust sources only.

All 12 lessons are built — the course is complete. You can now open any subscriber you own and read it fully, and name what the repo really does (tenancy through the envelope so RLS survives the hop, Ack-only redelivery with no DLQ, the transport-agnostic handlers, the live NATS→Kafka migration). The one thing left is a retention check — ask me to run a mock interview across the course (cold, no peeking) and I'll write the first learning records proving what stuck. Questions on any lesson? Ask me — that's what I'm here for.