GO LEARNING PATH · 12 LESSONS
Around Go: MongoDB and Redis
Clients, queries, atomic writes, caching, streams and behavior under load.
MongoDB: one client, explicit deadlines and typed documents
Connect with the Go v2 driver and separate construction, readiness, request work and cleanup.
3 min · Worked lesson
MongoDB: design the query and its compound index together
Use explain evidence, tenant predicates and stable pagination rather than adding indexes blindly.
3 min · Worked lesson
MongoDB: put the invariant in the write predicate
Prevent lost updates with atomic operators and optimistic version checks.
3 min · Worked lesson
MongoDB transactions: retry database work, not external effects
Choose transaction boundaries, concerns and idempotency for ambiguous failures.
3 min · Worked lesson
MongoDB cursors: bound the result and close the stream
Avoid loading an unbounded collection into application memory.
3 min · Worked lesson
MongoDB under load: budget waiting before enlarging the pool
Separate server selection, pool checkout, query time and application queueing.
3 min · Worked lesson
Redis: share the client and distinguish a miss from an outage
Configure go-redis deadlines, connection budgets and explicit cache-miss behavior.
3 min · Worked lesson
Redis cache-aside: TTLs do not solve concurrent fills
Design expiry, invalidation, negative caching and stampede control deliberately.
3 min · Worked lesson
Redis pipelines save round trips; they are not transactions
Bound command batches, inspect command errors and separate batching from atomicity.
3 min · Worked lesson
Redis counters and leases need atomic transitions and ownership
Avoid split increment/expiry races and unsafe lock deletion.
3 min · Worked lesson
Redis Streams: acknowledge after the durable effect
Understand consumer groups, pending entries, redelivery and bounded retention.
3 min · Worked lesson
Redis under load: hot keys, memory pressure and ambiguous retries
Inspect server latency and memory while bounding client work and retry amplification.
3 min · Worked lesson