4 ms·
That's right. Many databases are literally just folders of files once you look under the hood - for example, here is PostgreSQL's layout: https://www.postgresq
by olooney 8y ago
That's right. Many databases are literally just folders of files once you look under the hood - for example, here is PostgreSQL's layout:
https://www.postgresql.org/docs/9.4/static/storage-file-layout.html https://www.postgresql.org/docs/9.4/static/storage-file-layo...
Note in particular the comment "Each table and index is stored in a separate file" which shows that the file layout is not trivial.
SQLite is another database, but it also is "just files in a folder:" the main difference is that there is a single file for all the tables and indexes but it uses several other files in the same directory as well:
https://www.sqlite.org/tempfiles.html https://www.sqlite.org/tempfiles.html
Note that MS SQL Server uses much the same strategy as SQLite, although you have the option of splitting it across multiple OS files if you need more control over physical storage:
https://docs.microsoft.com/en-us/sql/relational-databases/databases/database-files-and-filegroups?view=sql-server-2017 https://docs.microsoft.com/en-us/sql/relational-databases/da...
But if SQLite is a database, how is .xlsx or .ini or .json fundamentally any different? I don't think there's anywhere you can draw a bright line that will include all well known databases but exclude things that "merely" file formats. If we draw the line at "transactions," for example, we'll find that MongoDB and ElasticSearch no longer count. If we draw the line at "user access control" then SQLite and redis are not databases.
Older RDBMSes like Oracle may eschew OS files in an attempt to gain more control but they can't escape the fact that they too are are fundamentally just "organized collection of data, stored and accessed electronically." And then there are in-memory databases - which do not use the disk at all, but are plainly still considered "databases" - it's right there in the name! These varied examples show that the word "database" is used very broadly and any definition narrower than "A database is an organized collection of data, stored and accessed electronically" will certainly fail to include many instances of things which are commonly referred to as databases.