Hacker News new | ask | show | jobs
by qPM9l3XJrF 1754 days ago
"an operating system is a collection of things that don’t fit inside a language; there shouldn’t be one"

I've wondered the same thing about databases. Just like an OS, a database has to manage data on disk and figure out when to cache it. The files & folders metaphor is arguably a relic of pre-computer times--instead of searching through folders, it is easier to search and sort based on particular attributes, something that databases are well-suited to. I think it'd be interesting to start with a database and try to build an OS around it, see how far you could go.

6 comments

But humans generally like to organise things hierarchically and I would think database are not well suited for this purpose.

That is, unless there exists some kind of tree structured database that I don't know about ...

Many years ago Microsoft tried to implement some kind of database oriented file system (it was a big dream of Bill Gates IIRC and probably meant for Longhorn), but this project never became part of an official Windows release AFAIK. It'd be interesting to know why Microsoft abandoned this initiative.

> It'd be interesting to know why Microsoft abandoned this initiative.

There were technical issues. They simply never managed to get the system performant enough to be use as a FS replacement. There also were tons of issues with the concept itself, like proper tooling for visualising the stored objects to the user and a compatibility layer for legacy software.

It seems as if parts of it was merged into MS SQL server products [0].

[0] https://docs.microsoft.com/en-us/archive/blogs/winfs/

Yeah, it was based on Jet, so if I had to guess they're probably just talking about including some perf improvements in the core database engine that they made profiling the WinFS use case.
> That is, unless there exists some kind of tree structured database that I don't know about ...

Believe it or not, hierarchical databases were actually quite popular once upon a time, mostly in IBM mainframe land as I understand it. Today the Windows registry is a hierarchical database in common use.

And Codd's invention of RDBMS killed those very successfully... until we reinvented them , first with XML, second with NoSQL, and rediscovered, again, why the relational databases were such a huge success and adopted with such enthusiasm.
Rather more common that the Windows registry: any kind of filesystem.
> humans generally like to organise things hierarchically

People like doing that until they have sufficiently essential complexity that it breaks down, then they hate it with passion.

This is why, when people start asking for categories or hierarchies, you implement it as tags without telling them, if it's at all possible to do so.

Then when they decide they actually need tags, you either get to be a hero, or to goof off for a couple weeks, depending on your situation :-)

Nesting works the same way. "OK we said we needed N levels but actually we need arbitrary levels of nesting, and also we don't realize it but what we're asking for can introduce cycles to the structure". Every. Damn. Time.

Fully agreed!

It's a tyranny of hierarchical data-structures and ontologies. Always breaks down. Use relational models, graphs, tags, sets, uuids/global identifiers etc. Trees are an optimization strategy/snapshot and almost never a model for the real world.

This is basically the problem of organizing knowledge and setting up rules to easily interface with it through computational systems. There was an interesting article that discussed the topic some time ago, but can't find it right now.

Neither hierarchical organization nor tags nor databases work. You need a mix of everything, and you need to make it nice enough for the user to be able to select the best option at the right time. Think about how you think and access memories. There are a ton of ways you do it, not only hierarchically or "table-based".

This could also be likened to the problem of categorization that meta-rationalists like to talk about so much. Basically, that (at least in human terms) no categorization works under all possible contexts.

We are not gods, so it should be obvious that there's no possible organization of knowledge that makes it all perfectly available. It can't be frictionless, instantaneous and complete at the same time. Then, it should be obvious that if we want to make access to information as effective as possible, multiple methods need to be combined.

In fact, a lot of the technology that has been most "revolutionary", has been technology that improved the way we access certain types of information. Graphical interfaces, databases, spreadsheets, hyperlinks, google search, etc. We have also used calendars, lists, schedules, diagrams, button panels, etc., long before computers were a reality.

There are still a few steps left. As we attempt to tackle even more and more complex systems, we are pushed to look for new ways to manage all that.

I've never heard of that meta-rational problem before. What is it called? I'd like to read up on potential solutions to it
Sorry, didn't see your reply earlier. Don't have much time to explain, but for context, you probably want to read "a first lesson in meta-rationality" [0]. It doesn't talk much about categorization directly, but it broadly discusses the limits of rationalism, and starts to explore the "solutions" / alternative perspectives (that the author decided to label as "meta-rationalism"). The categorization problem is one of the points where you can see the "limits" of rationalism. It's never discussed to much or too explicitly in these terms, though. I advice you to read the whole thing attentively, and when you are done, go back to review the section on nebulosity, and specially this quote:

>> One has to be able to “bend” concepts, when it is appropriate. Nothing should be absolutely rigid. On the other hand, things shouldn’t be so wishy-washy that nothing has any meaning at all, either. The trick is knowing when and how to slip one concept into another.

And reflect again at this point about what you have read:

>> The point of these examples is that what counts as an “object” depends on the context.

...while thinking explicitly about the categorization problem. In computer science and AI, in particular, this problem might appear even more clearly, specially in symbolic AI. If you try to create a symbolic AI system, or if you are an experienced programmer and have a solid grasp of the limitations of abstraction, it all floats around this main issue of nebulosity / categorization / methodology in rationalism. You might also be reminded of the aphorism "all models are wrong".

Hope this gives you a starting point to keep exploring more deeply if you want to.

[0] https://metarationality.com/bongard-meta-rationality

Oracle does that,

https://docs.oracle.com/en/database/oracle/oracle-database/2...

Then use APEX for Web applications, that make use of stored procedures,

https://apex.oracle.com/en/

Other enterprise RDMS have similar offerings.

getting a 404 on the first link
Cannot edit it anylonger,

"Automatic Storage Management"

https://docs.oracle.com/en/database/oracle/oracle-database/2...

Allows mapping volumes to be directly managed by the database.

You might be interested to read about IBM's OS/400, aka IBM i. It's... sort of like that. Essentially an OS built around DB/2.
I can imagine a hybrid file system where a hierarchical structure is used for several levels, before bottoming out in a directory of databases. Ideally this would be accessible/searchable by DB index from all levels of the directory hierarchy. I'm sure something like this has been implemented of which I am ignorant.
Didn’t BeOS have some features like that?
https://www.haiku-os.org/legacy-docs/practical-file-system-d...

  The Be operating system (BeOS) uses BFS as its native file      
  system. BFS is a modern 64-bit journaled file system. BFS 
  also supports extended file attributes (name/value pairs) 
  and can index the extended attributes, which allows it to 
  offer a query interface for locating files in addition to 
  the normal name-based hierarchical interface. The 
  attribute, indexing, and query features of BFS set it apart 
  from other file systems and make it an interesting example 
  to discuss.
So yes it has been done. Personally I like the AS400 idea most - an object store where you don't even have to really "think" about the difference between memory and storage - you just have objects that you can cause to "persist" when you "commit" them and anything they are linked to by pointers will also be persisted.
Also, prior to BFS, in the earlier beta builds of BeOS, the file system was much more database like, but it ended up having performance issues (IIRC), so in a later version, they replaced it with BFS.
Apparently the earlier builds used an actual database alongside the filesystem but it was hard to keep them consistent with each other so they altered it.