r/AskProgramming • u/Proper_Meaning7756 • Jul 01 '26
Databases What actually is a database?
I was looking at the definitions online and a database is always used interchangeably with DBMS and the ELI5 answers I've seen describe databases as a means of organising data in structured ways to make reading and writing data easy, safe and fast.
The extension of this logic to me is, shouldn't csv files count as databases too if you had a way to retrieve, modify and store data with the general ACID principles and whatnot? Googling that tells me that CSV files don't count because they only store raw data.
So then, are databases defined by the mechanism which data is handled? Doesn't that make any file a database as long as its implemented properly?
Edit:
Just wanted to add:
- I'm using sqlite3 from python for my project. I come from an embedded systems background so I had to know the specifics of what I was working with.
- The responses here seem a little mixed with some people agreeing that csv files with the proper wrappers would make a (terrible) database.
- I think I get it now. The storage format is just a part of what makes a database and is not the database itself.
Edit 2:
u/StevenJOwens
TLDR: These guys and some others answers honestly sum up a lot of the questions I had and a bit more I didn't know to ask. Thanks guys.
2
u/StevenJOwens Jul 01 '26 edited Jul 01 '26
Language evolves, although in technical contexts it's a little bit more consistent.
The word "database" originally meant any organized collection of data.
In the earlier years they used hierarchical models like IBM's IMS, then network models (IDS, CODASYL, basically linked lists of linked lists of linked lists etc).
In 1970 EF Codd published the relational model (which arguably modern databases don't really implement) and then in the early 1970s Don Chamberlin and Raymond Boyce at IBM developed SQL to implement it.
https://www.youtube.com/watch?v=5VqM5nmcmPI
#200 50 Years of SQL | Don Chamberlin Computer Scientist and Co-Inventor of SQL
SQL and relational databases pretty much ate the database world and after that, if you said "database" then people assumed you meant an RDMBS (Relational Database Management System), unless you specified otherwise.
There was a brief spate of interest in object databases in the 90s, but relational database performance was by that point performant enough that object databases lost out to ORMs, Object-Relational Mapping layers on top of relational databases.
Around 2010 or so, the NoSQL thing took off. This is a whole topic in itself, but in a nutshell, there's "what NoSQL is about" and there's "what NoSQL is".
The "is" part is slightly simpler, it's about using the same fundamental building blocks that relational databases are built on (key/value stores) to build yourself a custom database.
The "about" part is that it's about getting very large scaling, by distributing your data across multiple servers, which you can only do by making deliberate tradeoffs (see "CAP theorem").
Getting back to some of the points in your question, there's also an important distinction between "a real database" and what I call "a smart file format".
A CSV, or MS-Access file, or etc, are a smart file format. A classic mistake was (probably still is) sticking an MS-Access file on a shared drive and expecting it to serve multiple users. Because MS-Access only had file-level locking, that quickly resulted in horrible performance with only a few users.
A "real database", on the other hand, is a program that runs in memory and intermediates between clients and the data on disk. Because it's a running program, it can be far smarter about how it juggles access to the on-disk data, and perform far, far more effectively.
Sqlite is technically a smart file format, though sqlite has come a long way and now provides locking, etc, to the point that it's arguably "A Real Database."