The Lycoris Team · · 5 min read Thundering Herd Problem (Cache Stampede) Explained
The thundering herd problem hits when a cached value expires and every waiting request floods the backend at once. Here's why it happens and how to stop it.
Topic
70 posts tagged “Backend”.
The Lycoris Team · · 5 min read The thundering herd problem hits when a cached value expires and every waiting request floods the backend at once. Here's why it happens and how to stop it.
The Lycoris Team · · 4 min read The strangler fig pattern replaces a legacy system incrementally by routing traffic to new services piece by piece, until nothing old remains.
Takina · · 4 min read Content negotiation lets a client and server agree on a response's format, language, or encoding using Accept headers, before any body is sent.
Chisato · · 4 min read Protocol Buffers (protobuf) are a binary serialization format with strict schemas — smaller and faster to parse than JSON. How it works.
The Lycoris Team · · 5 min read PostgreSQL's built-in full-text search uses tsvector documents and tsquery queries matched with @@, indexed with GIN for speed at scale.
The Lycoris Team · · 4 min read HTTP methods signal intent — read, create, replace, update, or remove — and that intent determines caching, idempotency, and safety guarantees.
The Lycoris Team · · 4 min read Common table expressions and subqueries both let you build a query from smaller pieces, but they differ in readability, reuse, and optimizer behavior.
The Lycoris Team · · 5 min read A distributed lock coordinates exclusive access to a shared resource across multiple processes or machines, preventing race conditions in distributed systems.
The Lycoris Team · · 4 min read Natural keys use real-world data as a primary key; surrogate keys use a generated ID. Here's how to choose, with the trade-offs of each.
Chisato · · 5 min read Validation rejects bad input, sanitization removes the dangerous parts, and escaping neutralizes them for a specific output context. Most bugs mix these up.
The Lycoris Team · · 4 min read JSONB stores JSON in PostgreSQL as a parsed, indexable binary format instead of raw text. How it works, and when to reach for it.
Takina · · 4 min read Long polling holds an HTTP request open until new data arrives, faking real-time updates without a persistent connection. How it works and when to use it.
Takina · · 4 min read Node's Buffer class holds raw binary data outside the V8 heap, letting Node handle files, sockets, and streams efficiently. Here's how it works.
Chisato · · 4 min read MongoDB vs PostgreSQL compared: document vs relational modeling, schema flexibility, joins, and transactions — how to pick the right one.
Chisato · · 4 min read ACID guarantees strict consistency after every transaction; BASE trades that for availability and scale. How each model works and when to pick one.
Takina · · 4 min read tRPC lets TypeScript clients call server functions with full type inference and no schema or codegen step. How it works and where it fits.
Takina · · 4 min read Deno vs Node.js compared: security model, TypeScript support, module resolution, and when each runtime is the better choice.
The Lycoris Team · · 4 min read TCP guarantees ordered, reliable delivery via a handshake; UDP sends packets with no such guarantee but far less overhead. Where each one fits.
The Lycoris Team · · 5 min read Denormalization trades write-time consistency for read-time speed by duplicating data — the right call once joins become your bottleneck.
Chisato · · 4 min read Reverse ETL moves data out of the warehouse and into operational tools like a CRM, flipping the direction of a traditional ETL pipeline. How it works.
The Lycoris Team · · 4 min read Cache-aside puts the application in charge of loading cache misses; read-through delegates that job to the cache itself. How each pattern works.
The Lycoris Team · · 4 min read A database cursor is a pointer that lets you fetch a query's result set one row at a time instead of all at once. How cursors work and when to use them.
Chisato · · 4 min read Token bucket allows bursts up to a cap; leaky bucket smooths traffic to a constant rate. How each rate-limiting algorithm works and when to pick it.
The Lycoris Team · · 4 min read GROUP BY collapses rows into groups for aggregation; HAVING filters those groups afterward. How the two clauses differ and where each runs in query order.
Chisato · · 4 min read The bulkhead pattern isolates resources per dependency so one failing service can't exhaust the pools that healthy services depend on.
The Lycoris Team · · 5 min read A stored procedure is precompiled SQL saved inside the database and invoked by name, cutting network round trips and centralizing business logic.
Chisato · · 4 min read Event sourcing stores every state change as an immutable event instead of overwriting current state. How it works, and when CQRS pairs with it.
The Lycoris Team · · 5 min read Backpressure is how a slow consumer signals a fast producer to hold off, preventing memory exhaustion in streams, queues, and network protocols.
The Lycoris Team · · 5 min read A database trigger is a procedure that runs automatically on an insert, update, or delete — enforcing rules the application layer can't guarantee.
The Lycoris Team · · 5 min read Little's Law relates the number of requests in a system, their arrival rate, and how long each one takes — a simple formula for sizing capacity.
Takina · · 4 min read A backend-for-frontend (BFF) is a dedicated backend layer for one client type — shaping, aggregating, and simplifying calls to shared downstream APIs.
The Lycoris Team · · 4 min read URI paths, custom headers, and content negotiation are the three common ways to version an API. Tradeoffs of each, and how to avoid breaking clients.
The Lycoris Team · · 4 min read Dependency injection passes an object's dependencies in from outside rather than letting it construct them, making code easier to test and swap.
The Lycoris Team · · 4 min read A data warehouse stores structured, pre-modeled data optimized for queries; a data lake stores raw data of any shape. When each one fits.
The Lycoris Team · · 4 min read Primary keys identify a row, foreign keys link one table to another, and unique constraints just prevent duplicates. How the three differ in SQL.
Chisato · · 5 min read CQRS separates the code paths that change data from the code paths that read it. How it works, why teams adopt it, and when it's overkill.
The Lycoris Team · · 4 min read A database deadlock happens when two transactions each wait on a lock the other holds. Why deadlocks occur, how databases detect them, and how to avoid them.
The Lycoris Team · · 5 min read Write-through writes to cache and store together, write-back delays the store write, write-around skips the cache on writes entirely. When to use each.
The Lycoris Team · · 4 min read A dead letter queue holds messages a system couldn't process after repeated retries, isolating failures so they don't block or silently vanish. How it works.
The Lycoris Team · · 4 min read Star schema denormalizes dimensions into flat tables for fast queries; snowflake schema normalizes them to save space. How to choose for your warehouse.
Takina · · 4 min read HTTP status codes are three-digit responses that tell a client what happened to its request. A practical tour of the codes that actually matter.
The Lycoris Team · · 3 min read Kafka is a durable, replayable log built for high-throughput streams; RabbitMQ is a traditional broker built for flexible routing and task queues.
The Lycoris Team · · 4 min read Vacuuming reclaims space left by deleted and updated rows in databases like PostgreSQL, preventing bloat and transaction ID wraparound.
Chisato · · 4 min read A time-series database is optimized for timestamped data — metrics, sensor readings, prices. How it differs from general-purpose databases.
The Lycoris Team · · 4 min read MVCC lets readers and writers work on a database concurrently without blocking each other, by keeping multiple versions of each row instead of locking it.
The Lycoris Team · · 4 min read A query optimizer turns declarative SQL into an execution plan by estimating the cost of alternative strategies. How that estimation works and how to read a plan.
The Lycoris Team · · 5 min read A foreign key constraint ties a column to a row in another table and blocks changes that would break that link. How referential integrity works in SQL.
The Lycoris Team · · 5 min read SQLite is a serverless, file-based SQL database compiled directly into an application. How it works, why it's everywhere, and when to reach for it.
The Lycoris Team · · 5 min read A read replica is a synced copy of a database that serves read queries, taking load off the primary. How replication lag and failover actually work.
The Lycoris Team · · 4 min read Partitioning splits a table within one database; sharding splits data across separate database instances entirely. Here's how each works and when to use them.
The Lycoris Team · · 5 min read A graph database stores data as nodes and relationships instead of tables, making deeply connected queries fast instead of a chain of costly joins.
Chisato · · 4 min read gRPC uses binary Protocol Buffers over HTTP/2 for fast, typed service calls; REST uses JSON over HTTP for accessible, resource-based APIs. How to pick.
The Lycoris Team · · 4 min read A CTE is a named, temporary result set defined with WITH that you can reference elsewhere in a SQL query. How they work and when to use one.
The Lycoris Team · · 4 min read Optimistic locking checks for conflicts at write time; pessimistic locking blocks other writers up front. How each works and when to pick one.
The Lycoris Team · · 5 min read A SQL join combines rows from two tables based on a related column. How inner, left, right, and full outer joins differ, with examples.
Chisato · · 4 min read Horizontal scaling adds more machines; vertical scaling adds more power to one machine. How each works, their limits, and when to use which.
Chisato · · 4 min read ETL transforms data before loading it into a warehouse; ELT loads raw data first and transforms it inside the destination. How the two approaches differ.
The Lycoris Team · · 4 min read A data lakehouse combines a data lake's cheap object storage with a data warehouse's transactional guarantees and schema. How the architecture works.
The Lycoris Team · · 4 min read Write-ahead logging records changes to a log before applying them to a database, making crash recovery and replication possible. Here's how it works.
The Lycoris Team · · 4 min read Row-oriented databases store each record together on disk; columnar databases store each column together. The layout decides which workloads are fast.
The Lycoris Team · · 4 min read Isolation levels control how much of a concurrent transaction's uncommitted work another transaction can see, trading consistency for concurrency.
The Lycoris Team · · 4 min read Change data capture streams row-level inserts, updates, and deletes out of a database in real time, powering sync pipelines, caches, and event-driven systems.
The Lycoris Team · · 5 min read Connection pooling reuses a fixed set of open database connections instead of opening a new one per request. How pools work and why they prevent overload.
The Lycoris Team · · 4 min read OLTP systems handle many small, fast transactions like orders and logins; OLAP systems run large analytical queries across historical data for reporting.
Chisato · · 4 min read SQL window functions compute values across a set of rows without collapsing them, unlike GROUP BY. How OVER, PARTITION BY, and ranking work.
Takina · · 4 min read REST exposes fixed endpoints per resource; GraphQL lets clients query exactly the fields they need through one endpoint. How to choose between them.
The Lycoris Team · · 4 min read ACID — atomicity, consistency, isolation, durability — defines the guarantees a database transaction makes so concurrent, failure-prone operations stay correct.
Chisato · · 4 min read A message queue holds tasks between producers and consumers so work happens asynchronously and reliably. How queues work and when to use one.
The Lycoris Team · · 4 min read Database normalization organizes tables to eliminate redundant data and update anomalies. The normal forms explained with a worked example.
The Lycoris Team · · 5 min read Database sharding splits one dataset across many servers so no single machine holds it all. How sharding works, how to pick a shard key, and the trade-offs.