Intermediate concepts in Backend Dev, page 10

Downsampling: Trading Precision for Storage in Time Series Data
Downsampling trades precision for storage in aging time series data. It's like summarizing old notes: you keep key trends but discard granular details. This is vital for observability systems that need recent precision but only coarse historical views.
Rust Mocking: Using Traits as Test Seams
Mocking in Rust uses traits as test doubles. You program a mock's behavior—what calls to expect and what to return—to isolate the code under test. The mockall crate's #[automock] macro generates mocks from traits. The footgun is over-specifying behavior.
Semantic Search: Finding Meaning, Not Just Keywords
Semantic search finds meaning, not just keywords. It's like asking a librarian for 'books about space travel' and getting results for 'astronaut biographies,' not just titles with the exact words. It's used in search engines to find conceptually related items.
Optimizer Hints: Backseat Driving Your Database
An optimizer hint lets you override the database's query plan, like telling a GPS which street to take. Use it as a last resort when you know more than the optimizer, but beware: hints can become performance traps when data or schemas change.

Buffer Manager: The Database's Memory Gatekeeper
The buffer manager acts as a database's private RAM cache, deciding which data pages to keep in memory versus fetching from slow disk. It's central to query performance, as it tries to serve all data requests from this fast cache.

Socket.IO: Broadcasting Events to Clients
Broadcasting sends a server-side event to multiple clients at once, like a public announcement system. Use it for live notifications or game state updates. The footgun: by default, it only reaches clients on the same server; use an adapter for multi-server…
Go Reflection: Inspecting Types at Runtime
Go's reflect package lets your program inspect and manipulate variables of unknown types at runtime. This is the engine behind JSON marshaling and generic frameworks. Misuse leads to slow code and runtime panics; always prefer interfaces when possible.
Single-Leader Replication: One Node to Rule Them All
Think of a single source of truth. One 'leader' server takes all writes, while 'follower' servers handle read traffic. This is the default for many databases like PostgreSQL and MongoDB to scale reads.

Socket.IO Rooms: Broadcasting to Subsets of Clients
Think of Socket.IO Rooms as server-side channels for grouping clients. They let you broadcast messages to a specific subset, like a private chat or users following a topic. Remember rooms are a server-only concept; a client can't see which rooms it has joined.
Rust Declarative Macros (`macro_rules!`)
Think of macro_rules! as 'find and replace' for your code's structure. It matches patterns at compile time and expands them into boilerplate you don't want to write. It's used for helpers like vec![].

Multi-Leader Replication: Enabling Writes Across Datacenters
Multi-leader replication allows multiple nodes to accept writes, avoiding a single-leader bottleneck. It's used in multi-datacenter systems for low-latency local writes and in offline apps. The main footgun is resolving write conflicts from concurrent updates.
From Dev Server to Production: Running FastAPI with Workers
Your dev server is a single process. For production, you need a process manager to run multiple Uvicorn worker processes, handling concurrent requests and providing fault tolerance.
Socket.IO Middleware: Your Connection Gatekeeper
Socket.IO middleware is a gatekeeper for new connections, running before a client is fully connected. It's ideal for authentication, rate limiting, or logging. The key footgun: you must always call next(), or the connection will hang until it times out.
Rust's `unsafe` Keyword: Five Superpowers, Zero Guarantees
Rust's unsafe keyword lets you bypass certain compile-time memory safety guarantees for low-level tasks like OS interaction or FFI. The footgun is thinking it disables all safety; it only enables five specific 'superpowers,' making you responsible for…

Hash-Based Aggregation: Grouping Data Without Sorting
Hash-based aggregation uses a hash table to group data for functions like COUNT or SUM, avoiding a costly sort. It's used in database query engines for GROUP BY operations, especially when distinct groups fit in memory.
Rust Raw Pointers: When References Aren't Enough
Raw pointers (*const T, *mut T) are Rust's C-style pointers, bypassing the borrow checker. They're used for FFI or building low-level abstractions. The footgun is assuming they're safe; they can be null or dangling, requiring unsafe to dereference.
Vectorized Query Execution: Processing Batches, Not Rows
Vectorized execution processes data in batches of thousands of rows, not one at a time. This lets analytical databases like ClickHouse and Snowflake scan billions of rows in seconds by keeping data in CPU cache and using SIMD instructions.
The 'ws' Library: WebSockets for Node.js Servers
The ws library is the standard for adding WebSocket servers to Node.js for real-time features like chat or live data feeds. It provides both server and client APIs for backend-to-backend communication.
Go's `unsafe` Package: Breaking the Rules for Performance
Go's unsafe package lets you bypass type safety, treating memory like C with raw pointers for performance gains. It's used for low-level optimizations and C interoperability. The footgun: its behavior isn't guaranteed across Go versions, making code fragile.
Synchronous vs. Asynchronous Replication: A Trade-off
Replication is a trade-off: synchronous waits for all copies to confirm a write, guaranteeing consistency but risking availability. Asynchronous lets the primary move on immediately, prioritizing speed.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles