Introduction to databases and persistence
At its simplest, a Database is an organized collection of data. It is usually stored electronically on a computer system.
Array or an Object. This is a tiny, temporary database. It holds data for you to use while your program runs.Databases can be simple, like a contact list on your phone. They can also be complex, like the systems powering Facebook or your bank.
Persistence means that data survives after the program finishes.
Without persistence, data only lives in your computer's RAM (temporary memory). If you turn off the computer or close the program, that data is lost.
Your notes had a great example about wolves marking territory or humans making cave paintings. Here is a technical summary:
<aside> π‘
An aside: Humans are not the only ones that use persistence on purpose.
These are pretty basic uses of persistence, but it shows that persistence has been around for a long time π
</aside>
<aside> π‘
Another aside:
Persistence existed before there was written language (but there was spoken language). The database was the lessons and rules of your tribe or cultural group, and the persistence layer were story tellers.
For centuries, information that was important to a group was told to everyone through stories by story tellers, who held a very important position in the group as the holder of the groupβs wisdom. They would then have apprentices who would learn the stories and collected wisdom and tell it to the next generation. Eventually, these stories were written down.
We also see persistence in the form of drawings in the ancient cave paintings. They would communicate important information. And here we are thousands of years later and their information is still to be seen.
</aside>
In the physical world, we, now, use paper or books to persist information. For hundreds of years libraries were our databases, and books and magazines our way of keeping information safe for later use. In the digital world, we use Filesystems.
Almost all databases store their data on a Filesystem (like the hard drive on your laptop).
The filesystem manages how data is written to the physical disk. A DBMS (Database Management System) is a specialized program. It manages these files efficiently for you.
There is no "one size fits all" solution. Different problems need different databases.
| Type | Description | Best For | Examples |
|---|---|---|---|
| Relational (RDBMS) | Data is stored in Tables with rows and columns. Relationships are strict. Uses SQL. | Financial systems, user accounts, inventory. | SQLite, PostgreSQL, MySQL |
| Document Store (NoSQL) | Data is stored as documents (similar to JSON). The structure is flexible. | Content management, fast prototyping. | MongoDB, CouchDB |
| Key-Value Store | Simple "dictionary" storage (Key -> Value). Very fast. | Caching (temporary storage), session management. | Redis, Memcached |
| Graph Database | Stores data as nodes (dots) and edges (lines). Great for connecting things. | Social networks, friend recommendations, navigation routing | Neo4j, Amazon Neptune |
| Search Engine | Optimized for searching text. | Search bars, analyzing logs. | Elasticsearch, Solr |
| Time Series | Optimized for measuring change over time. | Sensor data, stock market prices. | InfluxDB, Prometheus |
Even with many new types of databases, Relational Databases are still the standard for most businesses.
| Term | Definition |
|---|---|
| Database | An organized collection of information. |
| DBMS | Database Management System. The software that manages the database (e.g., PostgreSQL). |
| Server | A program that runs in the background and listens for requests. |
| Client | The program that connects to the server (e.g., your Node.js app). |
| Query | A request for data from a database. |
The HackYourFuture curriculum is licensed underΒ CC BY-NC-SA 4.0

Found a mistake or have a suggestion? Let us know in the feedback form.