Learning Resources

Tutorials

Step-by-step guides and in-depth articles to level up your skills.

Page 8 of 9

How to Implement API Key Authentication

Issue and verify API keys safely: store only a hash, compare in constant time, scope and expire keys, and support rotation without downtime.

Security Boundaries

How to Implement Backoff with Jitter

Retry with exponential backoff and jitter: reach a good delay, spread the retries, and stop sensibly so retries do not become the outage.

Resilience

How to Implement Bounded Concurrency

Limit concurrency deliberately: run at most N tasks at once, queue the rest, preserve result order, and avoid overwhelming a downstream.

Resilience

How to Implement Bulkhead Isolation

Give each dependency its own connection pool, semaphore, and queue so one slow service cannot starve the rest of the ship.

Resilience

How to Implement CDN Cache Purging

Purge a CDN cache correctly: target by tag or URL, prefer versioned URLs over purges, and bound the effect of a purge on origin load.

Data Fetching

How to Implement Change Data Capture

Stream row changes from WAL logical decoding or binlog, order by transaction, consume idempotently, and handle schema evolution deliberately.

Data Integrity

How to Implement CI Dependency Caching

Cache dependencies in CI: key the cache on the lockfile, restore before install, and invalidate on a lockfile or a platform change.

Cli Tooling

How to Implement CLI Config Precedence

Resolve configuration with an explicit precedence: flag over env over file over default, and show the source so a value is traceable.

Cli Tooling

How to Implement Consistent Hashing

Distribute keys across nodes with consistent hashing: build a ring, add virtual nodes, and move only a fraction of keys when a node changes.

Resilience

How to Implement CQRS

Separate the write and read models: write to a normalized model, project to a read model, keep them eventually consistent, and query the read side.

Data Integrity

How to Implement Distributed Tracing

Trace a request across services: create spans, propagate the trace context, record useful attributes, and read the trace to find the slow hop.

Resilience

How to Implement Efficient Bulk Deletes

Delete large volumes of rows efficiently: batch the deletes, control vacuum and bloat, prefer partition or table drops, and avoid long locks.

Data Integrity

How to Implement Event Sourcing Tables

Model event sourcing in SQL: append immutable events, derive current state by replay, version aggregates, and snapshot to bound replay cost.

Data Integrity

How to Implement Golden File Tests

Use golden files to test large output: compare against a stored artifact, review the diff on a change, and update the golden deliberately.

Resilience

How to Implement HTTP Long Polling

Hold requests open until data arrives or a timeout fires, loop with AbortController and backoff, and respect connection budgets under HTTP/1.1.

Data Fetching

How to Implement Idempotent Data Loads

Make data loads safe to retry: upsert on a natural key, deduplicate within a batch, track load checkpoints, and test that a re-run changes nothing.

Data Integrity

How to Implement Memoization Safely

Memoize without breaking correctness: key by all inputs, bound the cache, invalidate when data changes, and avoid caching errors or mutable values.

Resilience

How to Implement Password Hashing with Argon2

Hash passwords with Argon2: pick memory and time parameters, store the full encoded hash, verify and upgrade hashes over time, and test the work factor.

Security Boundaries

How to Implement Prefetching Strategies

Prefetch before the user asks: predict the next request, warm the cache and connections, and avoid wasted work for predictions that miss.

Data Fetching

How to Implement Property-Based Testing

Test with properties: state an invariant, generate many inputs, shrink a failure to a minimal case, and keep the run reproducible with a seed.

Resilience

How to Implement Read-Write Locks

Use a read-write lock: let many readers in at once, exclude writers from readers, and avoid writer starvation with a fair policy.

Resilience

How to Implement Server-Timing Headers

Record and expose Server-Timing metrics, break down where request time goes, and use the header to debug latency without a denylisting conversation.

Resilience

How to Implement Service Discovery

Let services find each other: use DNS or a registry, resolve at call time, cache with a TTL, and handle the instance that has gone away.

Resilience

How to Implement Snapshot Testing Safely

Use snapshots without rubber-stamping: snapshot stable output, review every change, keep snapshots small, and add assertions the snapshot cannot make.

Resilience

How to Implement Static Asset Caching

Cache static assets effectively: fingerprint URLs, set immutable long max-age, differentiate HTML from assets, and test the caching policy.

Data Fetching

How to Implement Structured Concurrency

Use structured concurrency: tie child tasks to their scope, propagate cancellation and errors, and never leave a task running past its parent.

Resilience

How to Implement Structured Logging

Log structured events: emit JSON with stable fields, bind context, choose levels deliberately, and query logs as data rather than text.

Resilience

How to Implement the Outbox Pattern

Publish events reliably with the outbox: write the event and the change in one transaction, relay the outbox, and dedupe on the consumer.

Data Integrity

How to Implement the Saga Pattern

Coordinate a distributed transaction with a saga: run local steps, compensate on failure, and make each step and compensation idempotent.

Resilience

How to Inject Secrets at Runtime

Deliver secrets to an app at runtime instead of baking them in: load from a secret store, keep them out of images and env files, and rotate without rebuilds.

Security Boundaries

How to Negotiate Content with Accept Headers

Implement proactive content negotiation: parse Accept headers, honor quality values, choose a representation, and answer 406 only when truly nothing matches.

Data Fetching

How to Negotiate WebSocket Subprotocols

Use the Sec-WebSocket-Protocol header to select a versioned subprotocol, reject unsupported clients, and evolve the message format safely.

Resilience

How to Optimize Images for Delivery

Serve images fast: pick modern formats with fallbacks, size and density per client, lazy-load below the fold, and cache fingerprinted variants.

Data Fetching

How to Optimize JSON Serialization

Speed up JSON work: stream instead of buffering, avoid redundant stringify and parse, and pick a serializer that fits the payload.

Resilience

How to Optimize JSONB Aggregation Queries

Aggregate over JSONB efficiently: extract and cast in the right place, build expression indexes, and avoid per-row expansion that kills plans.

Data Integrity

How to Optimize JSONB Query Performance

Prefer containment operators, add expression and GIN indexes for hot paths, promote frequent fields to columns, and verify with EXPLAIN ANALYZE.

Data Integrity

How to Preserve Message Ordering

Preserve the order where it matters: partition by key so one entity stays ordered, and accept the cross-key parallelism as the design.

Resilience

How to Prevent Account Enumeration

Stop attackers from learning which accounts exist: uniform responses, constant-time paths, and identical timing for login, signup, and reset.

Security Boundaries

How to Prevent Path Traversal Attacks

Stop path traversal: reject .. and absolute paths, resolve against a fixed base, verify the result stays inside it, and test with encoded payloads.

Security Boundaries

How to Prevent Session Fixation Attacks

Stop session fixation by rotating the session identifier on login and privilege change, binding it to the browser, and invalidating the old one.

Security Boundaries