💡beginner
What Are Databases? — Where Apps Store Everything
Learn what databases are, why every app needs one, and how they organize information — explained simply for beginners.
The World's Biggest Notebook
Imagine Instagram without the ability to save anything. Every time you close the app, all your photos, followers, and messages vanish. That would be useless!
A database is where apps permanently store information. Think of it as a super-organized, super-fast digital notebook that can hold billions of pieces of information and find any specific piece in milliseconds.
Every app you use has a database (often many databases): Instagram stores photos and followers, Netflix stores movies and your watch history, Lumora stores your projects and progress. Without databases, the internet wouldn't exist as we know it.
Tables — Like Spreadsheets
The most common type of database organizes data in tables — think of them like Excel spreadsheets.
Imagine a 'students' table:
| id | name | age | grade | email |
|----|---------|-----|-------|--------------------|
| 1 | Aarav | 12 | 7th | aarav@example.com |
| 2 | Priya | 14 | 9th | priya@example.com |
| 3 | Zain | 11 | 6th | zain@example.com |
Each row is one student (one 'record'). Each column is a piece of information about them (a 'field'). The 'id' column gives each student a unique number so they can never be confused with someone else — even if two students have the same name!
Relationships — Connecting Tables
Real apps need many tables that connect to each other. For example, Lumora might have:
• A 'users' table — one row per student
• A 'projects' table — one row per project template
• A 'user_projects' table — tracks which student started which project
The user_projects table connects users and projects by storing the user's id AND the project's id. This way, we can ask questions like 'what projects has Aarav started?' or 'how many students completed the Calculator project?'
This connection between tables is called a 'relationship' — and databases that use relationships are called 'relational databases'. SQL (Structured Query Language) is the language used to talk to them.
Talking to a Database with SQL
sql
-- SQL = the language databases understand
-- Get all students
SELECT * FROM students;
-- Find students older than 12
SELECT name, age FROM students WHERE age > 12;
-- Add a new student
INSERT INTO students (name, age, grade, email)
VALUES ('Meera', 13, '8th', 'meera@example.com');
-- Update a student's grade
UPDATE students SET grade = '8th' WHERE name = 'Aarav';
-- Count students by grade
SELECT grade, COUNT(*) as total
FROM students GROUP BY grade;Types of Databases
Not all databases use tables! Different shapes of data need different types of databases:
• SQL/Relational — Tables with rows and columns. Great for structured data. Examples: PostgreSQL, MySQL. Lumora uses PostgreSQL via Supabase!
• NoSQL/Document — Stores data as flexible 'documents' (like JSON files). Great when data structure varies. Examples: MongoDB, Firebase.
• Key-Value — Simple: every piece of data has a unique key. Super fast for lookups. Examples: Redis. Used for caching and sessions.
Most apps use a combination of these depending on what they need!
Pro Tip
You don't need to set up a database from scratch anymore. Services like Supabase, Firebase, and PlanetScale give you a ready-to-use database in minutes. They handle all the hard stuff (backups, security, scaling) so you can focus on building your app.
Think About It
Design a database for a library app! What tables would you need? Think about: books (title, author, genre, year), members (name, age, email), and borrowed_books (which member borrowed which book and when). Draw out the tables on paper and think about how they connect to each other.
Ready to build?
Put what you learned into practice — pick a project and start coding.
Start Building Free