Relational
Tables with rows, columns and keys. An online shop with orders linked to customers.
A database is an organized collection of information that you can search and update. An online shop, for example, uses a database to remember who bought an item and where to send it.
Each row holds one record. A column holds one kind of information, such as the city for each customer.
| order_id | customer_id | Item |
|---|---|---|
| 501 | 101 | Notebook |
| 502 | 102 | Pen |
| 503 | 101 | Pencil |
| customer_id | Name | City |
|---|---|---|
| 101 | Maya | Boston |
| 102 | Luis | Austin |
| 103 | Noor | Seattle |
Each model organizes information differently. Choose based on the data and how the app needs to retrieve it.
Tables with rows, columns and keys. An online shop with orders linked to customers.
Records grouped as documents, often with nested fields. A product catalog where shoes have sizes and laptops have memory specs.
Each unique key retrieves a value. A session ID used to retrieve a shopper’s cart.
Nodes and edges represent things and their relationships. A travel app that traces connections between stations.
Numeric vectors can be searched for similarity. A help center that retrieves similar articles by meaning.
People often call relational systems like PostgreSQL “SQL databases.” NoSQL is an umbrella term for several other models, so features vary by product.
| Feature | SQL | NoSQL |
|---|---|---|
| Data model | Rows in related tables. | Depends on the system, such as documents, key-value pairs or graphs. |
| Queries | SQL supports filtering, aggregation and joins. | APIs and query languages depend on the system. Some offer SQL-like query syntax. |
| Good fit | Order records with consistent fields and relationships. | A catalog with different attributes for different product types. |
A spreadsheet is good for editing a small list, making a budget or charting numbers. Use a database when an app must enforce record rules, connect multiple collections and handle simultaneous updates reliably.
Try six questions and check your answers.
A database is an organized collection of information. An app can search, add or update that information using database software.
An online shop can store customers, products and orders in a database. An order can use a customer ID to connect to the right customer record.
A primary key identifies a row in its own table. A foreign key references a key in another table, or sometimes in the same table, and the database can enforce that the referenced row exists.
SQL is a language for working with data. PostgreSQL and SQLite are examples of database systems that use SQL.
Relational databases organize data into tables. Other models can organize information as documents, key-value pairs, graphs or vectors.
For more examples, see the PostgreSQL joins tutorial and MongoDB’s NoSQL overview.
Run the same data checks or reports every week? Explore Tornic to turn those steps into a repeatable workflow.