News for hackers. Stuff that matters.
Re:Build Your Own Database by 4ndrewl on Tuesday October 21, 2025 @02:01PM (#45659217)
> Databases were made to solve one problem:

>

> "How do we store data persistently and then efficiently look it up later?"

Isn't that two problems?

Re:Build Your Own Database by nonethewiser on Tuesday October 21, 2025 @03:42PM (#45660685)
It's amusing to me that this is really quite a pedantic observation yet it's driving very earnest engagement from hackernews. Myself included. Absolutely nothing in this article is riding on if its 1 or 2 problems - it's an aside at best. Yet I'm still trying to think through if it's 1 or 2. I mean, the "and" is right there - that clearly suggests two. It's almost comical even, to say "Here is one problem: X and Y." Yet in another way it seems like 2 sides of the same coin.

I guess there is a rather fine line between philosophy and pedantry.

Maybe we can think about it from another angle. If they are 2 problems databases were designed to solve, then that means this is a problem databases were designed to solve: storing data persistently.

Is that really a problem database were designed to solve? Not really. We had that long before databases. It was already solved. It's a pretty fundamental computer operation. Isn't it fair to say this is one thing? "Storing data so it can be retrieved efficiently."

Re:Build Your Own Database by mrighele on Tuesday October 21, 2025 @04:08PM (#45661018)
It is a single problem that contains two smaller problems, but the actual hard part (a third problem, if you wish) is putting them together. If you limit yourself to solve those two problems independently you won't have a (useful) database.
Re:Build Your Own Database by i_k_k on Tuesday October 21, 2025 @02:40PM (#45659831)
I always wanted to ship a write-only database. Lightning fast.
Re:Build Your Own Database by pcdevils on Tuesday October 21, 2025 @02:57PM (#45660040)
Pretty much how eventstoredb works. Deleting data fully only happens at scavenge which rewrites the data files.
Re:Build Your Own Database by hxtk on Tuesday October 21, 2025 @03:32PM (#45660559)
I think it was a joke. It sounds like you read it as append-only, like most LSM tree databases (not rewriting files in the course of write operations), but I think GP meant it as write-only to the exclusion of reads, roughly equivalent to `echo $data > /dev/null`
Re:Build Your Own Database by datadrivenangel on Tuesday October 21, 2025 @03:59PM (#45660926)
I've forgotten how to count that low. [0]

0 - https://www.youtube.com/watch?v=3t6L-FlfeaI

Re:Build Your Own Database by elygre on Tuesday October 21, 2025 @02:52PM (#45659989)
Back in the 80s a professor at our college got a presentation on the concept of «write-only memory» accepted for some symposium.

Good times.

Re:Build Your Own Database by thomasjudge on Tuesday October 21, 2025 @06:56PM (#45662777)
Very secure!
Re:Build Your Own Database by archerx on Tuesday October 21, 2025 @02:58PM (#45660051)
That would be useful for logging.
Re:Build Your Own Database by Etheryte on Tuesday October 21, 2025 @04:11PM (#45661044)
Also useful for backups, so long as you don't need to restore.
Re:Build Your Own Database by warkdarrior on Tuesday October 21, 2025 @02:59PM (#45660074)
If it's write-only, and no reads ever happen, one can write to /dev/null without loss of utility.
Re:Build Your Own Database by mewpmewp2 on Tuesday October 21, 2025 @03:30PM (#45660538)
It would be good for before going to sleep then.
Re:Build Your Own Database by grokgrok on Tuesday October 21, 2025 @02:33PM (#45659720)
How do we reconstruct past memory states? That's the fundamental problem.

Efficiency of storage or retrieval, reliability against loss or corruption, security against unwanted disclosure or modification are all common concerns, and the relative values assigned to these features and others motivate database design.

Re:Build Your Own Database by kiitos on Tuesday October 21, 2025 @03:09PM (#45660225)
> How do we reconstruct past memory states? That's the fundamental problem.

reconstructing past memory states is rarely, if ever, a requirement that needs to be accommodated in the database layer

Re:Build Your Own Database by nonethewiser on Tuesday October 21, 2025 @03:37PM (#45660616)
Can you elaborate? That certainly seems to be what happens in a typical crud app. You have some model for your data which you persist so that it can be loaded later. Perhaps partially at times.

In another context perhaps you're ingesting data to be used in analytics. Which seems to fit the "reconstruct past memory stat" less.

Re:Build Your Own Database by grokgrok on Friday October 31, 2025 @01:36AM (#45768738)
Presumably the analysis will retrieve stored memory states from the ingestion phase to then perform useful calculation, or else why is there a database?
Re:Build Your Own Database by gingersnap on Tuesday October 21, 2025 @04:00PM (#45660927)
You're thinking of regex
Re:Build Your Own Database by pratik661 on Tuesday October 21, 2025 @02:59PM (#45660077)
This is analogous to an elevator that’s unidirectional
Re:Build Your Own Database by rzzzt on Tuesday October 21, 2025 @03:02PM (#45660117)
One that lets people enter. We will figure out exiting later, with exiting on a different floor as a stretch goal.
Re:Build Your Own Database by theideaofcoffee on Tuesday October 21, 2025 @04:19PM (#45661156)
Or just a paternoster
Re:Build Your Own Database by dayjaby on Tuesday October 21, 2025 @02:12PM (#45659411)
Store data persistently so it can be looked up efficiently* sounds like a single problem.
Re:Build Your Own Database by SirFatty on Tuesday October 21, 2025 @02:22PM (#45659563)
Definitely two.
Re:Build Your Own Database by SahAssar on Tuesday October 21, 2025 @02:37PM (#45659775)
"Store data persistently" implies "it can be looked up" since if you cannot look it up it is impossible to know if it is stored persistently.

The "efficiently" part can be considered a separate problem though.

Re:Build Your Own Database by prerok on Tuesday October 21, 2025 @03:14PM (#45660293)
Well, if you just want to store data, you can use files. Lookup is a bit tedious and inefficient.

So, if we consider that persistent storage is a solved problem, then we can say that the reason for databases was how to look up data efficiently. In fact, that is why they were invented, even if persistent storage is a prerequisite.

Re:Build Your Own Database by nonethewiser on Tuesday October 21, 2025 @03:38PM (#45660636)
How about "store data in certain way." That sounds more like 1 problem and encompasses an even larger problem space.
Re:Build Your Own Database by cjbgkagh on Tuesday October 21, 2025 @02:23PM (#45659582)
It’s not persistent if it can’t be recovered later
Re:Build Your Own Database by stvltvs on Tuesday October 21, 2025 @02:45PM (#45659902)
Puts message in a bottle and tosses into the most convenient black hole.
Re:Build Your Own Database by BetaDeltaAlpha on Tuesday October 21, 2025 @02:57PM (#45660038)
Doesn't the black hole compresses the bottle beyond recovery?
Re:Build Your Own Database by stvltvs on Tuesday October 21, 2025 @04:04PM (#45660975)
Re:Build Your Own Database by didip on Tuesday October 21, 2025 @04:34PM (#45661340)
Off by 1 error is indeed a hard problem.
Re:Build Your Own Database by whartung on Tuesday October 21, 2025 @04:43PM (#45661445)
> Isn't that two problems?

No, that would be regexes.

Re:Build Your Own Database by mamcx on Tuesday October 21, 2025 @06:23PM (#45662485)
You can decompose in 2 problems, because well is better, but is in fact one. Can be argued that is only this single problem:

How, in ACID way, store data that will be efficiently look it up later by a unknown number of clients and unknown access patterns, concurrently, without blocking all the participants, in a fast way?

And then add SQL (ouch!)

Re:Build Your Own Database by lelanthran on Wednesday October 22, 2025 @01:55AM (#45665338)
>> "How do we store data persistently and then efficiently look it up later?"

> Isn't that two problems?

Only if you're creating a write-only database, in which case just write it to /dev/null.