Tag: database

  • What Is a Schema — Why Databases and Your Brain Use the Same Word

    Summary — the conclusion first

    A schema is a frame that defines, in advance, what shape data should take. In databases it’s the table blueprint; in psychology it’s the structure of knowledge in your head.

    Sharing the word is no accident. Both rest on the same idea — the frame must exist first, so that new things have a place to land.

    In development, a schema blocks garbage data. In learning, a schema catches new knowledge.

    Think of a bank form

    A bank form has rules per field. Letters in the name field, eight digits for the birth date, signature required.

    That agreement — field types, formats, what’s required, decided up front — is a schema. It’s the frame, not the content. Whoever fills it in, the form stays the same.

    In development — a blueprint for data

    In dev, a schema declares “this data must have this shape.” The meaning holds everywhere it appears.

    Context What the schema defines
    DB schema which tables hold which columns (name, type, required)
    API schema which fields a request or response must carry
    Form/config schema what format an input must follow

    A schema’s power is that it filters at the door. Send “abc” into an age field and it’s rejected before it’s stored. Without a schema, bad data piles up quietly and detonates months later.

    In psychology — the frame of knowledge in your head

    In 1932, psychologist Frederic Bartlett ran a famous experiment. He had English students read an unfamiliar Native American folk tale, “The War of the Ghosts,” then retell it later.

    They couldn’t recall it as it was. They reshaped it to fit frames they already had. Unfamiliar canoes became familiar boats; a strange ritual became a hunt.

    That pre-existing frame of knowledge is psychology’s schema. We don’t store new information verbatim — we file it into existing frames. It’s like having a “restaurant schema”: you’ve never been to this place, yet you walk in, sit, order, pay, without a manual.

    Why the same word

    The root is the Greek skhēma (form, shape). The two fields picked the same word because they do the same job.

    DB schema Mental schema
    The frame tables, columns existing knowledge structure
    New data inserted as rows attached to existing frames
    When it doesn’t fit rejected (an error) quietly distorted or forgotten

    The last row is the scary one. A computer at least throws an error. The brain distorts or drops it silently. Bartlett’s students never noticed their memories had changed.

    In practice — for studying and for building

    The concept works on both sides of the desk.

    Studying: when something won’t stick, it’s often not your memory — it’s that there’s no frame to hang it on. Meet a new concept and first ask, “what do I already know that this resembles?” One analogy outlasts ten repetitions.

    Building: define the schema before accepting data. “Store it now, clean it later” almost always ends in a garbage pile. And changing a schema is surgery on everything stored on top of it — back up first.

    One line

    Schema = frame. The frame must exist first for new things to find their place — in a database, and in your head.

    Sources

    These are the experiments and terms cited above.

    • Frederic Bartlett, Remembering (1932) — “The War of the Ghosts,” the start of schema theory
    • Jean Piaget — children grow schemas through assimilation and accommodation
    • JSON Schema — a standard example of schemas in dev