What is a Database? (DBMS vs RDBMS)
Clarify databases, DBMS vs RDBMS, and why relational systems dominate transactional apps.
In plain words
A database is where an app keeps its data. A DBMS is the program that looks after it. An RDBMS keeps the data in tables that point to each other.
Think of it like…
A DBMS is a librarian who looks after a collection of documents for you. An RDBMS is a librarian who insists everything is filed on standard index cards in labelled drawers with cross-references, so any question can be answered by combining drawers, and nothing gets filed half-finished.
Where you’ve seen it
An online shop keeps customers, orders and payments in PostgreSQL (an RDBMS) because money must never be half-recorded, and caches product pages in Redis (a key-value DBMS) because it needs very fast lookups by key and can rebuild the cache if it's lost.
Words you’ll hear
- DBMS
- Software that stores, retrieves and manages data: relational or not.
- RDBMS
- A DBMS using tables, keys, SQL, constraints and transactions.
- Schema
- The defined structure of the data: tables, columns, types and relationships.
- NoSQL
- Non-relational DBMSs: document, key-value, wide-column and graph stores.
Visual diagram
Theory & example queries
DBMS vs RDBMS
Any DBMS stores data persistently and handles concurrent access. An RDBMS adds the relational model: data in tables with a fixed schema, relationships expressed through primary and foreign keys, and a declarative query language (SQL) that can combine tables with joins.
It also enforces integrity with constraints (NOT NULL, UNIQUE, FOREIGN KEY, CHECK) and groups changes into ACID transactions. That's why relational databases dominate systems where correctness matters: banking, orders, bookings and inventory.
| id | name | city | |
|---|---|---|---|
| 1 | Maya | maya@example.com | Pune |
| 2 | Ravi | ravi@example.com | Delhi |
| 3 | Noor | noor@example.com | Mumbai |
| id | customer_id | status | amount | coupon_code |
|---|---|---|---|---|
| 101 | 1 | paid | 249 | NULL |
| 102 | 2 | paid | 120 | WELCOME10 |
| 103 | 1 | shipped | 89.5 | NULL |
SELECT c.name, SUM(o.amount)FROM customers c JOIN orders o ON o.customer_id = c.idGROUP BY c.name;PostgreSQL is the lesson baseline unless noted otherwise.
Calculate the selected expressions and return the requested output columns.
Customer revenue totals3 sample rows
| name | sum |
|---|---|
| Asha Rao | 4250 |
| Kabir Shah | 3120 |
| Mei Chen | 2890 |
Note: Illustrative customer and order rows; SUM reflects the joined orders for each customer.
One question answered across two related tables.
Key takeaway: Every RDBMS is a DBMS; RDBMSs add tables, keys, SQL, constraints and transactions.
Relational or NoSQL?
Choose a relational database by default when data has clear relationships, needs to stay consistent, and will be queried in ways you can't fully predict. Modern RDBMSs also handle JSON columns and scale further than most applications need.
Non-relational stores fit specific access patterns: key-value stores for caching and sessions, document stores for self-contained records with varying fields, wide-column stores for enormous write-heavy datasets accessed by key, and graph databases for relationship-heavy queries. The lines have blurred, since MongoDB supports multi-document transactions and PostgreSQL stores JSON, so decide by access pattern rather than by label.
Orders, payments and stock → PostgreSQL. Session tokens and rate-limit counters → Redis. Billions of sensor readings looked up by device and time → a wide-column or time-series store.
How it works, step by step
Follow one practical SQL workflow from start to finish. Select any step or play through the flow.
Model the data
Identify the entities (customers, orders, products) and how they relate. Clear relationships point towards a relational design.
customer 1 - many orders
When to use it & trade-offs
What it is
A database is an organised, persistent collection of data. A DBMS (database management system) is the software that stores it and lets you query and change it safely: PostgreSQL, MySQL, MongoDB and Redis are all DBMSs. An RDBMS is a DBMS built on the relational model: data lives in tables with rows and columns, linked by keys, queried with SQL, and protected by constraints and transactions.
Why it matters: "What's the difference between a DBMS and an RDBMS?" and "SQL or NoSQL?" are among the most common opening questions in fresher and backend interviews. More practically, the choice decides how your data stays consistent, how you query it and how it scales.
When to reach for it
- Relational databases for transactional business data
- Key-value stores for caches and sessions alongside a relational database
- Document stores when records are self-contained and vary a lot
When to avoid or be careful
- Choosing NoSQL only to avoid designing a schema
- Storing money and orders in a cache-style store without transactions
- Treating "SQL vs NoSQL" as a question with one right answer for everything
Relational vs document vs key-value
Strengths: Joins, constraints, ACID transactions, flexible queries.
Watch out: Schema changes need migrations; scaling writes across many servers takes more work.
Strengths: Flexible schema; a whole record read in one go.
Watch out: Cross-document queries and integrity are harder.
Strengths: Extremely fast and simple to scale.
Watch out: Little or no querying beyond the key.
Interview signals & numbers to know
When this topic comes up
- “What is a DBMS?”
- “DBMS vs RDBMS”
- “SQL or NoSQL for this system?”
- System design storage choices
- Fresher interview basics
Benchmarks & rules of thumb
- 4
- main NoSQL families: document, key-value, wide-column, graph
- ACID
- transaction guarantees of an RDBMS
- 1970
- year Codd published the relational model
Common mistakes & follow-ups
Common interview mistakes
- Saying an RDBMS is just "a database with tables" without mentioning keys, constraints and transactions.
- Claiming NoSQL databases can never do transactions or joins; many now offer both in limited forms.
- Picking a database by popularity instead of by how the data will be read and written.
Likely interviewer follow-ups
- Why do banks use relational databases?
- When would you choose MongoDB over PostgreSQL?
- What does a DBMS do that storing data in files doesn't?
Knowledge check
Put it into practice
Practice related interview Q&A
Apply What is a Database? (DBMS vs RDBMS) with hands-on SQL practice and interview Q&A.