In the modern enterprise, a silent crisis has been brewing beneath the surface of big data architecture. Companies like Spotify, which manage exabytes of user interaction data, have long operated under a bifurcated reality. To provide real-time, low-latency experiences—such as personalized homepage carousels or immediate AI agent responses—data must be ingested into high-performance, expensive Key-Value (KV) stores like Bigtable or DynamoDB. Meanwhile, the vast majority of historical data sits in "cold" cloud storage (GCS or S3) in formats like Parquet, accessible only through high-latency distributed SQL engines designed for batch processing.
This architectural schism creates a massive bottleneck. The storage layer itself is no longer the culprit; modern cloud storage now offers single-digit millisecond latency. The problem lies in the "middleman": distributed SQL engines that add seconds of overhead to perform a simple single-row lookup.
Enter Random Access Parquet (RAP), an innovative architectural pattern that promises to collapse this divide. By utilizing external indexing to map keys directly to file locations, RAP allows organizations to treat their massive data lakes as high-speed, interactive databases, potentially rendering the need for separate serving layers obsolete.
The Chronology of an Architectural Shift
For years, the industry accepted the "two-tier" data model as an immutable fact of life.
- The Batch Era: Data scientists and analysts relied on Hadoop and later cloud-native data lakes to process massive Parquet files using Spark, Hive, or Trino. These engines were optimized for throughput, not speed.
- The Serving Era: As "online" requirements grew, companies began "double-writing" or ETLing data into KV stores. This created a cost-heavy, complex synchronization nightmare where the same data existed in two places, often with different schemas or freshness guarantees.
- The Rise of AI Agents: The recent explosion of Large Language Models (LLMs) has forced a reckoning. To answer a question like, "What was I listening to last summer?", an AI agent needs the speed of a KV store but the historical depth of a data lake. Retrieving this from a batch-only engine is far too slow, and keeping years of granular history in a KV store is economically prohibitive.
RAP emerged as a response to this specific friction. By shifting the paradigm from scanning to direct looking up, engineers at scale are now rewriting the rules of data retrieval.
The Mechanics of the "Needle in the Haystack"
To understand why RAP is a breakthrough, one must first recognize the sheer complexity of fetching a single record from a data lake. If a user asks an AI agent about their listening habits from a specific summer, the query must sift through roughly 90,000 individual Parquet files.
The Conventional Struggle
Traditionally, engines attempt to prune this set using partitioning and Bloom filters. While effective, these techniques only narrow the scope of the files to be opened. Once a file is opened, the engine faces a "chain of dependent reads":
- Fetch the footer and parse metadata.
- Scan the key column.
- Locate row groups.
- Fetch the column pages.
Each step represents a round-trip to cloud storage, costing tens of milliseconds. Even with modern high-speed buckets, these dependent reads stack up, creating a "long tail" of latency that renders interactive applications sluggish.
The RAP Approach: Direct Addressing
RAP eliminates the scan entirely. It employs an external index—a precomputed, compact map that links a specific key (e.g., a user_id) to the exact file and row number where their data resides.
When a query is initiated:

- O(1) Lookup: The system queries the external index to identify the precise file and row offsets.
- Parallel Retrieval: Instead of a sequential chain of dependencies, the system issues parallel ranged requests to the cloud storage bucket to fetch only the necessary bytes.
- Direct Execution: The data is retrieved, and the application processes it immediately.
Optimizing for "Prepared" Parquet Files
While RAP works on existing, unmodified Parquet files, its true power is unlocked when data pipelines are optimized for this access pattern. This involves a fundamental shift in how we structure data files for both batch analytics and point lookups.
Concentration and Compactness
- One Page Per Key: By flushing Parquet pages at key boundaries, writers ensure that an entire page corresponds to a single key. This removes the need for complex internal parsing, as the entire retrieved page is the desired result.
- ZSTD Frame Resets: For files with large numbers of keys, resetting ZSTD compression frames at key boundaries allows the system to address specific data chunks without forcing a full file decompress, maintaining the integrity of standard Parquet files while enabling RAP-speed access.
- Storage Alignment: By using skippable frames to pad data to storage block boundaries (e.g., 4KB), RAP minimizes I/O amplification, ensuring that every byte read is productive.
Reducing Read Operations
The most significant performance gain comes from minimizing the number of distinct I/O operations.
- Blobs and Variants: By storing user-centric data as a single, combined "blob" or Parquet Variant, the system can fetch all required information in a single read.
- Interleaving Columns: For complex schemas, writers can interleave columns physically so that a single contiguous read pulls in all necessary fields for a user, effectively pivoting the data layout for high-speed retrieval without breaking compatibility with traditional analytical tools.
The Economic and Strategic Implications
The implications of the RAP pattern extend far beyond mere latency improvements; they fundamentally alter the economics of data infrastructure.
Eliminating the "Second Storage Bill"
The most compelling argument for RAP is the consolidation of infrastructure. Because the RAP-indexed files remain fully valid, standard Parquet files, they can still be read by existing batch tools (Trino, Spark, BigQuery). Organizations no longer need to pay for the storage and compute required to maintain a separate, synchronized KV store.
Democratizing Historical Access
In the current landscape, companies must prioritize what data is "online" based on cost. Usually, this means only the last 30–90 days of data make it into the high-performance store. With RAP, the cost of a point query is reduced to the cost of a standard cloud storage read. This allows AI agents and user-facing features to access years of historical data with the same ease as today’s data. Historical trends, long-tail entity data, and low-traffic features are no longer "too expensive" to serve.
Scalability and Secondary Indexing
RAP is inherently scalable. Because the index is essentially a key-value map, it can be distributed via hash-bucketing. Furthermore, RAP supports secondary indexing—allowing users to query the same data by different dimensions (e.g., buyer_id and seller_id) without needing to duplicate the underlying data. Adding or removing these indexes is an operational decision, not a data-migration project.
Conclusion: A Unified Future
The data lake was born out of the need to aggregate massive, disparate datasets for batch-based insights. For a decade, we have lived with the compromise that "big data" could not be "fast data."
RAP signals the end of this compromise. By introducing a smart, external indexing layer, it proves that the data lake is capable of supporting the most demanding online, interactive, and AI-driven workloads. For data architects, the message is clear: the divide between your analytics and your applications is narrowing. With the right indexing strategy, your raw data storage is no longer just a warehouse for reports—it is the living, breathing foundation for the next generation of interactive AI.
As organizations look to cut cloud costs and simplify their data stacks, the adoption of RAP represents a shift toward a more efficient, unified, and performant data architecture. The needle in the haystack is no longer hidden; it is simply waiting for the right index to be found.






