Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

6.12 (2 of 2): Lakes, warehouses and marts

The whole lesson, free. Read it and have a go at the activities. To work the tasks and labs in the real lesson, press Start lab, with no account needed.

45 minutes

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

Where do a million sales go?

A shop chain has 200 shops. Every till (the machine where you pay) sends a sale every few seconds. Cameras record video. Customers send emails.

By the end of the day there are millions of records. The files have many shapes. Where do they all go? And how does the marketing team find what it needs?

Key words

WordWhat it meansExample
Big dataData too large, fast or mixed for a normal spreadsheet.Millions of sales a day
Data lakeA store that keeps raw data in any format.Till logs, videos, emails
Data warehouseA store of cleaned data in one agreed shape, for reports.A table of all sales
Data martA small slice of a data warehouse for one team.Sales for marketing
DrawbackA bad point of something.A lake can become a mess
Raw dataData kept as it arrived.A till log
Cleaned dataData with mistakes and repeats removed, in one shape.A tidy table
Structured dataData in rows and columns with set types.A sales table
Unstructured dataData with no set rows and columns.A camera video

The cells students fill in are left blank in this preview.

How the data moves

flowchart LR
  tills[Tills] --> lake[(Data lake: raw)]
  cameras[Cameras] --> lake
  emails[Emails] --> lake
  lake -->|clean and organise| wh[(Data warehouse: cleaned)]
  wh --> m1[Data mart: marketing]
  wh --> m2[Data mart: finance]

Quick check: raw or cleaned?

Have a go

Quick check: raw or cleaned?

4 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

The data lake: keep everything

A data lake stores data as it arrives. Video, emails, logs and tables all go in. Nobody cleans it first.

It is cheap and flexible: it takes any kind of data. You can decide later what to do with the data. The drawback: a lake with no care becomes a mess. People cannot find or trust what is inside.

The data warehouse: clean and ready

A data warehouse holds cleaned data in one agreed shape. All sales sit in the same table with the same columns.

Reports run fast and give the same answer to everybody. The drawback: it takes time and skill to clean and load the data. It is also less flexible than a lake.

The data mart: a slice for one team

A data mart is a small part of a warehouse. It holds only what one team needs, such as marketing.

It is small, quick and simple to use. The drawback: the copies can stop matching. The finance team and the marketing team may see different numbers.

Match the store to its description

Have a go

Loading…

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The three stores side by side

StoreHoldsWho uses itBenefitDrawback
Data lakeRaw data of any kindData scientistsCheap and flexibleMessy. Hard to trust.
Data warehouseCleaned, structured dataAnalysts and managersFast, agreed answersCosts a lot to clean and load
Data martA slice of the warehouseOne teamSmall and quickCopies may differ

The cells students fill in are left blank in this preview.

Worked example: how much data?

StepWorkingAnswer
Sales in one shop in one dayGiven5000
Sales in 200 shops in one day200 x 5000 (200 times 5000)1,000,000
An easy way to do it2 x 5 = 10. Then add 5 zeros: 2 from 200 and 3 from 500010 and 5 zeros = 1,000,000
Sales in 200 shops in one year1,000,000 x 365 (1,000,000 times 365)365,000,000

The cells students fill in are left blank in this preview.

Try it: sort files into stores

Code: python
files = ["till_7.log", "clean_sales.csv", "mart_marketing.csv", "camera_3.mp4"]

for name in files:
    if name.find("clean_") == 0:      # find gives 0: the name starts with it
        print(name, "-> data warehouse")
    elif name.find("mart_") == 0:
        print(name, "-> data mart")
    else:
        print(name, "-> data lake")

# Add a file called clean_stock.csv to the list and run it again.

Make a free account to save your work and track your progress.

Your turn: sort the files

A shop chain names its files so you can tell where they belong. Raw files go in the data lake. Files starting with clean_ go in the data warehouse. Files starting with mart_ go in a data mart. Write three functions. Press Run Tests to check your work.

Code: python
def where_does_it_go(filename):
    # A shop chain keeps files in three places.
    #   "data lake"       raw files, as they arrive (for example till_7.log)
    #   "data warehouse"  cleaned files, whose names start with "clean_"
    #   "data mart"       a slice for one team, whose names start with "mart_"
    # Give back the name of the place for this file name.
    # Hint: filename.find("clean_") gives 0 when the name starts with clean_
    return ""


def sort_files(names):
    # Give back a dictionary with the three places as keys.
    # Each value is the list of file names that belong there, in the order given.
    return {}


def count_raw(names):
    # How many of the files are raw (they belong in the data lake)?
    return -1

Make a free account to save your work, or press Start lab to work through the whole lesson.

Key words crossword

Have a go

Loading…

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Final check

Have a go

Final check

5 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Remember

Tip

Lake: raw and flexible. Warehouse: cleaned and agreed. Mart: a slice for one team. Data usually moves from the lake to the warehouse to the marts.

Teach this lesson with your class

On a college account your students work the tasks and the labs as well, and every mark is kept for you.