# Data lake

> Cheap storage where all your data is kept as raw files, to be sorted out later.

- Level: Intermediate
- Topics: Data, Cloud
- URL: https://tidbit.legios.com.ar/data-lake/
- In Spanish: [Data lake](https://tidbit.legios.com.ar/es/data-lake/)

A **data lake** is a big, cheap store where an organization keeps all its data as files, in whatever shape it arrives: app logs, CSV exports, JSON events, images, sensor readings. Nothing has to be modeled before it lands. On AWS it is usually Amazon S3 with a folder layout and some rules; the structure is applied later, when someone reads the data.

That is the key difference with a data warehouse. A warehouse asks you to clean and model data before loading it (**schema on write**); a lake accepts everything and lets each reader decide how to interpret it (**schema on read**). Query engines like Amazon Athena or Spark read the files where they are, and a **catalog** records what each folder contains so people can find it.

Lakes are popular because storage is cheap and nothing gets thrown away: tomorrow's question, or tomorrow's machine learning model, may need data nobody thought was useful today. The risk is the **data swamp**: years of undocumented, duplicated or half-broken files that nobody trusts. Many teams now combine both ideas in a **lakehouse**: files in the lake, stored in formats like Parquet, with a table layer on top that adds warehouse-style guarantees.

## An analogy

A huge storage unit where everything goes in its original box. It is cheap and nothing is lost, but if nobody labels the boxes, finding last year's tax papers becomes an expedition.

## Keep in mind

- Stores raw files of any type; structure is applied when the data is read.
- Usually built on object storage like Amazon S3, which is cheap and practically unlimited.
- Without a catalog and some discipline, it turns into a data swamp.
- Lakes and warehouses complement each other; a lakehouse mixes both.

## Go deeper

- [What is a data lake? (AWS)](https://aws.amazon.com/what-is/data-lake/)
- [Data lake on Wikipedia](https://en.wikipedia.org/wiki/Data_lake)

## Related terms

- [CSV](https://tidbit.legios.com.ar/csv/): A plain text file that holds a table: one row per line, commas between values.
- [JSON](https://tidbit.legios.com.ar/json/): The plain-text format programs use to hand each other structured data.
- [Amazon S3](https://tidbit.legios.com.ar/amazon-s3/): A giant online drawer for files, rented by the gigabyte.
- [Data warehouse](https://tidbit.legios.com.ar/data-warehouse/): A database built for analysis: years of history, from many sources, in one place.
- [Database schema](https://tidbit.legios.com.ar/database-schema/): The blueprint of a database: which tables exist, their columns and how they connect.
- [Amazon Athena](https://tidbit.legios.com.ar/amazon-athena/): Run SQL directly on files sitting in S3, with no database to set up.
- [Apache Spark](https://tidbit.legios.com.ar/apache-spark/): An open source engine that splits work on huge datasets across many machines.
- [Machine learning](https://tidbit.legios.com.ar/machine-learning/): Teaching computers by showing them examples instead of writing every rule.
