Indexing the Data Lake for Online Point Queries

· Source: Spotify Engineering · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Cloud Computing & IT Infrastructure, Software Development & Engineering · Depth: Advanced, long

Summary

Random Access Parquet (RAP) addresses the challenge of performing fast point queries on vast data lakes, a critical need for online services and AI agents at companies like Spotify. While cloud storage like GCS and S3 Express offers single-digit millisecond latency, traditional distributed SQL engines introduce seconds of overhead for single-row lookups. RAP bridges this gap by employing an external index that maps keys directly to file locations within existing Parquet files, enabling precise ranged reads. This allows petabytes of data in GCS data lakes to be queried interactively, avoiding the economic burden of moving exabytes into expensive key-value stores like Bigtable, and supporting use cases from user listening history to AI agent context retrieval.

Key takeaway

For MLOps Engineers or AI Architects building online services that require low-latency access to extensive historical data in cloud data lakes, you should evaluate Random Access Parquet (RAP). This approach allows you to perform fast point queries on exabyte-scale datasets without the prohibitive cost and complexity of duplicating data into traditional key-value stores. Implementing RAP can significantly expand the context window for AI agents and enable new interactive features directly from your data lake.

Key insights

Random Access Parquet enables fast point queries on data lakes by using an external index to eliminate scan bottlenecks.

Principles

Method

RAP builds an external index mapping keys to file and row numbers. It then uses cached file metadata and precise ranged reads to fetch data, issuing parallel reads to avoid dependent load chains.

In practice

Topics

Code references

Best for: CTO, VP of Engineering/Data, Director of AI/ML, Data Engineer, MLOps Engineer, AI Architect

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Spotify Engineering.