Software Backend Engineering
Use this skill to design, implement, and review production-grade backend services: API boundaries, data layer, auth, caching, observability, error handling, testing, and deployment.
Defaults to bias toward: type-safe boundaries (validation at the edge), OpenTelemetry for observability, zero-trust assumptions, idempotency for retries, RFC 9457 errors, Postgres + pooling, structured logs, timeouts, and rate limiting.
Scaffolding rule: When scaffolding a new project, show full working implementations for all domain logic — fraud rules, audit logging, webhook handlers, validation pipelines, background jobs. Don't just reference file names or stub functions; show the actual code so the user can run it immediately.
Quick Reference
| Task |
Default Picks |
Notes |
| REST API |
Fastify / Express / NestJS |
Prefer typed boundaries + explicit timeouts |
| Edge API |
Hono / platform-native handlers |
Keep work stateless, CPU-light |
| Type-Safe API |
tRPC |
Prefer for TS monorepos and internal APIs |
| GraphQL API |
Apollo Server / Pothos |
Prefer for complex client-driven queries |
| Database |
PostgreSQL |
Use pooling + migrations + query budgets |
| ORM / Query Layer |
Prisma / Drizzle / SQLAlchemy / GORM / SeaORM / EF Core |
Prefer explicit transactions |
| Authentication |
OIDC/OAuth + sessions/JWT |
Prefer httpOnly cookies for browsers |
| Validation |
Zod / Pydantic / validator libs |
Validate at the boundary, not deep inside |
| Caching |
Redis (or managed) |
Use TTLs + invalidation strategy |
| Background Jobs |
BullMQ / platform queues |
Make jobs idempotent + retry-safe |
| Testing |
Unit + integration + contract/E2E |
Keep most tests below the UI layer |
| Observability |
Structured logs + OpenTelemetry |
Correlation IDs end-to-end |
Scope
Use this skill to:
- Design and implement REST/GraphQL/tRPC APIs
- Model data schemas and run safe migrations
- Implement authentication/authorization (OIDC/OAuth, sessions/JWT)
- Add validation, error handling, rate limiting, caching, and background jobs
- Ship production readiness (timeouts, observability, deploy/runbooks)
When NOT to Use This Skill
Use a different skill when:
Technology Selection
Pick based on the strongest constraint, not feature lists:
| Constraint |
Default Pick |
Why |
| Team knows TypeScript only |
Fastify/Hono + Prisma/Drizzle |
Ecosystem depth, hiring ease |
| Need <50ms P95, CPU-bound work |
Go (net/http + sqlc/pgx) |
Goroutines isolate CPU work; no event-loop risk |
| Data-heavy / ML integration |
Python (FastAPI + SQLAlchemy) |
Best ecosystem for numpy/pandas/ML pipelines |
| Memory-safety critical |
Rust (Axum + SeaORM/SQLx) |
Zero-cost abstractions, no GC |
| Enterprise/.NET team |
C# (ASP.NET Core + EF Core) |
Azure integration, mature tooling |
| Edge/serverless |
Hono / platform-native handlers |
Stateless, CPU-light, fast cold starts |
| Fintech/audit-sensitive |
Go + sqlc (or raw SQL) |
ORM magic is a liability; you need auditable SQL |
For detailed framework/ORM/auth/caching selection trees, see references/edge-deployment-guide.md and language-specific references.
See assets/ for starter templates per language.
API Design Patterns (Dec 2025)
Idempotency Patterns
All mutating operations MUST support idempotency for retry safety.
Implementation:
// Idempotency key header
const idempotencyKey = request.headers['idempotency-key'];
const cached = await redis.get(`idem:${idempotencyKey}`);
if (cached) return JSON.parse(cached);
const result = await processOperation();
await redis.set(`idem:${idempotencyKey}`, JSON.stringify(result), 'EX', 86400);
return result;
| Do |
Avoid |
| Store idempotency keys with TTL (24h typical) |
Processing duplicate requests |
| Return cached response for duplicate keys |
Different responses for same key |
| Use client-generated UUIDs |
Server-generated keys |
Pagination Patterns
| Pattern |
Use When |
Example |
| Cursor-based |
Large datasets, real-time data |
?cursor=abc123&limit=20 |
| Offset-based |
Small datasets, random access |
?page=3&per_page=20 |
| Keyset |
Sorted data, high performance |
?after_id=1000&limit=20 |
Prefer cursor-based pagination for APIs with frequent inserts.
Error Response Standard (Problem Details)
Use a consistent machine-readable error format (RFC 9457 Problem Details): https://www.rfc-editor.org/rfc/rfc9457
{
"type": "https://example.com/problems/invalid-request",
"title": "Invalid request",
"status": 400,
"detail": "email is required",
"instance": "/v1/users"
}
Health Check Patterns
// Liveness: Is the process running?
app.get('/health/live', (req, res) => {
res.status(200).json({ status: 'ok' });
});
// Readiness: Can the service handle traffic?
app.get('/health/ready', async (req, res) => {
const dbOk = await checkDatabase();
const cacheOk = await checkRedis();
if (dbOk && cacheOk) {
res.status(200).json({ status: 'ready', db: 'ok', cache: 'ok' });
} else {
res.status(503).json({ status: 'not ready', db: dbOk, cache: cacheOk });
}
});
Common Mistakes (Non-Obvious)
| Avoid |
Instead |
Why |
| N+1 queries |
include/select or DataLoader |
10-100x perf hit; easy to miss in ORM code |
| No request timeouts |
Timeouts on HTTP clients, DB, handlers |
Hung deps cascade; see Production Hardening below |
| Missing connection pooling |
Prisma pool / PgBouncer / pgx pool |
Exhaustion under load on shared DB tiers |
| Catching errors silently |
Log + rethrow or handle explicitly |
Hidden failures, impossible to debug |
Production Hardening: Patterns Models Skip
These are the patterns that separate "works in dev" from "survives production." Models tend to skip them unless explicitly prompted — add them to every service.
Request & Query Timeouts
Every outbound call needs a timeout. Without one, a hung dependency leaks connections and cascades failures.
// HTTP client timeout
const response = await fetch(url, { signal: AbortSignal.timeout(5000) });
// Database query timeout (Prisma)
await prisma.$queryRaw`SET statement_timeout = '3000'`;
// Express/Fastify request timeout
server.register(import('@fastify/timeout'), { timeout: 30000 });
| Layer |
Default Timeout |
Rationale |
| HTTP client calls |
5s |
External APIs shouldn't block you |
| Database queries |
3s |
Slow queries = missing index or bad plan |
| Request handler |
30s |
Safety net for the whole request lifecycle |
| Background jobs |
5min |
Jobs that run longer need chunking |
Field-Level Selection (Don't SELECT *)
ORMs default to fetching all columns. On wide tables this wastes bandwidth and hides performance problems.
// BAD: fetches all 30 columns
const users = await prisma.user.findMany({ include: { posts: true } });
// GOOD: fetch only what the endpoint needs
const users = await prisma.user.findMany({
select: { id: true, name: true, email: true },
include: { posts: { select: { id: true, title: true } } }
});
For Go (sqlc): write explicit column lists in SQL queries — sqlc enforces this naturally.
For Python (SQLAlchemy): use load_only() or explicit column selection.
Structured Error Responses (RFC 9457)
Return machine-readable errors from day one. Clients shouldn't have to regex-parse error messages.
{
"type": "https://api.example.com/problems/validation-error",
"title": "Validation failed",
"status": 422,
"detail": "email must be a valid email address",
"instance": "/v1/users",
"errors": [{ "field": "email", "message": "invalid format" }]
}
Set Content-Type: application/problem+json. This format is a standard (RFC 9457) and parseable by any HTTP client.
Query Plan Verification
Before shipping any new query to production, verify its execution plan:
EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)
SELECT ... FROM ... WHERE ...;
Red flags in the output: Seq Scan on large tables, Nested Loop with high row estimates, Sort without index. Add indexes or rewrite the query before deploying.
Performance Debugging Workflow
When a service is slow, work through these layers in order. Fix the cheapest layer first — don't add caching before fixing N+1 queries.
| Step |
What to Check |
Fix |
| 1. Query analysis |
Enable query logging, find N+1s and slow queries |
Rewrite with include/joins, add select for field-level optimization |
| 2. Indexing |
Run EXPLAIN ANALYZE on slow queries |
Add composite indexes matching WHERE + ORDER BY patterns |
| 3. Connection pooling |
Check connection count vs. pool size |
Configure pool limits (Prisma connection_limit, PgBouncer, pgx pool) |
| 4. Caching |
Identify read-heavy, rarely-changing data |
Add Redis/in-memory cache with TTL + invalidation strategy |
| 5. Timeouts |
Check for missing timeouts on DB, HTTP, handlers |
Add timeouts at every layer (see Production Hardening above) |
| 6. Platform tuning |
Shared DB limits, cold starts, memory |
Upgrade tier, add read replicas, tune runtime settings |
Key principle: always measure before and after. Use structured logging with request IDs to trace specific slow requests end-to-end.
Infrastructure Economics
Backend architecture decisions directly impact cost and revenue. See references/infrastructure-economics.md for detailed cost modeling, SLA-to-revenue mapping, unit economics checklists, and FinOps practices.
Navigation
Resources
- references/backend-best-practices.md - Template authoring guide, quality checklist, and shared utilities pointers
- references/edge-deployment-guide.md - Edge computing patterns, Cloudflare Workers vs Vercel Edge, tRPC, Hono, Bun
- references/infrastructure-economics.md - Cost modeling, performance SLAs -> revenue, FinOps practices, cloud optimization
- references/go-best-practices.md - Go idioms, concurrency, error handling, GORM usage, testing, profiling
- references/rust-best-practices.md - Ownership, async, Axum, SeaORM, error handling, testing
- references/python-best-practices.md - FastAPI, SQLAlchemy, async patterns, validation, testing, performance
- references/nodejs-best-practices.md - Event loop, async patterns, Express/Fastify/NestJS/Hono, error handling, memory management, security, profiling
- references/csharp-best-practices.md - C# 14 / .NET 10 LTS, extension members, field keyword, ASP.NET Core 10 (validation, SSE, OpenAPI 3.1), EF Core 10 (LeftJoin, named filters), HybridCache, Polly v8 resilience
- references/database-patterns.md - PostgreSQL patterns (JSONB, CTEs, partitioning), connection pooling, migration strategies, ORM comparison, index design
- references/message-queues-background-jobs.md - BullMQ patterns, broker comparison (Redis/SQS/Kafka/RabbitMQ), idempotent jobs, DLQ, scheduling, delivery guarantees
- data/sources.json - External references per language/runtime
- Shared checklists: ../software-clean-code-standard/assets/checklists/backend-api-review-checklist.md, ../software-clean-code-standard/assets/checklists/secure-code-review-checklist.md
Shared Utilities (Centralized patterns - extract, don't duplicate)
- ../software-clean-code-standard/utilities/auth-utilities.md - Argon2id, jose JWT, OAuth 2.1/PKCE
- ../software-clean-code-standard/utilities/error-handling.md - Effect Result types, correlation IDs
- ../software-clean-code-standard/utilities/config-validation.md - Zod 3.24+, Valibot, secrets management
- ../software-clean-code-standard/utilities/resilience-utilities.md - p-retry v6, opossum v8, OTel spans
- ../software-clean-code-standard/utilities/logging-utilities.md - pino v9 + OpenTelemetry integration
- ../software-clean-code-standard/utilities/testing-utilities.md - Vitest, MSW v2, factories, fixtures
- ../software-clean-code-standard/utilities/observability-utilities.md - OpenTelemetry SDK, tracing, metrics
- ../software-clean-code-standard/references/clean-code-standard.md - Canonical clean code rules (
CC-*) for citation
Templates
- assets/nodejs/template-nodejs-prisma-postgres.md - Node.js + Prisma + PostgreSQL
- assets/go/template-go-fiber-gorm.md - Go + Fiber + GORM + PostgreSQL
- assets/rust/template-rust-axum-seaorm.md - Rust + Axum + SeaORM + PostgreSQL
- assets/python/template-python-fastapi-sqlalchemy.md - Python + FastAPI + SQLAlchemy + PostgreSQL
- assets/csharp/template-csharp-aspnet-efcore.md - C# + ASP.NET Core + Entity Framework Core + PostgreSQL
Related Skills
- ../software-architecture-design/SKILL.md - System decomposition, SLAs, and data flows
- ../software-security-appsec/SKILL.md - Authentication/authorization and secure API design
- ../ops-devops-platform/SKILL.md - CI/CD, infrastructure, and deployment safety
- ../qa-resilience/SKILL.md - Resilience, retries, and failure playbooks
- ../software-code-review/SKILL.md - Review checklists and standards for backend changes
- ../qa-testing-strategy/SKILL.md - Testing strategies, test pyramids, and coverage goals
- ../dev-api-design/SKILL.md - RESTful design, GraphQL, and API versioning patterns
- ../data-sql-optimization/SKILL.md - SQL optimization, indexing, and query tuning patterns
Freshness Protocol
When users ask version-sensitive recommendation questions, do a quick freshness check before asserting "best" choices or quoting versions.
Trigger Conditions
- "What's the best backend framework for [use case]?"
- "What should I use for [API design/auth/database]?"
- "What's the latest in Node.js/Go/Rust?"
- "Current best practices for [REST/GraphQL/tRPC]?"
- "Is [framework/runtime] still relevant in 2026?"
- "[Express] vs [Fastify] vs [Hono]?"
- "Best ORM for [database/use case]?"
How to Freshness-Check
- Start from
data/sources.json (official docs, release notes, support policies).
- Run a targeted web search for the specific component and open release notes/support policy pages.
- Prefer official sources over blogs for versions and support windows.
What to Report
- Current landscape: what is stable and widely used now
- Emerging trends: what is gaining traction (and why)
- Deprecated/declining: what is falling out of favor (and why)
- Recommendation: default choice + 1-2 alternatives, with trade-offs
Example Topics (verify with fresh search)
- Node.js LTS support window and major changes
- Bun vs Deno vs Node.js
- Hono, Elysia, and edge-first frameworks
- Drizzle vs Prisma for TypeScript
- tRPC and end-to-end type safety
- Edge computing and serverless patterns
- .NET 10 LTS (Nov 2025) and C# 14 adoption
- ASP.NET Core 10 built-in validation vs FluentValidation
- EF Core 10 vs Dapper for C# data access
- HybridCache vs manual IMemoryCache + IDistributedCache
Operational Playbooks
- references/operational-playbook.md - Full backend architecture patterns, checklists, TypeScript notes, and decision tables
Fact-Checking
- Use web search/web fetch to verify current external facts, versions, pricing, deadlines, regulations, or platform behavior before final answers.
- Prefer primary sources; report source links and dates for volatile information.
- If web access is unavailable, state the limitation and mark guidance as unverified.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: software-backend3description: Production-grade backend APIs for Node.js, Python, Go, Rust, and C# with PostgreSQL. Use when building REST/GraphQL/tRPC services or auth. Use when this capability is needed.4---56# Software Backend Engineering78Use this skill to design, implement, and review production-grade backend services: API boundaries, data layer, auth, caching, observability, error handling, testing, and deployment.910Defaults to bias toward: type-safe boundaries (validation at the edge), OpenTelemetry for observability, zero-trust assumptions, idempotency for retries, RFC 9457 errors, Postgres + pooling, structured logs, timeouts, and rate limiting.1112**Scaffolding rule**: When scaffolding a new project, show full working implementations for all domain logic — fraud rules, audit logging, webhook handlers, validation pipelines, background jobs. Don't just reference file names or stub functions; show the actual code so the user can run it immediately.1314---1516## Quick Reference1718| Task | Default Picks | Notes |19|------|---------------|-------|20| REST API | Fastify / Express / NestJS | Prefer typed boundaries + explicit timeouts |21| Edge API | Hono / platform-native handlers | Keep work stateless, CPU-light |22| Type-Safe API | tRPC | Prefer for TS monorepos and internal APIs |23| GraphQL API | Apollo Server / Pothos | Prefer for complex client-driven queries |24| Database | PostgreSQL | Use pooling + migrations + query budgets |25| ORM / Query Layer | Prisma / Drizzle / SQLAlchemy / GORM / SeaORM / EF Core | Prefer explicit transactions |26| Authentication | OIDC/OAuth + sessions/JWT | Prefer httpOnly cookies for browsers |27| Validation | Zod / Pydantic / validator libs | Validate at the boundary, not deep inside |28| Caching | Redis (or managed) | Use TTLs + invalidation strategy |29| Background Jobs | BullMQ / platform queues | Make jobs idempotent + retry-safe |30| Testing | Unit + integration + contract/E2E | Keep most tests below the UI layer |31| Observability | Structured logs + OpenTelemetry | Correlation IDs end-to-end |3233## Scope3435Use this skill to:3637- Design and implement REST/GraphQL/tRPC APIs38- Model data schemas and run safe migrations39- Implement authentication/authorization (OIDC/OAuth, sessions/JWT)40- Add validation, error handling, rate limiting, caching, and background jobs41- Ship production readiness (timeouts, observability, deploy/runbooks)4243## When NOT to Use This Skill4445Use a different skill when:4647- **Frontend-only concerns** -> See [software-frontend](../software-frontend/SKILL.md)48- **Infrastructure provisioning (Terraform, K8s manifests)** -> See [ops-devops-platform](../ops-devops-platform/SKILL.md)49- **API design patterns only (no implementation)** -> See [dev-api-design](../dev-api-design/SKILL.md)50- **SQL query optimization and indexing** -> See [data-sql-optimization](../data-sql-optimization/SKILL.md)51- **Security audits and threat modeling** -> See [software-security-appsec](../software-security-appsec/SKILL.md)52- **System architecture (beyond single service)** -> See [software-architecture-design](../software-architecture-design/SKILL.md)5354## Technology Selection5556Pick based on the strongest constraint, not feature lists:5758| Constraint | Default Pick | Why |59|-----------|-------------|-----|60| Team knows TypeScript only | Fastify/Hono + Prisma/Drizzle | Ecosystem depth, hiring ease |61| Need <50ms P95, CPU-bound work | Go (net/http + sqlc/pgx) | Goroutines isolate CPU work; no event-loop risk |62| Data-heavy / ML integration | Python (FastAPI + SQLAlchemy) | Best ecosystem for numpy/pandas/ML pipelines |63| Memory-safety critical | Rust (Axum + SeaORM/SQLx) | Zero-cost abstractions, no GC |64| Enterprise/.NET team | C# (ASP.NET Core + EF Core) | Azure integration, mature tooling |65| Edge/serverless | Hono / platform-native handlers | Stateless, CPU-light, fast cold starts |66| Fintech/audit-sensitive | Go + sqlc (or raw SQL) | ORM magic is a liability; you need auditable SQL |6768For detailed framework/ORM/auth/caching selection trees, see [references/edge-deployment-guide.md](references/edge-deployment-guide.md) and language-specific references.69See [assets/](assets/) for starter templates per language.7071---7273## API Design Patterns (Dec 2025)7475### Idempotency Patterns7677All mutating operations MUST support idempotency for retry safety.7879**Implementation:**8081```typescript82// Idempotency key header83const idempotencyKey = request.headers['idempotency-key'];84const cached = await redis.get(`idem:${idempotencyKey}`);85if (cached) return JSON.parse(cached);8687const result = await processOperation();88await redis.set(`idem:${idempotencyKey}`, JSON.stringify(result), 'EX', 86400);89return result;90```9192| Do | Avoid |93|----|-------|94| Store idempotency keys with TTL (24h typical) | Processing duplicate requests |95| Return cached response for duplicate keys | Different responses for same key |96| Use client-generated UUIDs | Server-generated keys |9798### Pagination Patterns99100| Pattern | Use When | Example |101|---------|----------|---------|102| Cursor-based | Large datasets, real-time data | `?cursor=abc123&limit=20` |103| Offset-based | Small datasets, random access | `?page=3&per_page=20` |104| Keyset | Sorted data, high performance | `?after_id=1000&limit=20` |105106**Prefer cursor-based pagination** for APIs with frequent inserts.107108### Error Response Standard (Problem Details)109110Use a consistent machine-readable error format (RFC 9457 Problem Details): https://www.rfc-editor.org/rfc/rfc9457111112```json113{114 "type": "https://example.com/problems/invalid-request",115 "title": "Invalid request",116 "status": 400,117 "detail": "email is required",118 "instance": "/v1/users"119}120```121122### Health Check Patterns123124```typescript125// Liveness: Is the process running?126app.get('/health/live', (req, res) => {127 res.status(200).json({ status: 'ok' });128});129130// Readiness: Can the service handle traffic?131app.get('/health/ready', async (req, res) => {132 const dbOk = await checkDatabase();133 const cacheOk = await checkRedis();134 if (dbOk && cacheOk) {135 res.status(200).json({ status: 'ready', db: 'ok', cache: 'ok' });136 } else {137 res.status(503).json({ status: 'not ready', db: dbOk, cache: cacheOk });138 }139});140```141142### Common Mistakes (Non-Obvious)143144| Avoid | Instead | Why |145|-------|---------|-----|146| N+1 queries | `include`/`select` or DataLoader | 10-100x perf hit; easy to miss in ORM code |147| No request timeouts | Timeouts on HTTP clients, DB, handlers | Hung deps cascade; see Production Hardening below |148| Missing connection pooling | Prisma pool / PgBouncer / pgx pool | Exhaustion under load on shared DB tiers |149| Catching errors silently | Log + rethrow or handle explicitly | Hidden failures, impossible to debug |150151---152153## Production Hardening: Patterns Models Skip154155These are the patterns that separate "works in dev" from "survives production." Models tend to skip them unless explicitly prompted — add them to every service.156157### Request & Query Timeouts158159Every outbound call needs a timeout. Without one, a hung dependency leaks connections and cascades failures.160161```typescript162// HTTP client timeout163const response = await fetch(url, { signal: AbortSignal.timeout(5000) });164165// Database query timeout (Prisma)166await prisma.$queryRaw`SET statement_timeout = '3000'`;167168// Express/Fastify request timeout169server.register(import('@fastify/timeout'), { timeout: 30000 });170```171172| Layer | Default Timeout | Rationale |173|-------|----------------|-----------|174| HTTP client calls | 5s | External APIs shouldn't block you |175| Database queries | 3s | Slow queries = missing index or bad plan |176| Request handler | 30s | Safety net for the whole request lifecycle |177| Background jobs | 5min | Jobs that run longer need chunking |178179### Field-Level Selection (Don't `SELECT *`)180181ORMs default to fetching all columns. On wide tables this wastes bandwidth and hides performance problems.182183```typescript184// BAD: fetches all 30 columns185const users = await prisma.user.findMany({ include: { posts: true } });186187// GOOD: fetch only what the endpoint needs188const users = await prisma.user.findMany({189 select: { id: true, name: true, email: true },190 include: { posts: { select: { id: true, title: true } } }191});192```193194For Go (sqlc): write explicit column lists in SQL queries — sqlc enforces this naturally.195For Python (SQLAlchemy): use `load_only()` or explicit column selection.196197### Structured Error Responses (RFC 9457)198199Return machine-readable errors from day one. Clients shouldn't have to regex-parse error messages.200201```json202{203 "type": "https://api.example.com/problems/validation-error",204 "title": "Validation failed",205 "status": 422,206 "detail": "email must be a valid email address",207 "instance": "/v1/users",208 "errors": [{ "field": "email", "message": "invalid format" }]209}210```211212Set `Content-Type: application/problem+json`. This format is a standard (RFC 9457) and parseable by any HTTP client.213214### Query Plan Verification215216Before shipping any new query to production, verify its execution plan:217218```sql219EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)220SELECT ... FROM ... WHERE ...;221```222223Red flags in the output: `Seq Scan` on large tables, `Nested Loop` with high row estimates, `Sort` without index. Add indexes or rewrite the query before deploying.224225---226227## Performance Debugging Workflow228229When a service is slow, work through these layers in order. Fix the cheapest layer first — don't add caching before fixing N+1 queries.230231| Step | What to Check | Fix |232|------|--------------|-----|233| 1. Query analysis | Enable query logging, find N+1s and slow queries | Rewrite with `include`/joins, add `select` for field-level optimization |234| 2. Indexing | Run `EXPLAIN ANALYZE` on slow queries | Add composite indexes matching WHERE + ORDER BY patterns |235| 3. Connection pooling | Check connection count vs. pool size | Configure pool limits (Prisma `connection_limit`, PgBouncer, pgx pool) |236| 4. Caching | Identify read-heavy, rarely-changing data | Add Redis/in-memory cache with TTL + invalidation strategy |237| 5. Timeouts | Check for missing timeouts on DB, HTTP, handlers | Add timeouts at every layer (see Production Hardening above) |238| 6. Platform tuning | Shared DB limits, cold starts, memory | Upgrade tier, add read replicas, tune runtime settings |239240**Key principle**: always measure before and after. Use structured logging with request IDs to trace specific slow requests end-to-end.241242---243244## Infrastructure Economics245246Backend architecture decisions directly impact cost and revenue. See [references/infrastructure-economics.md](references/infrastructure-economics.md) for detailed cost modeling, SLA-to-revenue mapping, unit economics checklists, and FinOps practices.247248---249250## Navigation251252**Resources**253- [references/backend-best-practices.md](references/backend-best-practices.md) - Template authoring guide, quality checklist, and shared utilities pointers254- [references/edge-deployment-guide.md](references/edge-deployment-guide.md) - Edge computing patterns, Cloudflare Workers vs Vercel Edge, tRPC, Hono, Bun255- [references/infrastructure-economics.md](references/infrastructure-economics.md) - Cost modeling, performance SLAs -> revenue, FinOps practices, cloud optimization256- [references/go-best-practices.md](references/go-best-practices.md) - Go idioms, concurrency, error handling, GORM usage, testing, profiling257- [references/rust-best-practices.md](references/rust-best-practices.md) - Ownership, async, Axum, SeaORM, error handling, testing258- [references/python-best-practices.md](references/python-best-practices.md) - FastAPI, SQLAlchemy, async patterns, validation, testing, performance259- [references/nodejs-best-practices.md](references/nodejs-best-practices.md) - Event loop, async patterns, Express/Fastify/NestJS/Hono, error handling, memory management, security, profiling260- [references/csharp-best-practices.md](references/csharp-best-practices.md) - C# 14 / .NET 10 LTS, extension members, field keyword, ASP.NET Core 10 (validation, SSE, OpenAPI 3.1), EF Core 10 (LeftJoin, named filters), HybridCache, Polly v8 resilience261- [references/database-patterns.md](references/database-patterns.md) - PostgreSQL patterns (JSONB, CTEs, partitioning), connection pooling, migration strategies, ORM comparison, index design262- [references/message-queues-background-jobs.md](references/message-queues-background-jobs.md) - BullMQ patterns, broker comparison (Redis/SQS/Kafka/RabbitMQ), idempotent jobs, DLQ, scheduling, delivery guarantees263- [data/sources.json](data/sources.json) - External references per language/runtime264- Shared checklists: [../software-clean-code-standard/assets/checklists/backend-api-review-checklist.md](../software-clean-code-standard/assets/checklists/backend-api-review-checklist.md), [../software-clean-code-standard/assets/checklists/secure-code-review-checklist.md](../software-clean-code-standard/assets/checklists/secure-code-review-checklist.md)265266**Shared Utilities** (Centralized patterns - extract, don't duplicate)267- [../software-clean-code-standard/utilities/auth-utilities.md](../software-clean-code-standard/utilities/auth-utilities.md) - Argon2id, jose JWT, OAuth 2.1/PKCE268- [../software-clean-code-standard/utilities/error-handling.md](../software-clean-code-standard/utilities/error-handling.md) - Effect Result types, correlation IDs269- [../software-clean-code-standard/utilities/config-validation.md](../software-clean-code-standard/utilities/config-validation.md) - Zod 3.24+, Valibot, secrets management270- [../software-clean-code-standard/utilities/resilience-utilities.md](../software-clean-code-standard/utilities/resilience-utilities.md) - p-retry v6, opossum v8, OTel spans271- [../software-clean-code-standard/utilities/logging-utilities.md](../software-clean-code-standard/utilities/logging-utilities.md) - pino v9 + OpenTelemetry integration272- [../software-clean-code-standard/utilities/testing-utilities.md](../software-clean-code-standard/utilities/testing-utilities.md) - Vitest, MSW v2, factories, fixtures273- [../software-clean-code-standard/utilities/observability-utilities.md](../software-clean-code-standard/utilities/observability-utilities.md) - OpenTelemetry SDK, tracing, metrics274- [../software-clean-code-standard/references/clean-code-standard.md](../software-clean-code-standard/references/clean-code-standard.md) - Canonical clean code rules (`CC-*`) for citation275276**Templates**277- [assets/nodejs/template-nodejs-prisma-postgres.md](assets/nodejs/template-nodejs-prisma-postgres.md) - Node.js + Prisma + PostgreSQL278- [assets/go/template-go-fiber-gorm.md](assets/go/template-go-fiber-gorm.md) - Go + Fiber + GORM + PostgreSQL279- [assets/rust/template-rust-axum-seaorm.md](assets/rust/template-rust-axum-seaorm.md) - Rust + Axum + SeaORM + PostgreSQL280- [assets/python/template-python-fastapi-sqlalchemy.md](assets/python/template-python-fastapi-sqlalchemy.md) - Python + FastAPI + SQLAlchemy + PostgreSQL281- [assets/csharp/template-csharp-aspnet-efcore.md](assets/csharp/template-csharp-aspnet-efcore.md) - C# + ASP.NET Core + Entity Framework Core + PostgreSQL282283**Related Skills**284- [../software-architecture-design/SKILL.md](../software-architecture-design/SKILL.md) - System decomposition, SLAs, and data flows285- [../software-security-appsec/SKILL.md](../software-security-appsec/SKILL.md) - Authentication/authorization and secure API design286- [../ops-devops-platform/SKILL.md](../ops-devops-platform/SKILL.md) - CI/CD, infrastructure, and deployment safety287- [../qa-resilience/SKILL.md](../qa-resilience/SKILL.md) - Resilience, retries, and failure playbooks288- [../software-code-review/SKILL.md](../software-code-review/SKILL.md) - Review checklists and standards for backend changes289- [../qa-testing-strategy/SKILL.md](../qa-testing-strategy/SKILL.md) - Testing strategies, test pyramids, and coverage goals290- [../dev-api-design/SKILL.md](../dev-api-design/SKILL.md) - RESTful design, GraphQL, and API versioning patterns291- [../data-sql-optimization/SKILL.md](../data-sql-optimization/SKILL.md) - SQL optimization, indexing, and query tuning patterns292293---294295## Freshness Protocol296297When users ask version-sensitive recommendation questions, do a quick freshness check before asserting "best" choices or quoting versions.298299### Trigger Conditions300301- "What's the best backend framework for [use case]?"302- "What should I use for [API design/auth/database]?"303- "What's the latest in Node.js/Go/Rust?"304- "Current best practices for [REST/GraphQL/tRPC]?"305- "Is [framework/runtime] still relevant in 2026?"306- "[Express] vs [Fastify] vs [Hono]?"307- "Best ORM for [database/use case]?"308309### How to Freshness-Check3103111. Start from `data/sources.json` (official docs, release notes, support policies).3122. Run a targeted web search for the specific component and open release notes/support policy pages.3133. Prefer official sources over blogs for versions and support windows.314315### What to Report316317- **Current landscape**: what is stable and widely used now318- **Emerging trends**: what is gaining traction (and why)319- **Deprecated/declining**: what is falling out of favor (and why)320- **Recommendation**: default choice + 1-2 alternatives, with trade-offs321322### Example Topics (verify with fresh search)323324- Node.js LTS support window and major changes325- Bun vs Deno vs Node.js326- Hono, Elysia, and edge-first frameworks327- Drizzle vs Prisma for TypeScript328- tRPC and end-to-end type safety329- Edge computing and serverless patterns330- .NET 10 LTS (Nov 2025) and C# 14 adoption331- ASP.NET Core 10 built-in validation vs FluentValidation332- EF Core 10 vs Dapper for C# data access333- HybridCache vs manual IMemoryCache + IDistributedCache334335---336337## Operational Playbooks338- [references/operational-playbook.md](references/operational-playbook.md) - Full backend architecture patterns, checklists, TypeScript notes, and decision tables339340## Fact-Checking341342- Use web search/web fetch to verify current external facts, versions, pricing, deadlines, regulations, or platform behavior before final answers.343- Prefer primary sources; report source links and dates for volatile information.344- If web access is unavailable, state the limitation and mark guidance as unverified.345346---347> Converted and distributed by [TomeVault](https://tomevault.io/claim/vasilyu1983) — claim your Tome and manage your conversions.348<!-- tomevault:4.0:skill_md:2026-04-11 -->