Skip to content
tezvyn:

All bites

The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.

8664 bites

Page 21

Node.js & Express1 min read

Diamond dependencies and nested node_modules

Npm hoists one version to the top and nests the conflicting version under the dependent package; both coexist on disk.

Node.js & Express1 min read

Circular dependencies in CommonJS modules

When A requires B which requires A, the cache returns A's partial exports; fields defined later are undefined at that moment.

Node.js & Express1 min read

SemVer and the caret vs tilde range operators

MAJOR.MINOR.PATCH signals breaking/feature/fix; caret allows minor and patch updates, tilde allows only patch; use tilde for tighter control.

Node.js & Express1 min read

Layered structure for a scalable Express API

Routes map URLs, controllers handle HTTP, services hold business logic, data layer talks to the DB; keep each layer ignorant of HTTP except controllers.

Node.js & Express1 min read

Choosing between CommonJS and ES Modules

ESM is the standard with static import/export and top-level await; set type to module; CJS uses require and module.exports and is synchronous.

Node.js & Express1 min read

Why package-lock.json must be committed

Lockfile pins exact versions of the whole dependency tree including transitive deps; guarantees identical installs across machines and CI.

Node.js & Express1 min read

Resolving core vs relative module specifiers

'fs' is a built-in core module loaded by name with top priority; './my-file.js' is a relative path resolved from the current file.

Node.js & Express1 min read

dependencies vs devDependencies in package.json

Dependencies ship and run in production; devDependencies are only for development; omitted with npm install --production.

Node.js & Express1 min read

Offloading CPU-bound work with Worker Threads

Synchronous CPU work freezes the loop and all requests; offload to a Worker, communicate via messages or SharedArrayBuffer, use a pool.

Node.js & Express1 min read

nextTick vs setImmediate vs setTimeout(fn, 0)

NextTick is a microtask that drains before the loop continues; setImmediate runs in check; setTimeout(0) in timers.

Node.js & Express1 min read

Order of the Node.js event loop phases

Timers, pending callbacks, poll, check, close phases in order; I/O completion runs in poll.

Node.js & Express2 min read

The WebSocket Protocol

WebSocket (RFC 6455) is a protocol providing full-duplex, persistent communication over a single TCP connection. It begins as an HTTP request that upgrades, then both client and server can send messages anytime, enabling real-time apps without HTTP's…

Monitoring & SRE2 min read

Federating reliability ownership to product teams

Build a self-service reliability platform (golden paths, paved roads), train teams and embed SLO/on-call practices, and govern with standards plus error budget…

Monitoring & SRE2 min read

Capacity planning for a distributed cache

Track hit ratio, memory and eviction rate, throughput/latency, and connections; correlate with growth to forecast when to add capacity before the hit ratio or evictions…

Monitoring & SRE2 min read

Capacity planning for distributed stateful systems

Account for replication and cross-region network, IOPS and disk throughput, connection limits, partition/shard balance, and N+1 region failover headroom; validate with load and chaos…

Monitoring & SRE2 min read

Designing a feature flagging service

Control plane (UI, store, targeting), SDKs that cache flags locally for zero-latency evaluation, streaming/CDN delivery for near-real-time updates, and stale-flag lifecycle tooling.

Monitoring & SRE2 min read

Managing a risky release with feature flags

Deploy code dark behind an off flag, enable for internal then small percentage, monitor metrics, ramp gradually, then remove the flag.

Monitoring & SRE1 min read

Automating actions on error budget burn

Use multi-window burn-rate alerts; on fast burn, auto-trigger actions like halting deploys, rolling back, or scaling, with escalating tiers.

Monitoring & SRE2 min read

Safeguards for automated remediation runbooks

Add rate limits and circuit breakers on restarts, escalate to humans after N attempts, log all actions, and check for cascading failure before acting.

Monitoring & SRE1 min read

Breaking tunnel vision during an incident

Call out the assumption, ask for disconfirming evidence, list parallel hypotheses, split responders to investigate them, and anchor on what changed and the data.