Understanding Databases: How Software Systems Store and Retrieve Information

A simple mental model for understanding how software systems store information and keep it consistent at scale.

Understanding Databases: How Software Systems Store and Retrieve Information
Sandeep Varma
8 min readFeb 25, 2026
Understanding Databases: How Software Systems Store and Retrieve Information
Photo by Sandeep Varma on EMDock

In the previous posts, we walked through the frontend and the API layer using a three tier architecture mental model. The frontend is where users interact with the system. The API layer is where business logic runs and where rules are enforced. That naturally leads to the next question. Where does the data live when it needs to stick around after the page refreshes or after the user closes the app?

That layer is the database.

For non engineers, the word database can sound heavy. In reality, the core idea is simple. A database is a place where information is stored in an organized way, and there is specialized software that makes it easy to save data, find data, update data, and keep it consistent over time.


A Simple Mental Model: Databases Are Like Excel Sheets

A great way to think about a relational database is to think about Excel.

In Excel, you have a sheet with rows and columns. Each row represents a single item or record. Each column represents an attribute about that record. You can sort, filter, and search. You can also add new rows and update existing ones.

A relational database starts with the same intuition. It stores data in tables. Tables have rows and columns. Each table usually represents one type of thing, such as users, orders, invoices, or products. Each row represents one instance of that thing. Each column represents a detail about it.

The key difference is that a database is built for scale, reliability, and shared access. Excel is great for manual workflows and small datasets. Databases are built for systems where thousands or millions of records must be stored and updated safely, sometimes by many users at the same time.


What Makes It a Relational Database

Relational databases are called relational because tables can be related to each other.

In Excel, you might have one sheet for customers and another sheet for orders. An order belongs to a customer. You usually represent that relationship by storing a customer ID in the orders sheet.

Relational databases do something similar. You might have a Customers table and an Orders table. Each order row contains a customer identifier. That identifier creates a relationship between those two tables. This makes it possible to answer important questions, such as which orders belong to a specific customer, without duplicating customer information in every order.

This model stays intuitive because it mirrors how people naturally organize information. You keep separate sets of data separate, and you connect them using consistent identifiers.


Why Specialized Database Software Matters

If a database is like an organized set of Excel sheets, the database software is like a powerful assistant that can instantly retrieve and update information based on your request.

In Excel, you might filter rows manually or write formulas. In a database, you use a query language, most commonly SQL, to ask questions such as show me all orders for this customer, or show me all orders in the last 30 days, or update the status of this order.

The database software takes care of doing this efficiently, even when the data is large. It also takes care of many system level concerns that Excel does not handle well, such as allowing multiple people or services to read and write at the same time, preventing data corruption, and ensuring data changes are stored safely.

This is why databases are more than just storage. They are storage plus a retrieval and integrity engine.


How the API Layer Interacts With the Database

In a three tier architecture, the frontend does not speak directly to the database. The API layer acts as the controlled gateway. When the frontend needs data, it calls the API. The API decides whether the request is allowed, applies business rules, and then retrieves or updates data in the database.

This separation matters for security and correctness.

If users could directly access the database from the browser, it would be easy to extract data or manipulate the system. The API layer exists to enforce permissions and rules. The database exists to store information durably and retrieve it efficiently. The two layers work together, but they have different responsibilities.


The Value of Structure and Consistency

Relational databases work well when your data has structure and when consistency matters.

If you are storing customers, orders, payments, and subscriptions, you typically want clear rules. You want an order to reference a real customer. You want amounts to be numeric. You want statuses to follow a known set of values. You want changes to be applied reliably.

Relational databases are designed for this. They support constraints that prevent invalid data from being stored. They also support transactions, which means a set of changes can be applied together as one unit. This is useful when you want to ensure that multiple updates either all succeed together or all fail together, rather than leaving the system in a half updated state.

For non engineers, the practical takeaway is this. Relational databases help systems stay predictable as they grow.


When People Use Document Databases

Not every database looks like tables and rows.

Document databases often store data as documents that resemble JSON. Instead of spreading information across multiple tables, you store a full object together in one place. This can be useful for certain types of applications, especially when data is highly variable or when you want to retrieve a full object without assembling it from multiple related tables.

That said, relational databases tend to be the most intuitive starting point for understanding how software stores data, especially when you are working with systems that involve users, transactions, and business workflows.

In this post, the goal is to build a strong relational foundation. In a follow up post, we can go deeper into document databases and when teams choose them.


Bringing It All Together

A database is where a system stores information so it can be retrieved later. A relational database stores data in tables that resemble Excel sheets, with rows and columns. The database software provides a powerful way to store, retrieve, and update data reliably, even at scale. In a three tier architecture, the API layer is the controlled gateway that talks to the database, enforces rules, and keeps the frontend from directly accessing stored data.

If you work with engineering teams, I am curious how you currently think about databases. Do you mostly picture them as storage, or do you also think about them as the part of the system that enforces structure and consistency? Share your thoughts or questions, and if there is a specific database scenario you want to understand better, tell me what it is and I will use it as an example in the follow up post.

Enjoyed this post?

Comments

Loading comments...

Please log in to post a comment.

About the author

I write about leadership and software engineering through the lens of someone who’s worked as a software engineer, product owner, and engineering manager. With a Bachelor’s in Computer Science Engineering and an MBA in IT Strategy, I bring together deep technical foundations and strategic thinking. My work is for engineers and digital tech professionals who want to better understand how software systems work, how teams scale, and how to grow into thoughtful, effective leaders.

View full profile →
Continue reading
← Previous
Understanding APIs: Where Business Logic and System Control Live

Understanding how APIs coordinate frontend requests, enforce business logic, and safely interact with your database

Related posts
Understanding APIs: Where Business Logic and System Control Live
Understanding APIs: Where Business Logic and System Control Live

Understanding how APIs coordinate frontend requests, enforce business logic, and safely interact with your database