SSD as Storage Layer vs. SSD as Cache
SSDs can be integrated into a storage hierarchy in two fundamentally different ways:
- Storage layer: some relations (or partitions) are permanently stored on SSD, the rest on magnetic disk.
- Cache: all data lives on magnetic disk; the SSD transparently caches frequently accessed blocks, evicting cold blocks back to disk.
(a) You are building a system that must answer real-time queries with a guaranteed maximum response time. Which architecture do you choose, and why?
(b) You have a very large customer relation (hundreds of GB). Query logs show that a small, unpredictable subset of its blocks are hot at any given moment, while the rest are rarely touched. Which architecture works better here, and why?
(a) Real-time guaranteed latency β SSD as storage layer
When a strict response-time bound must be met, SSD as a storage layer is the right choice. The latency of any query touching an SSD-resident relation is bounded by SSD access times (tens of microseconds), which are predictable. With a cache architecture, a cache miss falls through to magnetic disk (5β10 ms seek + rotational latency), breaking the guarantee. You cannot control when a cache miss occurs, so worst-case latency is magnetic-disk latency β incompatible with real-time requirements.
(b) Large relation with unpredictable hot blocks β SSD as cache
Two problems make the storage-layer approach impractical here:
- The relation is too large to store entirely on SSD (cost prohibitive).
- The hot blocks shift over time and are unknown in advance, so there is no static partition to place on SSD β any fixed assignment will be wrong for future access patterns.
The SSD cache adapts automatically: recently accessed blocks are promoted to SSD regardless of which part of the relation they come from, and cold blocks are silently demoted to disk. This matches the workload dynamically without any manual data placement. The trade-off is that occasional cache misses incur magnetic-disk latency, which is acceptable here since no hard real-time bound is required.