Re:Replacing Linux with a Database System
by incompatible on Saturday July 28, 2018 @09:48PM
(#17636045)
Bizarre. Linux must already have some kind of "database" system for keeping track of system resources. At best, the claim would be that Linux is using an inefficient database, which seems unlikely.
[ Parent
| on HN ]
You would absolutely be surprised how far you can get using a process’s memory as it’s official database and just dumping it out to disk periodically for persistence. I kind of want to write an article but the article can’t do it justice: It’s something you need to experience yourself to fully appreciate it and be wowed like I was. I’m sure Linux uses files for its persistence layer for most cases.
We're talking about the process table and so forth. It's never persisted at all.
Re:Replacing Linux with a Database System
by giovannibajo1 on Sunday July 29, 2018 @03:17AM
(#17636950)
That’s Redis’ initial persistence design, that is still available, but nowadays most people use it with append-only logs because it provides more resistance to random crashes (eg: power going off)
Re:Replacing Linux with a Database System
by unixietube on Saturday July 28, 2018 @10:00PM
(#17636092)
Yup, I believe the kernel pretty much just uses linked lists (at least, all of the running processes are kept as a linked list). But when most of your resources only number in the tens of thousands, if that, a linked list works perfectly well. And I’m not a kernel hacker so I’m sure there are optimizations I’m not aware of.
More like a tree.
https://elixir.bootlin.com/linux/latest/source/include/linux...
Re:Replacing Linux with a Database System
by jacoblambda on Saturday July 28, 2018 @10:52PM
(#17636253)
I know the kernel uses trees for a good number of different things. I'd imagine that processes would be a BST of some time and I remember Linus mentioning RB-Trees. It would definitely make the most sense as RB-Trees have better access and insertion than a sorted linked list.