Archtin
All articles
System DesignBackend EngineeringInfrastructure24 min read

Behind the Scenes: 11 Technologies You Use Every Day

A visual, in-depth tour of what happens inside database indexes, JWTs, CDNs, connection pools, garbage collectors, rate limiters, queues, B+ trees, DNS, TLS and load balancers.

Look beneath the name

Technology feels magical when its mechanism is hidden. A database “finds” a row, a server “trusts” a token, and HTTPS “secures” a request. Those labels are useful shorthand—but engineering begins when you can trace the data, identify the state, and name the failure boundary.

The five questions behind every system
What state exists? Where does it live? What path does a request take? What resource is bounded? What happens when one step is slow, stale or unavailable?

1. Database index: change the lookup path

With no usable index, the database may inspect every candidate row and evaluate the predicate. An index stores selected column values in a separate search-friendly structure, usually alongside row pointers. The engine navigates that smaller structure, finds matching identifiers, and fetches only the required table pages.

FULL TABLE SCAN1234567891011121314Up to 10M checksO(n) workINDEX LOOKUPQueryemail = ada@…Index rootchoose branchLeaf pagekey → row IDTable rowfetch recordDifferent structure, different work: a few page reads instead of checking every row.
An index is not a faster version of the same scan. It gives the query planner a different access path.

What happens on a real query

  • The optimizer estimates selectivity and chooses a table scan or index scan.
  • The engine traverses index pages from root to leaf.
  • A leaf entry yields the row locator—or all requested columns when the index covers the query.
  • Each insert, update and delete must also maintain relevant indexes.
Failure mode
An index can still be ignored when a query returns most rows, applies a function to the indexed column, uses a mismatched leading-column order, or has stale statistics.

2. JWT: verify claims without a session lookup

A JSON Web Token packages claims into a signed envelope. The client sends the token; the server recomputes or verifies its signature with a trusted key, then validates claims such as issuer, audience and expiry. No central session lookup is required for every request—but revocation becomes harder because a valid token can live until it expires.

Headeralg + token typePayloadsub, roles, exp — readableSignaturetamper evidenceJWTServer verificationsign(header.payload, key)Compare signaturesmatch → trusted claimsValidation gatesissuer · audience · expirySIGNATURE PROVESThe signed bytes were not changed and came from a key holder.SIGNATURE DOES NOT PROVEThat the payload is secret, current forever, or safe without claim checks.
JWT verification checks integrity and provenance. The payload remains readable unless separately encrypted.
base64url(header) + "." + base64url(payload) + "." + signature

payload = { "sub": "user-42", "aud": "orders-api", "exp": 1790000000 }
Conceptual structure—not a real token

Never trust a token merely because it can be decoded. Pin the expected algorithm, validate issuer and audience, enforce expiry, rotate keys safely, and keep access tokens short-lived. Do not place secrets in the payload.

3. CDN: move reusable bytes closer

A content delivery network places edge caches near users. A cache key—often host, path, query and selected headers—identifies an object. On a hit, the edge returns its copy. On a miss, it requests the origin, applies cache rules, stores the response, and serves it.

UserGET /hero.jpgNearest edgecache lookupOrigincanonical objectCACHE HITreturn immediatelyCACHE MISSfetch → store → serveCorrectness depends on cache keys, TTLs, invalidation, freshness rules and origin protection.
The fast path never reaches the origin; the miss path fills the cache for later requests.

The hard parts are freshness and identity

TTL controls how long an object stays fresh. Purges remove known stale objects; versioned filenames avoid invalidation altogether. A wrong cache key can mix user-specific responses, while no request coalescing can let thousands of simultaneous misses stampede the origin.

4. Connection pool: protect a finite database

Opening a database connection involves network setup, authentication and server memory. More importantly, the database can execute only finite work. A pool keeps a small set of established connections and lends them to requests. Once all are busy, callers wait rather than opening sockets without limit.

1,000 concurrent requestsWait queuebounded wait · acquire timeout · backpressureConnection pool20 reusable socketsDatabasefinite capacityHealthyshort wait → execute → releaseSaturatedqueue grows → latencyFailuretimeout → retries → more loadThe pool protects the database only when waiting, timeouts and retries are bounded.
The queue is part of the system. Its length and acquire time are early saturation signals.

Size the pool for database capacity, not incoming request count. Always release connections, set acquisition and query timeouts, keep transactions short, and avoid immediate retries after timeout. Otherwise waiting becomes timeout, timeout becomes retry, and retry becomes a cascading failure.

5. Garbage collection: reclaim unreachable memory

Managed runtimes track objects reachable from roots such as active stack frames and static fields. Objects that cannot be reached are eligible for reclamation. Generational collectors exploit the observation that most objects die young; compacting collectors also move survivors to reduce fragmentation.

Allocateobjects in young spaceReachabilitytrace from GC rootsReclaimunreachable memoryPromotelong-lived survivorsHEAP SNAPSHOTdeadlivelivedeadlivelivedeadlivelivedeadlivelivedeadliveliveCollector costCPU + memory traversal + coordinationthroughput collectors ↔ low-pause collectorsA pause is not “GC is broken.” It is one possible coordination cost; allocation rate and live-set size matter.
Reachability—not scope alone—decides what can be collected. Collector design trades pause time, throughput and memory overhead.

High allocation rate creates frequent collection work. A large live set makes tracing and compaction more expensive. Memory leaks still happen when code accidentally retains references: the collector correctly sees the objects as live. Useful signals include allocation rate, heap occupancy after collection, pause percent and promotion rate.

6. Rate limiter: meter admission before overload

A token bucket accumulates tokens at a fixed rate up to a capacity. Each request consumes one. Capacity permits a controlled burst; refill rate controls sustained traffic. With no token, the service rejects the request—usually with HTTP 429—or deliberately delays it.

Refill clock+10 tokens / secondToken bucket · capacity 5Requestconsume 1 → allowTokens availablebursts pass immediatelyNo tokenreject 429 or delayDistributed limitatomic shared counterChoose the identity carefully: user, API key, IP, route, tenant—or a composite key.
A token bucket separates burst allowance from long-term request rate.

A distributed limiter needs atomic shared state or carefully partitioned local limits. Decide what is being protected and who is being measured. Per-IP limits can punish users behind shared networks; per-user limits need authentication; per-tenant limits protect fairness. Return retry guidance and degrade safely if the limiter's store is unavailable.

7. Message queue: separate accepting work from doing work

A queue lets a producer durably hand off work without requiring the consumer to be available at that instant. The queue absorbs bursts, consumers pull at their own pace, and acknowledgements indicate completion. This improves temporal decoupling, but it does not make failure disappear.

Service AproducerDurable queuebuffer · ordering · acknowledgementsService BconsumerTemporarily downmessages remain queuedRetry / dead-letter pathdelay, cap attempts, inspect poison workDelivery can be repeated: consumers still need idempotency and explicit acknowledgement semantics.
Buffering turns a temporary consumer outage into queue depth rather than immediate producer failure—until capacity is exhausted.
  • At-least-once delivery: acknowledge after success; duplicates are possible.
  • Visibility timeout: unacknowledged work becomes available again.
  • Dead-letter queue: poison messages stop blocking healthy work after bounded retries.
  • Backpressure: queue age and depth reveal when consumers cannot keep up.

8. B+ tree: the shape behind many indexes

A B+ tree stores separator keys in internal pages and sorted key-to-row entries in leaf pages. Each page has high fan-out because it holds many keys. That keeps the tree shallow: a few page reads can narrow millions of records to one leaf.

[25 | 50 | 75]root page01 · 08 · 17sorted leaf page25 · 31 · 43sorted leaf page50 · 61 · 68sorted leaf page75 · 84 · 99sorted leaf pagePoint lookuproot → branch → one leafRange scanfind start → follow leavesWrite costsplit / merge / rebalanceReal pages hold hundreds of keys, so millions of rows often require only a few levels.
Point lookup descends the tree; range lookup descends once and then walks linked leaves in order.

Unlike a classroom binary tree, nodes are sized around storage pages and can have hundreds of children. Inserts may split full pages and propagate a separator upward. Deletes may merge or redistribute pages. This write amplification is the cost paid for predictable point and range reads.

OperationPathImportant cost
Exact lookuproot → internal pages → leaftree height + row fetch
Range scanfind first leaf → follow sibling leavesnumber of matching leaf pages
Insertfind leaf → write → possibly splitpage writes and rebalancing
Covering readanswer from leaf entryavoids table-row fetch

9. DNS: translate a name through delegated authority

DNS maps a domain name to records such as IP addresses. Resolution usually stops at a cache. On a miss, a recursive resolver walks the hierarchy: root servers point to the top-level-domain servers, which point to authoritative name servers, which return the requested record and its TTL.

Browsercache?OShosts + cacheRecursive resolverdoes the walkingRoot serverask .com servers.com TLDask domain NSAuthoritativeanswer: IP + TTLCache the answer for its TTLfuture lookups may stop at any earlier layerDNS returns where to connect; it does not fetch the website itself.
The recursive resolver follows referrals and caches the final answer; the client typically asks only the resolver.

Changes are not globally instant because independent caches retain earlier answers until TTL expiry. Multiple A/AAAA records can distribute clients, CNAME records create aliases, and DNSSEC can authenticate DNS data. DNS tells the client where to connect; TCP or QUIC and TLS happen afterward.

10. TLS: establish trust, then protect bytes

During a modern TLS handshake, client and server negotiate capabilities, exchange ephemeral key material, and derive shared session keys. The server presents a certificate whose signature chain connects its hostname to a trusted certificate authority. Finished messages prove both parties derived the same secret and observed the same handshake.

CLIENTSERVERClientHello · versions · random · key shareServerHello · certificate · key share · proofVerify certificate chain + hostnamethen derive matching symmetric session keysFinished · handshake integrity confirmedEncrypted HTTP response using session keysPublic-key cryptography establishes trust and keys; efficient symmetric encryption protects application data.
TLS uses asymmetric techniques for authentication and key agreement, then symmetric keys for efficient application traffic.

HTTPS is HTTP carried through this protected channel. TLS provides confidentiality, integrity and server authentication; it does not prove the application is honest or free of vulnerabilities. Certificate expiry, hostname mismatch, clock skew and incomplete chains are common operational failures.

11. Load balancer: choose an eligible backend

A load balancer accepts client connections and selects a backend using routing rules and current state. Round robin is only one policy. Real decisions can include health, active connections, response latency, weights, geography, session affinity and endpoint readiness.

10K requestsmany clientsLoad balancerchoose an eligible backendrules · health · loadweights · affinityServer Ahealthy · weight 2Server Bhealthy · least loadedServer Cunhealthy · removedhealth probesOverload controlsconnection limits · queues · retries · circuit breaking · graceful drainingDistribution is only half the job; continuously deciding who is safe to receive traffic is the other half.
A backend must be both matched by routing rules and currently eligible; failed health checks remove it from rotation.

Health checks need care: a shallow check may mark an instance healthy while its database dependency is dead; a deep check can remove every instance during one shared dependency outage. Graceful draining lets in-flight work finish during deployment. Load balancers themselves need redundancy and overload controls.

Connect the mechanisms

These mechanisms rarely operate alone. One page load can resolve DNS, negotiate TLS, reach a CDN, pass through a load balancer, verify a JWT, acquire a pooled connection, navigate a B+ tree, enqueue background work, and consume heap that a collector later reclaims.

MechanismState it managesBounded resourceFailure signal
Index / B+ treesorted keys and row locatorspages, write I/Oscan chosen, page splits, cache misses
JWTsigned claimstoken lifetimeinvalid signature or claims
CDNcached objectsedge storage, origin capacitymiss ratio, stale data
Connection poolleased connectionspool and DB capacitywait time, acquisition timeout
Garbage collectorreachable object graphheap and CPUpause time, allocation pressure
Rate limitertokens or countersadmission budget429 rate
Message queuedurable pending workretention and consumer throughputoldest-message age
DNScached delegated recordsTTL and resolver capacitylookup latency, stale answer
TLSidentity and session keyshandshake CPU and validitycertificate/handshake errors
Load balancerbackend eligibilityconnections and backend capacityhealth failures, queueing
A stronger engineering explanation
Do not stop at “what it is.” Trace one request, identify stored state, name the bounded resource, explain the trade-off, and describe the degraded path.

Continue with Tech You Know But Don't Really Understand, then practise applying these mechanisms in the free system quality fundamentals guide.

Keep reading

Suggested next articles based on this one.

Design it, don't just read it.

Practise LLD and system design problems with structured rubrics and AI feedback.

Start practising free