In medieval England, villages had common grazing land—the “commons”—where all villagers could graze their sheep.
Each shepherd faced a decision: How many sheep should I graze?
The logic was simple:
- Adding one more sheep: I get 100% of the profit
- Cost of overgrazing: Shared among all shepherds
So every rational shepherd added more sheep.
And more.
And more.
Until the commons was destroyed. Overgrazed. Barren. Worthless to everyone.
This wasn’t malice. Each shepherd was acting rationally in their own self-interest.
But rational individual decisions led to collective catastrophe.
Welcome to the Tragedy of the Commons.
What Is the Tragedy of the Commons?
Coined by ecologist Garrett Hardin in 1968, the Tragedy of the Commons describes a situation where:
- A resource is shared (grazing land, fisheries, atmosphere, codebase)
- Each individual benefits from using more of it
- The cost of overuse is shared by everyone
- Result: Rational self-interest destroys the resource
The “tragedy” isn’t evil people being selfish. It’s good people acting rationally within a broken incentive structure.
The Formula:
Individual benefit of using resource: HIGH
Individual cost of depleting resource: LOW (shared among many)
Result: Overuse until collapse
Historical Examples
1. The Atlantic Cod Fishery
- Rich fishing grounds off Newfoundland for 500 years
- Each fishing company: “If I don’t catch the fish, someone else will”
- Result: 1992 collapse, 40,000 jobs lost, ecosystem destroyed
- Still hasn’t recovered 30+ years later
2. Whaling
- 19th century: Whales hunted nearly to extinction
- Each whaler: “One more whale won’t matter”
- Result: Multiple species nearly extinct
- Only international regulation saved them
3. California Water Crisis
- Farmers overpump groundwater
- Each farmer: “I need water for my crops”
- Result: Aquifers depleted, land subsides, future farming impossible
4. Air Pollution
- Each factory: “My pollution is a tiny fraction”
- Result: Smog, climate change, respiratory disease
5. Antibiotic Resistance
- Doctors overprescribe antibiotics (individual benefit)
- Cost: Superbugs resistant to treatment (collective harm)
- Result: Common infections becoming untreatable
Why It Happens
The Tragedy of the Commons occurs when:
1. Misaligned Incentives
Benefit is private. Cost is public.
Adding one sheep:
- Profit to me: 100%
- Cost to me: 1/100 (if there are 100 shepherds)
Rational choice: Add sheep
2. Lack of Ownership
No one owns the commons, so no one protects it.
"It's everyone's, so it's no one's"
3. Free Rider Problem
If I conserve, others will just take more.
"If I don't overfish, another boat will.
So I might as well take what I can."
4. Short-term Thinking
Long-term collapse is someone else’s problem.
"The fishery will collapse in 20 years.
But I need to make money THIS year."
5. Diffused Responsibility
No single person feels responsible.
"My contribution to the problem is tiny.
Blaming me is unfair."
In Software Engineering
The Tragedy of the Commons destroys codebases, systems, and teams:
Shared Codebase
Scenario: 50 engineers, one monolith
Engineer thinks:
- "I'll just add one more dependency"
- "I'll skip writing tests this time"
- "I'll leave this TODO for later"
Each decision: Small individual benefit, shared cost
Result:
- 200 dependencies
- 40% code coverage
- 1,000 TODOs
- Technical debt mountain
- "We need to rewrite it"
Build Time
Each engineer:
- Adds 10 seconds to build time for convenience
- "It's just 10 seconds, doesn't matter"
50 engineers × 10 seconds = 8 minutes added
Result:
- 30-minute builds
- Broken CI/CD
- Slow feedback loops
Production Monitoring
Each team:
- "We'll just add our logs to the shared system"
- "Just a few more metrics"
Result:
- Logging costs: $50k/month
- Signal buried in noise
- Slow queries on shared database
Meeting Culture
Each person:
- Invites "just one more person" to be safe
- "30 more minutes won't hurt"
Result:
- 15-person meetings
- 90-minute standups
- No one gets work done
On-Call Rotations
Each developer:
- "I'll fix this properly later" (ships hacky fix)
- "Not my problem, I'm off-call next week"
Result:
- Frequent pages
- Burnout
- No one wants on-call duty
Shared Infrastructure
Each service:
- "We'll just spin up a few more instances"
- "We'll cache EVERYTHING"
Result:
- AWS bill: $100k/month
- Cache invalidation hell
- No one knows what's running where
Code Review
Each reviewer:
- "Someone else will review thoroughly"
- Rubber-stamps to clear queue
Result:
- Bugs slip through
- No real review happens
- Quality degrades
How to Solve the Tragedy
Solutions require changing incentives:
1. Private Ownership
When you own it, you protect it.
Before: Shared codebase, no owner
- Everyone's responsibility = no one's responsibility
After: Clear ownership
- Auth team owns authentication
- Payments team owns billing
- Break down monolith into owned services
2. Regulation/Governance
Enforce limits on use.
Tech example:
- Max dependencies per service
- Build time budgets
- Test coverage minimums
- Logging quotas
3. Make Costs Visible
When people see the cost, behavior changes.
Before: "Cloud is free" (central budget)
After: Chargeback per team
Result: Teams optimize costs
4. Align Incentives
Make individual benefit align with collective good.
Before: Ship fast at all costs
After: Performance reviews include:
- Code quality
- Test coverage
- Production stability
5. Social Norms
Culture can enforce good behavior.
Team norm: "We don't merge without tests"
Peer pressure: More effective than policy
6. Limit Group Size
Small groups self-police better than large ones.
2-pizza teams (Amazon)
Squad model (Spotify)
Small = accountability
7. Build Feedback Loops
Make consequences immediate.
Before: Deploy breaks prod next week
After: Deploy breaks YOUR on-call shift
Result: More careful deploys
Real-World Solutions
Iceland Fishing Quotas
- Individual transferable quotas (ITQs)
- Each boat has a limit
- Can trade quotas
- Result: Sustainable fishing, healthy stocks
Carbon Credits
- Cap on total emissions
- Companies buy/sell credits
- Market-based solution to pollution
- Effectiveness: Debated, but better than nothing
Open Source Governance
- Linux kernel: Linus is “benevolent dictator”
- Clear decision-making prevents commons tragedy
- Not democratic, but effective
Wikipedia
- Shared resource (knowledge)
- Avoids tragedy through:
- Strong norms
- Active moderation
- Reverts vandalism
- Culture of contribution
The Deeper Lesson
The Tragedy of the Commons isn’t about bad people. It’s about broken systems.
Every shepherd was acting rationally. Every fisher was trying to feed their family. Every engineer is trying to ship features.
Individual rationality ≠ collective rationality.
This is a fundamental problem in human coordination. And it shows up everywhere:
- Climate change
- Ocean acidification
- Antibiotic resistance
- Traffic congestion
- Public restrooms (ever wonder why they’re gross?)
The only solutions are:
- Change the incentives (make private benefit = collective benefit)
- Regulation (force people to act collectively rational)
- Culture (social norms enforce good behavior)
- Ownership (someone who cares protects it)
The Programmer’s Perspective
As engineers, we create commons all the time:
- Shared codebases
- Shared infrastructure
- Shared on-call rotations
- Shared documentation
- Shared knowledge
If we don’t design incentives correctly, they’ll degrade.
Every tragedy of the commons is a systems design failure.
Not a people failure. A systems failure.
The shepherds didn’t need to be better people. They needed better incentives.
Your team doesn’t need to “be more responsible.” You need to design responsibility into the system.
Next time you see a degrading shared resource, don’t blame individuals. Fix the incentives.
Key Takeaways
- ✅ Shared resources degrade when individual benefit exceeds individual cost
- ✅ Rational self-interest can destroy collective resources
- ✅ Solutions: ownership, regulation, norms, aligned incentives
- ✅ Not a people problem—a systems design problem
- ✅ Make costs visible and consequences immediate
The commons didn’t fail because shepherds were selfish.
It failed because the system rewarded adding more sheep and punished restraint.
Each shepherd who held back? Watched others profit.
Each shepherd who added more sheep? Made money.
The incentives were broken. The tragedy was inevitable.
The next time you see:
- Technical debt piling up
- Test coverage declining
- Build times growing
- Infrastructure costs exploding
Don’t ask: “Why aren’t people being more responsible?”
Ask: “What are the incentives rewarding?”
Because you don’t have a people problem.
You have a Tragedy of the Commons.
And the only fix is changing the system.