Skip to content
tezvyn:
Menu

Schema-on-read in data lakes

Source: interviewEasyHow cards are made

Summary

understanding deferred schema application.

Key points

structure is applied at query time not ingest, enabling flexible raw storage and ML, but costing query-time validation and risking data swamps.

What's really being asked

This checks whether you understand that schema-on-read defers structure to query time, and can weigh its benefits against its real costs, rather than treating it as schemaless chaos.

The full answer

Schema-on-read means data is stored in its raw form and the schema, the interpretation of fields and types, is applied only when the data is read or queried. The same underlying file can be parsed under different schemas by different consumers. This is the defining trait of a data lake because lakes accept any format on cheap object storage and avoid forcing a model at ingest, the opposite of a warehouse's schema-on-write.

Advantages

Ingestion is fast and cheap because no transformation or validation is required up front. It is flexible: you can store data whose future use is unknown and decide later how to interpret it. It naturally supports semi-structured and unstructured data and exploratory machine learning where rigid schemas would be premature.

Disadvantages

Validation and parsing happen at query time, so every read pays a cost and bad data is discovered late rather than rejected on entry. Without governance, cataloging, and quality checks, the lake degrades into a data swamp where consumers cannot trust or find data. Query performance can suffer compared to a pre-modeled warehouse.

The mistakes people make

Saying schema-on-read means there is no schema; there is one, applied later. Claiming it is always superior to schema-on-write, ignoring validation and performance costs.

What usually comes next

How does a data catalog help. How do table formats like Iceberg add schema enforcement to lakes. When is schema-on-write better.

A concrete example

Raw JSON event logs land in S3 untouched. Months later, an analyst defines a table over them with a schema picking out user_id and event_type, and a data scientist reads the same files with a broader schema including nested device fields, each imposing structure at read time.

Interview question

What is the most accurate description of schema-on-read, and a key risk it introduces?

  • a.Data has no schema at all, which guarantees the fastest possible queries
  • b.Schema is applied at query time, which can let bad data accumulate undetected until readCorrect
  • c.Schema is fixed forever once data is written and can never be reinterpreted
  • d.Schema is enforced at ingest, which slows down data loading significantly
Why?

Schema-on-read defers structure to query time, so ingestion is flexible but validation is late and ungoverned data can become a swamp. It is not schemaless, and it does not enforce schema at ingest.

Just read this? Test yourself on what you have been reading.

Read the original → dremio.com

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

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