SQL and NoSQL are two ways to store an application's data: one asks you to decide the shape of every record up front, the other lets each record bring its own.
Picking between them is mostly a question of how predictable your data is and what you need to be sure of when it changes.
What a SQL database is
A SQL database is a relational database: PostgreSQL, MySQL, SQLite and SQL Server are the ones you will meet most. It stores data in tables. Each table has named columns with fixed types, and each record is a row that fills in every column. That fixed shape is the schema, and the database enforces it: a row with a missing required value or a word where a date should be is refused.
Tables point at each other through keys. An order row holds the id of the customer who placed it, a foreign key, and the database checks that the customer exists. You then ask questions in SQL, a query language that can join tables back together at read time.
This design is what makes SQL accurate. Each fact is stored once: a customer's name lives in one row, so changing it there changes it everywhere.
Relational databases also group changes into transactions with ACID guarantees. All of the changes in a transaction happen or none do, and once the database says 'saved', the data stays saved. Taking money from one account and adding it to another never stops halfway.
What NoSQL means
NoSQL is an umbrella name for databases that don't use the relational table model. It covers a few quite different families:
- Document stores (MongoDB, Firestore) keep each record as a JSON-like document that can nest lists and objects.
- Key-value stores (Redis, DynamoDB) look a value up by its key, like a giant dictionary, and are very fast at it.
- Wide-column stores (Cassandra) spread rows with flexible columns across many machines, built for huge write volumes.
- Graph databases (Neo4j) store nodes and the relationships between them, for data that is mostly connections.
What they share is that the database does not force one shape on every record. Two documents in the same collection can have different fields. The shape still exists, but your application code decides it. This is often called , where SQL is schema-on-write.
Wondering how this was made? How we make these