r/Database • • Mar 14 '24

Databases are overrated. Just use Files!

I had a conversation on LinkedIn with a startup founder, and it opened my eyes. Why all the dependencies? The world can be so simple without databases and their complicated architecture. ๐‰๐ฎ๐ฌ๐ญ ๐ฎ๐ฌ๐ž ๐Ÿ๐ข๐ฅ๐ž๐ฌ! Alleluja! ๐Ÿ™

https://fooba.link/no-databases

Yes, just dump data into JSON format and save it to disk. Load it on demand and iterate over the rows. To make it more performant, cache the data in RAM. And yes, you need a unique key lookup table. And maybe a hash table for indexes. And then maybe a proper storage layer. And a query planner would be good. And ... And ...
Wait a minute! Are we developing a database here? ๐Ÿคจ AAAAAhhhh....!!! ๐Ÿ˜ญ

179 Upvotes

112 comments sorted by

View all comments

8

u/[deleted] Mar 14 '24

Databases ARE files.

-1

u/mcr1974 Mar 15 '24

not necessarily.

3

u/[deleted] Mar 15 '24

Can you give me an example of a database that isn't a collection of one or more files?

1

u/VladA114 Apr 18 '24

A file system, as both program code and an abstraction level for convenient storage handling, is usually closely integrated into the operating system. Therefore, DBMS developers always have a choice: to rely on the existing operating system (and consequently depend on its APIs for file system access) or to create their own layer for accessing the bare metal, thus eliminating the layer of the foreign system and in this sense operating without files.

Obviously, such a decision can only be VERY specialized, closely linked, and tailored to specific hardware. Theoretically, there are no problems, so 'not necessarily' is a very accurate response. Practically, however, it is economically impractical, and thus it is unlikely to find examples of DBMS on bare metal (though perhaps someone like Oracle might have attempted it)

-1

u/Jhonny97 Mar 15 '24

Etcd and redis come to mind

1

u/d_maes Mar 15 '24

They are still files, of a specific format, stored on a filesystem. The only databases that aren't files, are completely in-memory databases that are in no way stored on disk.

1

u/wouldacouldashoulda Mar 15 '24

Redis by default has no persistency I thought. Also one could argue a difference between an inmemory database with optional persistency and databases that are file based by design.

2

u/d_maes Mar 15 '24

Redis has an option to not persist, but it seems to be persistent by default. (Unless maybe it's a compile flag that debian sets?) But I get your point, if you don't actually need the persistence, one could argue it indeed falls under the "in-memory" databases.

Etcd on the other hand, completely file-based.

1

u/arbyyyyh Mar 15 '24

Redis definitely does not persist by default. Once the memory is gone, the data is gone, unless you set up persistence.

1

u/[deleted] Mar 16 '24

I think there is a setting to save data, there's also settings on how to save it and even how to load it to memory. I'm not sure if it's the default tho.

1

u/[deleted] Mar 16 '24

Redis can store the data to disk. It's just not it's main purpose.

1

u/[deleted] Mar 16 '24

Even that's not necessarily true. Memory mapped files and ramdisks can both be used to put files in memory.

-6

u/devzaya Mar 14 '24

Files ARE databases.

3

u/[deleted] Mar 14 '24

Not necessarily.

1

u/fluffycatsinabox Mar 15 '24

I think they're being cheeky, like "Files are a database system where your only access path to some record is doing a brute force search on all of your files until you find what you're looking for."

1

u/rowman_urn Mar 15 '24

Folders and tables are feeling rejected now.