CodingNic

Databases and Persistence

Introduction to Databases

Databases and Persistence 8 min read

Introduction to Databases

Databases and Persistence

So far, your application works—but there’s a major problem.

It does not remember anything.

The Problem

Try this:

  • Open your app
  • Enter your name in the form
  • Submit it
  • Refresh the page

What happens?

Your data is gone.

Every time your app restarts, everything is lost.

Why This Happens

Right now, your app only processes data temporarily.

  • The user submits data
  • The app uses it
  • Then it disappears

There is no storage.

What We Need

Real applications need to:

  • Save user data
  • Store information permanently
  • Retrieve it later

This is where databases come in.

What is a Database?

A database is a system used to store data so it can be accessed later.

Instead of losing data, your app can:

  • Save it
  • Read it
  • Update it
  • Delete it

What You Will Learn

In this module, you will learn how to:

  • Store data using a database
  • Create and manage tables
  • Insert and retrieve data
  • Connect your Flask app to a database
  • Build real data-driven applications

How This Connects to Your App

You will upgrade your current project.

Right now:

  • Users enter a name → it disappears

After this module:

  • Users enter a name → it is saved
  • You can view all users
  • You can manage stored data

Outcome

By the end of this module, your application will:

  • Remember data
  • Store users
  • Work like a real backend system

Let’s start by understanding how data is organized inside a database.