← Course map

GO LEARNING PATH · 12 LESSONS

Around Go: MongoDB and Redis

Clients, queries, atomic writes, caching, streams and behavior under load.

  1. 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

  2. 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

  3. MongoDB: put the invariant in the write predicate

    Prevent lost updates with atomic operators and optimistic version checks.

    3 min · Worked lesson

  4. MongoDB transactions: retry database work, not external effects

    Choose transaction boundaries, concerns and idempotency for ambiguous failures.

    3 min · Worked lesson

  5. MongoDB cursors: bound the result and close the stream

    Avoid loading an unbounded collection into application memory.

    3 min · Worked lesson

  6. MongoDB under load: budget waiting before enlarging the pool

    Separate server selection, pool checkout, query time and application queueing.

    3 min · Worked lesson

  7. 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

  8. Redis cache-aside: TTLs do not solve concurrent fills

    Design expiry, invalidation, negative caching and stampede control deliberately.

    3 min · Worked lesson

  9. Redis pipelines save round trips; they are not transactions

    Bound command batches, inspect command errors and separate batching from atomicity.

    3 min · Worked lesson

  10. Redis counters and leases need atomic transitions and ownership

    Avoid split increment/expiry races and unsafe lock deletion.

    3 min · Worked lesson

  11. Redis Streams: acknowledge after the durable effect

    Understand consumer groups, pending entries, redelivery and bounded retention.

    3 min · Worked lesson

  12. 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