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.

8667 bites

Page 289

The Strategy Kernel
Product Strategy2 min read

The Strategy Kernel

The strategy kernel, from Richard Rumelt, is the minimal structure of a real strategy: a diagnosis of the actual obstacle, a guiding policy for addressing it, and coherent action that carries it out, separating genuine strategy from a list of goals.

Product Strategy2 min read

Market Segmentation: Don't Sell to Everyone

Market segmentation means you don't sell to everyone. It's about dividing your market into smaller, meaningful groups to target them with tailored strategies. This is used for focused ads or niche product features.

Product Strategy2 min read

Product Roadmap: A Strategic Plan, Not a Feature List

A product roadmap is a strategic guide, not a rigid timeline, showing how work achieves long-term goals. It's used to align engineering, product, and leadership on priorities.

Strategy vs. Tactics: The Map vs. The Directions
Product Strategy2 min read

Strategy vs. Tactics: The Map vs. The Directions

Strategy is your destination and why you're going; tactics are the turn-by-turn directions. A product strategy defines the long-term goal, like 'capture the enterprise market,' while tactics are the specific feature launches to get there.

Product Strategy2 min read

Product Strategy: The 'Why' Behind Your Product

Product strategy is the 'why' behind your product, connecting its vision to business goals. It's the compass that guides development, not the feature-by-feature map. The common footgun is confusing strategy (the why) with the roadmap (the what and when).

Production Secret Management: Inject, Don't Store
Node.js & Express2 min read

Production Secret Management: Inject, Don't Store

Treat secrets like temporary credentials, injected at runtime, not stored with your code. This applies to database passwords and API keys in production. The biggest footgun is using .env files; they are a dev convenience, not a security model.

Node.js & Express2 min read

Heap Snapshots: Finding Node.js Memory Leaks

A heap snapshot is a photograph of your app's memory. Use it to diagnose leaks by comparing snapshots over time to see which objects grow. The big footgun: taking one freezes your app and can double memory usage, risking a crash in production.

Sinon.JS: Isolate and Inspect Code for Unit Tests
Node.js & Express2 min read

Sinon.JS: Isolate and Inspect Code for Unit Tests

Sinon.JS lets you replace real functions with test doubles to check *if* and *how* they were called. Use it to fake network requests or control timers. The biggest footgun is forgetting to restore fakes, which causes tests to leak state and fail unpredictably.

Node.js & Express2 min read

JWTs for Stateless API Authentication

JWTs enable stateless authentication: your server verifies users via a self-contained, signed token instead of a session store. This is ideal for distributed APIs. The biggest footgun is storing refresh tokens in localStorage; use HttpOnly cookies instead.

Passport.js: The Gatekeeper for Your Routes
Node.js & Express2 min read

Passport.js: The Gatekeeper for Your Routes

Passport.js is a gatekeeper for your Node.js routes, authenticating requests before your application logic runs. It uses pluggable "strategies" for different login types, like local passwords or Google OAuth. The footgun is misconfiguring failure handling.

Cookie-Based Sessions: Server-Side State, Client-Side ID
Node.js & Express2 min read

Cookie-Based Sessions: Server-Side State, Client-Side ID

Think of a session cookie as a coat check ticket, not the coat itself. The server stores your data and gives you a unique ID to carry in a cookie. This is how Express.js tracks user state across requests.

Node.js & Express2 min read

Never Trust Client Input: API Validation

Think of API validation as a bouncer for your server, checking every incoming request's ID before it can access your application logic. Use it in any Express route that accepts user input to prevent bad data from hitting your database or causing errors.

package-lock.json: Your Dependency Blueprint
Node.js & Express2 min read

package-lock.json: Your Dependency Blueprint

package-lock.json is a blueprint for your node_modules, ensuring everyone on your team installs the exact same dependency versions. It's auto-generated by npm to prevent 'works on my machine' bugs. The footgun is ignoring it or manually editing it.

Node.js & Express2 min read

Non-Blocking I/O: Don't Block the Event Loop

Non-blocking I/O lets your program do other work while waiting for slow operations like network requests. It's the core of Node.js, allowing a single thread to serve many users.

CI/CD Pipelines for Node.js Applications
Node.js & Express2 min read

CI/CD Pipelines for Node.js Applications

A CI/CD pipeline is an automated assembly line for Node.js code, installing dependencies, running tests, and packaging your app for deployment. This is standard for any professional project, but a common footgun is not caching dependencies, leading to slow…

Docker Compose for Multi-Container Apps
Node.js & Express2 min read

Docker Compose for Multi-Container Apps

Docker Compose is a conductor for your containers. Instead of running each service manually, you define your app and its database in one YAML file and launch them together. This is standard for local Node.js/Postgres development.

PM2: Zero-Downtime Reloads in Cluster Mode
Node.js & Express2 min read

PM2: Zero-Downtime Reloads in Cluster Mode

PM2's reload command updates a clustered Node.js app without downtime by restarting processes one by one. Use this for live deployments. The footgun is using it on a stateful app, which will cause data loss unless state is externalized.

Health Check Endpoints: Reporting App Status
Node.js & Express2 min read

Health Check Endpoints: Reporting App Status

A health check is a dedicated endpoint that tells an orchestrator if your app is alive and ready for traffic. Systems like Kubernetes use it to decide whether to send traffic (readiness) or restart a container (liveness).

Node.js & Express2 min read

Environment-Specific Config: Beyond Hardcoded Values

Think of config as layered transparencies: a base file sets defaults, and environment-specific files (like production.json) override them. This keeps database hosts and feature flags tidy across dev, staging, and prod.

Node.js & Express2 min read

Optimize Node.js Images with Multi-Stage Builds

Multi-stage builds separate your build environment from your final runtime. This lets you use heavy tools to build your Node.js app, then ship only the lean production code, drastically reducing image size and attack surface.