What is Cursor vs Offset Pagination?
Two ways to page lists: offsets skip N rows but drift as data changes; cursors anchor to a stable row id. Feeds and chat histories need cursors, where new inserts must never shift or duplicate pages.
Example
Chat message history pages by cursor on message id; loading older messages never skips or repeats rows even while new messages arrive mid-scroll.
What people get wrong
Using OFFSET for live feeds. Inserts shift every page boundary, so users see duplicates and gaps; reserve offsets for stable admin exports.
Related terms
REST Resource Design
Modeling an API as nouns with stable URLs — /projects/:id/messages — instead of action endpoints. Resource design makes caching, auth scoping, and client reasoning predictable across every route.
OpenAPI Contract
A machine-readable spec describing every route, schema, and error so clients and tests generate from truth. BYOB treats the OpenAPI file as the API contract: code, docs, and mocks all derive from it.
Server Endpoint (+server.js)
The privileged layer for webhooks, secrets, and server-only logic. Anything touching keys, tokens, or private APIs lives here — never in components.
Idempotent HTTP Verbs
GET, PUT, and DELETE produce the same result when safely retried; POST does not promise that. BYOB server routes use idempotent verbs for mutations clients may repeat after network timeouts.
Retry, Backoff & Jitter
Retrying failed calls after growing delays with random spread, so a fleet does not stampede a recovering service. Exponential backoff plus jitter turns synchronized thundering herds into gentle background noise.
Dead-Letter Queue
A holding area for messages that exhausted every retry, preserved with full context for inspection. Dead letters stop poison events from blocking healthy traffic and give operators a deliberate replay path.