---
title: "Buffer"
description: "A buffer is a memory area holding data temporarily while it moves between processes or devices of different speeds. See how buffering works in practice."
url: "https://nodea.io/en/glossary/buffer"
lang: "en"
updated: "2026-07-13"
---

# Buffer

> A buffer is a reserved area of memory that temporarily holds data in transit between two processes, devices or systems operating at different speeds.

A **buffer** is a reserved area of memory that temporarily holds data while it travels between two processes, devices or systems running at different speeds. It works like an airlock: the faster side deposits data without waiting, and the slower side drains it at its own pace. Buffering is one of computing's most universal mechanisms — it appears everywhere from disk controllers and network stacks to video players and web servers.

## How buffering works

Most buffers operate as FIFO queues — data leaves in the order it arrived. The pattern shows up in a few canonical places:

- **disk I/O** — operating systems collect small writes in memory and flush them as larger sequential blocks, which is dramatically faster, especially on spinning disks,
- **networking** — TCP maintains send and receive buffers on both ends; their sizing determines how much [bandwidth](https://nodea.io/en/glossary/bandwidth) a connection can actually use on high-latency links (the bandwidth-delay product),
- **media streaming** — players preload several seconds of audio or video so momentary throughput dips do not interrupt playback,
- **web servers** — Nginx buffers responses from upstream applications (PHP-FPM, proxied backends), freeing the application worker as soon as the response is generated rather than when the slowest client finishes downloading it.

A buffer is not a [cache](https://nodea.io/en/glossary/cache-and-microcaching): buffers smooth data *in transit* and are read once, while caches keep copies of data for *repeated* access.

## Practical use

Server administrators tune buffers constantly, often without naming them: kernel TCP buffer limits (*net.core.rmem\_max*/*wmem\_max*) govern long-distance transfer speed; Nginx's *proxy\_buffers* and *fastcgi\_buffers* decide whether a response stays in RAM or spills into a temp file; the InnoDB log buffer in MariaDB/MySQL shapes transaction throughput. In application code, output buffering (PHP's *ob\_start()*) lets a script assemble the whole response before any headers are sent.

Buffers also have a security dimension: mishandled bounds lead to buffer overflows, a classic vulnerability class where excess data overwrites adjacent memory and can hand an attacker code execution — the reason modern compilers ship protections like stack canaries and bounds checking.

### What is the difference between a buffer and a cache?

A buffer smooths a flow: data passes through it once, typically in FIFO order, to reconcile speed differences between producer and consumer. A cache stores copies of data expected to be requested again, to avoid recomputing or refetching it. Buffers serve throughput; caches serve repeated access.

## Related

- [Cache and microcaching](https://nodea.io/en/glossary/cache-and-microcaching)
- [Memcached](https://nodea.io/en/glossary/memcached)
- [Bandwidth](https://nodea.io/en/glossary/bandwidth)
- [Redis](https://nodea.io/en/glossary/redis)
- [OPcache](https://nodea.io/en/glossary/opcache)

---

Languages: [pl](https://nodea.pl/pl/slownik-pojec/bufor.md)  
Site index: [llms.txt](https://nodea.io/en/llms.txt)
