LESSON 03 / 11·2 min readIntermediate

When should I use pagination, streaming, compression or a CDN?

01 Understand02 Recall03 Prepare

Understand the concept

Pagination, streaming, compression and CDNs reduce different costs of moving data. Pagination returns fewer records, streaming avoids buffering the full payload, compression sends fewer bytes, and a CDN shortens the route for reusable content. Choosing the right technique requires knowing whether the problem is volume, memory, bandwidth or distance.

Important ideas

  • Pagination limits records; streaming limits memory used for large data transfers.

  • Compression reduces suitable payload sizes but costs CPU.

  • A CDN caches suitable content near users; private data needs careful cache rules.

  • Already compressed formats may gain little from more compression, while CPU cost can increase under load.

PAUSE & RECALL

Can you explain it without the notes?

When should I use pagination, streaming, compression or a CDN?

Use your own words. Explain an example and one limitation before checking the explanation.

Check your explanation

Pagination, streaming, compression and CDNs reduce different costs of moving data. Pagination returns fewer records, streaming avoids buffering the full payload, compression sends fewer bytes, and a CDN shortens the route for reusable content. Choosing the right technique requires knowing whether the problem is volume, memory, bandwidth or distance.

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

  • A stream can fix memory pressure without reducing total database work; describe which cost your change actually addresses.
Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: Authentication vs authorization vs RBAC?

Adapted from 08_PERFORMANCE_SECURITY.md · “When should I use pagination, streaming, compression or a CDN?”. Examples are study fragments; framework behavior can depend on your version.