lifecycle
The sequence of stages something goes through from creation to removal, such as starting, running and stopping.
In more detail
Frameworks and platforms let you run code at each stage through hooks or signals. Knowing the lifecycle tells you where setup, cleanup and error handling belong.
Examples
A mutation lifecycle: onMutate, then onError or onSuccess, then onSettled.Next.js request lifecycle: middleware → route rendering (layouts, pages, Suspense boundaries) → streamed response.Related terms
- sub-resource — A resource addressed beneath another, such as /tasks/1/owner, usually to express a relationship.
- idempotency key — A unique value a client sends with a non-idempotent request, such as a create, so the server can recognise a retry and return the original result instead of acting twice.
- key rotation — Replacing a password or key with a new one on a schedule or after a suspected leak, and re-encrypting what it protected.
- mutation lifecycle callbacks — The functions TanStack Query calls at each stage of a mutation: onMutate before it is sent, onSuccess or onError after, and onSettled at the very end.
- graceful shutdown — Stopping a service in an orderly way: finish current work, close connections, then exit.
- Pod — The smallest unit Kubernetes runs: one or more containers scheduled together on the same machine.
- useEffect — The React hook for running side work, such as adding listeners or changing document.body, after a component renders.
- remount — Removing a component from the page and creating it again from scratch, which resets its state and re-runs its effects.
- request lifecycle — Everything that happens to one web request, from the connection arriving through reading, handling and responding to cleaning up.
- teardown — Removing or releasing everything that was set up for a piece of work, from a test's open connections to a whole temporary environment, once it is no longer needed.
Taught in
- Sub-resources And Relationships — Modern API Architecture: REST, GraphQL & gRPC
- Actions That Do Not Fit CRUD — Modern API Architecture: REST, GraphQL & gRPC
- Idempotency Keys — Modern API Architecture: REST, GraphQL & gRPC
- Scopes And Key Rotation — Modern API Architecture: REST, GraphQL & gRPC
- Optimistic UI Architecture: Cache & Rollback Protocols — Production Full-Stack Engineering
- Distributed Cache Invalidation: Redis & Tagged Purging — Production Full-Stack Engineering
- Health Probes & Graceful Shutdown: Kubernetes Lifecycles — Production Full-Stack Engineering
- Full-Stack System Verification: Capstone Integration — Production Full-Stack Engineering
- Client Components: use client & Hydration Models — Next.js 15 & Modern App Router Architecture
- Templates vs Layouts: Remounting & Page Transitions — Next.js 15 & Modern App Router Architecture
- Async Data Fetching: Parallel Requests & Preloading — Next.js 15 & Modern App Router Architecture
- Action State: useActionState & Optimistic Form UI — Next.js 15 & Modern App Router Architecture
- Session Management: Secure Cookies & Token Validation — Next.js 15 & Modern App Router Architecture
- Script Optimization: next/script & Lazy Third Parties — Next.js 15 & Modern App Router Architecture
- Native Module Systems: ESM Loader Hooks vs CommonJS — Node.js Internals & Backend Services
- Event Loop Lifecycle: The Six Phases & libuv uv_run — Node.js Internals & Backend Services
- Close Phase & Signal Dispatch: Sockets & Teardown — Node.js Internals & Backend Services
- Stream Mechanics: Readable Streams & Flowing Modes — Node.js Internals & Backend Services
- Stream Pipelines: pipeline, AbortSignal & Teardown — Node.js Internals & Backend Services
- Routing & Middleware: Path Parsing & Async Context — Node.js Internals & Backend Services
- Cluster Architecture: node:cluster & Zero-Downtime — Node.js Internals & Backend Services
- Production Hardening: Graceful Shutdown & Docker — Node.js Internals & Backend Services