Learning Resources

Tutorials

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

Page 7 of 9

How to Use Dynamic Secrets from Vault

Issue short-lived, per-instance database credentials from HashiCorp Vault so there are no long-lived passwords to rotate or leak.

Security Boundaries

How to Use TypeScript Project References

Split a large TypeScript codebase into projects that build incrementally and enforce dependency direction, so a type-check is not a full rebuild.

Cli Tooling

Propagating Trace Context Across Services

Carry a trace identifier through HTTP, queues and background jobs so a single request can be followed end to end without gaps that hide the real bottleneck.

Data Fetching

Reranking Search Results with Cross Encoders

Rerank retrieval candidates by scoring each query and document pair directly, and weigh the latency and cost before adding this stage to the request path.

Data Fetching

Streaming LLM Tokens to the Browser

Deliver model output token by token with server sent events, handle disconnects cleanly, and avoid buffering that turns a fast first token into a long wait.

Data Fetching

Tracking LLM Token Usage and Costs

Capture usage from every model response, attribute spend to features and tenants, and set budgets that trip before a runaway loop becomes a surprising invoice.

Config Management

How to Avoid Async Race Conditions

Prevent async races: serialize access to shared state, use a keyed mutex, ignore stale responses, and test the interleavings that break.

Resilience

How to Avoid Long-Running Transactions

Keep database transactions short: move slow work outside the transaction, detect a long transaction, and understand the vacuum and lock damage it causes.

Resilience

How to Avoid N+1 Query Problems

Detect and fix the N+1 query pattern: load related data in one round trip, batch by key, and verify the query count stays constant as rows grow.

Data Integrity

How to Batch and Coalesce HTTP Requests

Collapse duplicate in-flight requests with singleflight, merge small calls into batch endpoints, and keep failure semantics honest at the merge point.

Data Fetching

How to Batch Upsert Rows in PostgreSQL

Use INSERT ON CONFLICT with a real unique target, chunk large ingest batches, return actual outcomes, and distinguish inserts from updates.

Data Integrity

How to Build a Circuit Breaker in Node.js

Implement a circuit breaker in Node.js with closed, open, and half-open states, failure thresholds, timeouts, fallbacks, and tests for every transition.

Resilience

How to Build a Data Validation Pipeline

Parse with schemas before logic, collect per-field errors with paths, quarantine bad rows with reasons, and replay from the dead-letter store.

Data Integrity

How to Build a Deduplication Pipeline

Normalize keys before comparing, dedupe exactly with unique constraints, pre-filter with bloom filters, and quantify miss and false-positive rates.

Data Integrity

How to Build Interactive CLI Prompts

Build interactive prompts: detect the terminal, validate the input, support non-interactive flags, and never hang a scripted run.

Cli Tooling

How to Cache Database Queries Safely

Cache query results without stale correctness: key by all inputs, scope by user where needed, invalidate on write, and guard the N+1 case.

Data Integrity

How to Choose Between REST and GraphQL

Pick REST or GraphQL from the client needs: weigh over-fetching, caching, versioning, and tooling, and match the choice to the workload.

Data Fetching

How to Choose Between SSE and WebSockets

Compare transport semantics, reconnection behavior, proxy compatibility, and HTTP/2 limits to pick server-sent events or WebSockets with confidence.

Data Fetching

How to Choose the Right HTTP Status Code

Pick correct HTTP status codes for success, redirect, client error, and server error cases, and avoid the 200-with-an-error-field anti-pattern.

Data Fetching

How to Classify Network Errors for Retries

Sort failures by layer, gate retries on idempotency, parse Retry-After, and add full-jitter backoff with a deadline so retries help instead of amplify.

Resilience

How to Compose Timeout Budgets

Propagate one deadline from the entry point, derive per-call timeouts from the remainder, and keep retries inside the same budget.

Resilience

How to Configure Content Security Policy

Start from default-src, move scripts to nonces with strict-dynamic, deploy through report-only, and tighten the policy per violation report.

Security Boundaries

How to Configure mTLS Between Services

Issue short-lived SAN certificates, require and verify client certificates on every hop, extract identity from the cert, and automate rotation.

Security Boundaries

How to Configure Read-Write Splitting

Route writes to the primary and reads to replicas, pin post-write reads, monitor replication lag, and keep failover semantics explicit.

Data Integrity

How to Design Degradation Strategies

Ladder from full features to cached, simplified, and queued modes, drive the ladder by dependency health, and make degraded states visible to users.

Resilience

How to Design Health Check Endpoints

Split liveness from readiness, keep dependency checks out of liveness, add startup probes, and cache results so probes cannot stampede.

Resilience

How to Design Idempotent Consumers

Make a message consumer idempotent: dedupe on the event id, apply the effect and the id in one transaction, and handle the out-of-order delivery.

Data Integrity

How to Design Soft Deletes

Add deleted_at with partial unique indexes, enforce default filtering in one place, and plan restore conflicts and eventual purging.

Data Integrity

How to Design Tamper-Evident Audit Logs

Chain records with per-entry hashes, anchor chain heads externally, redact secrets at write time, and verify the chain continuously.

Security Boundaries

How to Design Test Data Builders

Build test data with builders: default every field, override only what matters, and keep the test focused on the behaviour under test.

Resilience

How to Fix Deep Pagination Performance

Replace OFFSET with keyset pagination on a stable composite sort, estimate totals instead of counting, and keep cursor state tamper-proof.

Data Integrity

How to Handle DNS Failures and Fallback

Make outbound calls resilient to DNS failures: cache resolutions, add timeouts, retry other records, and avoid tight retry loops on resolution errors.

Resilience

How to Handle HTTP Redirects Safely

Choose the right redirect status, avoid open redirects, preserve methods across 307 and 308, and prevent redirect loops and header leakage.

Security Boundaries

How to Handle NULL Semantics in SQL

Work with SQL three-valued logic correctly: use IS NULL, COALESCE, and NULL-safe comparison, and avoid the comparisons that silently drop rows.

Data Integrity

How to Handle Timezones in Databases

Store timestamptz in UTC, convert at boundaries, keep future local events with their zone name, and test DST boundaries deliberately.

Data Integrity

How to Implement a Backend for Frontend

Add a BFF per client: shape the response for one client, aggregate the services, keep the client simple, and own the client-specific logic.

Data Fetching

How to Implement a Multi-Layer Cache

Build a layered cache: a local layer for speed, a shared layer for consistency, and a clear read path that falls through the layers in order.

Resilience

How to Implement a Semaphore

Use a semaphore to cap concurrency: acquire a permit before work, release it in finally, and weigh fairness against throughput.

Resilience

How to Implement a Task Queue

Build an in-process task queue: prioritise work, bound concurrency, retry with backoff, and survive a worker crash without losing tasks.

Resilience

How to Implement a Worker Pool

Build a worker pool: spawn a fixed set, distribute tasks, collect results in order or as they finish, and handle a worker that crashes.

Resilience

How to Implement an API Gateway

Build an API gateway: route to the services, handle the cross-cutting concerns, authenticate at the edge, and keep it from becoming a bottleneck.

Resilience

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