惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX - 技术
D
DataBreaches.Net
阮一峰的网络日志
阮一峰的网络日志
Recent Announcements
Recent Announcements
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
T
The Exploit Database - CXSecurity.com
Simon Willison's Weblog
Simon Willison's Weblog
Cisco Talos Blog
Cisco Talos Blog
Microsoft Security Blog
Microsoft Security Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
K
Kaspersky official blog
F
Fortinet All Blogs
GbyAI
GbyAI
Forbes - Security
Forbes - Security
The Cloudflare Blog
博客园 - 司徒正美
博客园_首页
量子位
Schneier on Security
Schneier on Security
G
GRAHAM CLULEY
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Proofpoint News Feed
N
News | PayPal Newsroom
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
T
Tor Project blog
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
Jina AI
Jina AI
Help Net Security
Help Net Security
T
Threat Research - Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Cybersecurity and Infrastructure Security Agency CISA
Project Zero
Project Zero
N
News and Events Feed by Topic
I
Intezer
B
Blog
美团技术团队
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
LINUX DO - 最新话题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Blog — PlanetScale
Blog — PlanetScale
AWS News Blog
AWS News Blog
T
Tailwind CSS Blog
The Last Watchdog
The Last Watchdog
雷峰网
雷峰网
有赞技术团队
有赞技术团队

The Practical Developer

The Libuv Thread Pool Trap: Why Node.js Async APIs Stall Under Load Postgres Covering Indexes with INCLUDE: Eliminate Heap Fetches on Read-Heavy Workloads Postgres DISTINCT ON: The Fastest Way to Get the Latest Row Per Group Postgres Transaction Isolation: The Anomalies Your App Actually Faces in Production Linux TCP Tuning for Node.js Microservices: The Kernel Settings That Stop Silent Connection Drops Under Load Postgres HOT Updates and Fillfactor: Why Not All Writes Are Created Equal Database Connection Pool Leaks: Finding the Promise That Never Returns Its Seat Linux OOM Killer in Production: Why Your Node.js Containers Die Without a Stack Trace Postgres Materialized Views: Refresh Strategies That Do Not Lock Your Dashboards API Dependency Health Checks: Why /health Is Not Enough Authorization with Zanzibar Tuples: How Google Manages Permissions and How To Build the Same Check in Node.js Postgres Advisory Locks: The 20-Character Primitive That Replaces Redis for Coordination Dead Letter Queues: The Message Queue Pattern That Saves You at 2 a.m. File Descriptor Exhaustion: The Kernel Limit That Silently Drops Node.js Connections Graceful Degradation: The Pattern That Turns Total Outages into Partial Success PostgreSQL Full-Text Search: Dropping Elasticsearch for 90% of Use Cases S3 Presigned Multipart Uploads: Stop Your API Server from Being a File Upload Bottleneck MessagePack vs JSON: The Binary Serialization Switch That Cut Our Internal RPC Overhead by 40% DNS Caching in Node.js: The Silent Cause of Production Latency Spikes Reliable Cron Jobs: The Pattern That Stops Double Runs, Missed Executions, And The 2 AM Page GraphQL Query Complexity: Stop the OOM Query Before It Reaches Your Resolver Node.js Event Loop Lag: The Hidden Metric Behind Random Latency Spikes API Request Validation with Zod: The Schema That Catches Bad Input Before It Corrupts Your Database Load Shedding in Node.js: How to Reject Traffic Before You Drown Request Hedging: Cut Tail Latency In Half Without Overprovisioning Git Bisect: The Automated Binary Search That Finds Breaking Commits in Minutes Node.js Garbage Collection Tuning: Stop Letting V8 Pause Your Event Loop Node.js Server Timeouts: The Settings That Stop Slow Clients from Holding Sockets Hostage Postgres BRIN Indexes: The Time-Series Secret That Shrinks Indexes by 99% Event Sourcing with PostgreSQL: The Pragmatic 80% Solution Node.js Cluster Mode: Scaling the Event Loop Across CPU Cores Postgres Partial Indexes: Stopping Soft Deletes from Ruining Your Query Performance Request Coalescing with the Singleflight Pattern: Stop Drowning Your Database on Every Cache Miss The Bulkhead Pattern: Why One Slow Endpoint Should Not Drown Your Whole Service Node.js AsyncLocalStorage: End-to-End Request Context Without the Propagation Hell Postgres Deadlocks: Logging the Victim, Reproducing the Race, and Fixing the Lock Order Your Node.js HTTP Client Is the Bottleneck: Connection Pool Tuning That Works Optimistic Locking in Postgres: Stop Losing Data to Race Conditions Postgres Read Replicas: Stop Serving Stale Data to Your Users Cursor Pagination: Why Offset Queries Explode at Scale and How to Fix Them Node.js Worker Threads: 60 Lines That Stop a CSV Upload from Timing Out Every Other Request Reliable Webhook Delivery: Architecture for Outbound HTTP You Can Trust Request Timeouts and Deadline Propagation: Stop the Chain of Slowness Advanced Security Practices in Node.js Graceful Shutdown in Node.js: The 40 Lines That Stop 502s During Deploys Finding Node.js Memory Leaks with Heap Snapshots Idempotency Keys in 30 Lines: Stop Your Webhook From Charging Customers Twice Backpressure In Node.js: The Fix For Slow-Motion Queue Meltdowns Retries Done Right: Jitter, Budgets, and the Stampede You Did Not See Coming The Cache Stampede: Why Your "Just Add Redis" Layer Crashes Postgres at 3 a.m. Postgres SKIP LOCKED: An 80-Line Job Queue You Can Run Without Redis Stop Doing Work Nobody Wants: AbortController in Node.js, Done Right The N+1 Query Problem: We Found 23 In One Codebase And Killed Every One I Tried 5 AI Coding Tools for a Month. Here Is What I Actually Use CI/CD From Zero to Production in 30 Minutes With GitHub Actions Node.js vs Bun vs Deno: Which Runtime Should You Pick in 2025? Kubernetes Resource Requests And Limits: The Numbers That Decide If Your Cluster Is Stable The Three Pillars of Observability Are A Myth: What Actually Matters In Production pnpm Vs npm Vs yarn Vs Bun For Monorepos: Which One Earns The Migration In 2024 JSONB Indexing In Postgres: GIN Vs Expression Indexes, And When Each Is The Right Choice A Code Review Checklist That Ends The Same Three Arguments Every Sprint gRPC Vs REST In 2024: When The Switch Pays For Itself React Suspense For Data Fetching: The Pattern That Replaces Half Your Loading State Code The Five-Stage Rollout: How To Ship A Risky Change Without Holding Your Breath GitHub Actions In A Monorepo: Caching, Path Filters, And Secret Boundaries That Actually Work The Blameless Postmortem That Actually Improves Things: A Template And Six Hard-Won Rules Recursive CTEs In Postgres: How To Query A Tree Without N Round Trips Node.js Streams: When They Actually Help, And When They Just Add Complexity Playwright Vs Cypress In 2024: The Honest Comparison Of Which One Earns The Test Time React Server Components: The Mental Model That Makes The "use client" Boundary Obvious Pod Disruption Budgets: The K8s Object That Keeps Your Service Up During Cluster Maintenance Postgres LISTEN/NOTIFY: The Pub/Sub You Already Have And Are Not Using Chaos Engineering Starter Kit: The Five Drills That Don't Need Netflix-Scale Spec-Driven API Development With OpenAPI: How To Stop Drifting From Your Docs Kubernetes Autoscaling Beyond CPU: The Custom-Metric HPA Pattern That Actually Works Postgres Partitioning For Time-Series: The Boring Setup That Saves Your Database Distributed Locks With Redis: An Honest Look At Redlock And When You Don't Need It HTTP/2 vs HTTP/3: What Actually Changes For Your App, And What Doesn't Image Optimization For The Web In 2023: srcset, AVIF, And The Lighthouse Score You Actually Want Kafka vs RabbitMQ: A Decision Tree That Doesn't Hate You UUID vs Bigint Primary Keys In Postgres: The Index Math That Decides For You Flame Graphs: How To Find The Slow Function In 30 Seconds Without Profiling Theatre Postgres Streaming Vs. Logical Replication: Which One Solves Your Actual Problem ESLint Rules That Earn Their Keep: The Twelve I Enable On Every Project Pre-Commit Hooks That Pay For Themselves: Husky, lint-staged, And The Five Rules That Stick Zero-Downtime Database Migrations: The Six-Step Pattern That Rules Them All Circuit Breakers In Node.js: 50 Lines That Stop A Failing Dependency From Taking Down Your Service Postgres VACUUM Is Not Magic: How Your Hot Table Bloats To 80GB And How To Fix It Kubernetes Liveness And Readiness Probes: The Difference That Causes Half Your Outages Rate Limiting In Production: A Token Bucket In 30 Lines Of Redis The Outbox Pattern: How To Stop Losing Events When Postgres And Kafka Disagree Load Testing With k6: The Three Scenarios That Find Real Bugs (Not Synthetic Numbers) Postgres Row-Level Security For Multi-Tenant Apps: The Pattern That Stops You From Leaking Data Rebase vs. Merge: The Team Policy That Ends The Argument Forever OpenTelemetry in Node.js: Distributed Tracing That Actually Helps During an Incident Feature Flags That Pay Rent: The 4 Flag Types And When To Delete Each ETag, Last-Modified, and the Caching Headers Most APIs Get Wrong Connection Pooling Without the Cargo Cult: pgbouncer in 100 Lines of Config JSONB Is Not a Schema: When To Reach For It in Postgres, And When To Stop Bash Strict Mode: The Three Lines That Stop Your Deploy Script From Lying To You
Semantic Versioning In Practice: Why Your Patches Keep Breaking Your Users
The Practica · 2023-03-31 · via The Practical Developer

Your team’s package gets a 1.4.7 patch release. Twenty minutes later, three downstream apps are broken. The release notes say “fixed a typo in error message.” The “typo” was changing the message string, which one of the consumers was matching against in a test. The PR was approved, the patch was published, and you have done exactly what every unhappy upstream maintainer does: you shipped a breaking change in a patch version.

SemVer is the convention everybody claims to follow and almost nobody actually does. The reason is not laziness; it is that “what counts as breaking” is hard, and the incentive structure rewards under-numbering. This post is the operational version: the four ways a “patch” can break consumers, the rules that hold up in practice, and the deprecation playbook that lets you change anything you want without renaming the package.

What MAJOR.MINOR.PATCH actually means

The simple version everybody knows:

  • MAJOR: breaking changes.
  • MINOR: new features, backwards-compatible.
  • PATCH: bug fixes, no API change.

The more honest version:

  • MAJOR: anything that requires consumers to change any code or configuration to upgrade.
  • MINOR: anything that adds capability without requiring changes.
  • PATCH: anything that only changes implementation, not observable behavior.

The middle row is where most disagreement lives. A new optional method on a class is minor. A new required method is major (subclasses break). A new optional parameter at the end of a function signature is minor in some languages, major in others.

Four “patches” that break consumers

If you have shipped any of these as a patch, you have shipped a breaking change.

1. Changing an error message. Consumers may match on the string. Rare? Less than you think. Every test that asserts an error message will break. Either keep the old message or bump major.

2. Tightening validation. “We were accepting empty strings; we now reject them” sounds like a fix. To consumers passing an empty string, it is a regression. Either keep accepting and add a new strict mode, or bump major.

3. Removing a deprecated feature. Deprecated does not mean removed; the feature still works. Removing it requires a major bump even if you have shouted about deprecation for a year.

4. Performance regression that changes behavior. A “fix” that adds an extra round trip changes timing. Consumers depending on the old timing (test mocks, race-prone code) break. Document timing changes; if they could break consumers, bump minor at least.

The rule of thumb: if a consumer would have to change anything (a string, a config, a test) to upgrade cleanly, it is not a patch.

The categories of breaking change

These all warrant a major bump:

  • Removing or renaming a public API.
  • Changing the type of a parameter or return.
  • Changing the meaning of an existing parameter (e.g., timeoutMs becomes timeoutSec).
  • Removing support for a runtime, OS, or language version.
  • Changing default values for options.
  • Changing observable behavior (timing, ordering, errors thrown).
  • Removing exported types or interfaces.
  • Changing the package’s module shape (CJS → ESM, default vs named export).

That last one is the trap nobody warns about. Switching from CommonJS to ESM is a major break even though no API “changed,” because every consumer’s import statement breaks.

The deprecation playbook

When you need to change something, the path is add-new → deprecate-old → remove-old. Three releases minimum.

Release N (minor): add the new way.

// Old API stays.
export function fetchUser(id: string) { ... }

// New API alongside.
export function getUser(id: string, opts?: { include?: string[] }) { ... }

Both work. Existing code is fine.

Release N+1 (minor): mark the old way deprecated.

/**
 * @deprecated Use getUser instead. Will be removed in v2.0.
 */
export function fetchUser(id: string) {
  if (process.env.NODE_ENV !== 'production') {
    console.warn('fetchUser is deprecated. Use getUser instead.');
  }
  return getUser(id);
}

The TS @deprecated JSDoc tag puts a strikethrough in IDEs. The runtime warning ensures nobody misses it. Crucially, the function still works.

Release N+M (major, after a long enough window): remove the old way.

// fetchUser is gone.

Consumers who paid attention to the deprecation warning have already migrated. Consumers who did not get a clear error: “fetchUser is not a function.” They can read the changelog and migrate.

The window between deprecation and removal depends on your audience. Six to twelve months is typical for libraries with hundreds of consumers. For internal packages with a known set of consumers, a few weeks is enough; coordinate with them.

Communicating breaking changes

A CHANGELOG.md that follows keep-a-changelog format is the minimum. Group changes:

## [2.0.0] - 2023-03-15

### Breaking
- Removed `fetchUser` (deprecated since 1.4). Use `getUser` instead.
- Changed default timeout from 30s to 5s. Pass `{ timeout: 30_000 }` to restore.

### Added
- `getUser` accepts an `include` option for related entities.

### Fixed
- Connection pool not draining on `close()`.

### Migration
- Replace `fetchUser(id)` with `getUser(id)`.
- Audit code that relied on the 30s default; explicitly pass `timeout` if needed.

The Migration section is the one that matters most. Every breaking change should answer “what does the consumer have to do to upgrade?” If you cannot answer that in two sentences per change, the change is too big.

SemVer in package managers

Both npm and pip use semantic version ranges. Defaults:

"^1.4.0"  // npm: >=1.4.0 <2.0.0, accept any 1.x
"~1.4.0"  // npm: >=1.4.0 <1.5.0, accept patches only
">=1.4"   // pip: similar

The default of ^ (“compatible release”) is correct if you trust the upstream’s SemVer discipline. For a library that ships breaking changes in minors regularly (looking at every popular framework), pin tighter: ~1.4.0 or even an exact version.

Lockfiles (package-lock.json, Pipfile.lock) protect you from upstream surprises between installs. Run npm ci (clean install from lockfile) in CI, not npm install, so a maintainer’s bad publish does not silently change your build.

Pre-1.0 has different rules

Versions below 1.0 (0.x.y) are explicitly “anything can change.” The npm convention treats 0.x as MAJOR, so 0.5.1 to 0.6.0 is a breaking-change range.

Push to 1.0 sooner rather than later. Sitting at 0.x forever is mostly an excuse to keep breaking consumers without bumping major. If your library is being used in production, it is 1.0; act like it.

Conventional commits → automatic versioning

If your commit messages follow conventional commits format, you can automate version bumps:

feat: add getUser()              → minor bump
fix: connection pool drain bug   → patch bump
feat!: remove fetchUser           → major bump (the ! marks breaking)
BREAKING CHANGE: ...              → major bump (in body)

Tools like release-please and semantic-release read your commit history, decide the bump, generate the changelog, and publish, all from CI on merge to main. Adopt this once your release cadence is faster than once a quarter.

A side effect: writing feat!: requires you to think about whether the change is breaking before you commit it. That single habit is worth the tooling.

When NOT to follow SemVer

SemVer is a convention, not a religion. Two cases where strict SemVer hurts:

Application versions. Your customer-facing app does not need SemVer; bump as makes sense (year-based, sprint-based, feature-named). SemVer is for libraries with consumers.

Pre-release / dev / nightly. Use the pre-release suffix: 2.0.0-alpha.4, 2.0.0-rc.1. These do not satisfy ^2.0.0 ranges, which is exactly right.

For everything else (public packages, internal libraries with multiple consumers, anything you npm publish) the discipline pays for itself the first time someone successfully runs npm update and nothing breaks.

The takeaway

SemVer is hard because “what is a breaking change” is harder than the spec implies. The default is to bump bigger, not smaller. The cost of a too-small bump (a downstream user pinning to a specific version forever) is worse than a too-big one (a major bump that nobody minds).

Add the deprecation cycle to your process. Write a migration line in the changelog for every breaking change. Use conventional commits to make versioning automatic and to force you to label breakage at commit time. The next time someone asks “should this be a patch or a minor,” the answer is whichever forces you to write the migration note.


A note from Yojji

The kind of release-engineering discipline that turns “we shipped 1.4.7” from a guessing game into a routine (conventional commits, deprecation cycles, automated release notes) is the kind of long-haul engineering Yojji’s teams build into the libraries and platforms they ship for clients.

Yojji is an international custom software development company founded in 2016, with teams in Europe, the US, and the UK. They specialize in the JavaScript ecosystem, cloud platforms (AWS, Azure, GCP), and full-cycle product engineering, including the release process and versioning practices that decide whether downstream consumers can upgrade safely.