Learning / Web Basics / Chapter 2

Databases

Where applications keep their data and how you ask for it

What a database is, SQL vs. NoSQL, PostgreSQL, Redis & co., how indexes and transactions work, and your first SQL query, step by step.

Beginner · 11 slides · 11 min

  1. What is a database?

    A database is the program that keeps an application’s data safe and finds any piece of it again in milliseconds.

  2. Tables, rows and columns

    Relational databases store data in tables. Columns are properties, rows are records, and tables are linked by relations.

  3. SQL and NoSQL

    SQL databases split data into tables with a fixed structure. NoSQL databases store it in flexible shapes like documents or key-value pairs.

  4. The differences at a glance

    Structure, relations, consistency, scaling and query language: how SQL and NoSQL databases differ.

  5. Databases you will meet

    PostgreSQL, MySQL, SQLite, MongoDB, Redis and the enterprise classics, and what each one is good at.

  6. How a database finds data so fast

    Without an index a database checks row after row. With an index it jumps to the right row in a handful of steps.

  7. Transactions: all or nothing

    A transaction groups changes so that either all of them are saved or none. No money gets lost in a crash.

  8. Your first query

    SELECT, FROM, WHERE, ORDER BY: the four words that answer most questions you will ever ask a database.

  9. Try it yourself

    Run real SQL queries against a small customer table and see the results instantly.

  10. Check yourself

    Which database fits fast, short-lived session data?

  11. Recap

    Tables or documents, indexes, transactions and SQL: the database basics in five sentences.