166 points · by KraftyOne · 4y ago · 110 comments
But this seems to be proposing a distributed database that runs across computers, which confuses me. Anything that runs across computers seems to me to be application-level, not OS-level, by definition. What does it even mean to be running a distributed database on "microkernel services" instead of on fully-fledged OS's? And then... where is the OS-level CPU coming from? If the database is distributed among computers then fine, but which computer is "running" the OS?
Both the nomenclature and distributed aspect are really throwing me off here.
All of the computers are "running" the OS. The OS is more than one service on more than one machine.
https://en.wikipedia.org/wiki/Distributed_operating_system
"Research and experimentation efforts began in earnest in the 1970s and continued through the 1990s, with focused interest peaking in the late 1980s. A number of distributed operating systems were introduced during this period; however, very few of these implementations achieved even modest commercial success."
So looks like they're trying to keep the idea going?
So 'inevitably destinated to evolve'? No..
And I wouldn't call "cd", "ls", "mkdir", "rm", "cat" and "echo" a query language.
Even the first navigational databases had a proper query language, although radically different from SQL.
Novell Netware was also marketed as a Network Operating System, in the sense that none of its services were confined to the local machine: its entire purpose was to combine a network of computers into a single management unit.
And I don't know what you mean by "catalogs", in the context of IBM i. Are you talking about DB2 catalog views? (Which exist in DB2 on every other platform, and most other RDBMS have something equivalent, such as the ANSI standard INFORMATION_SCHEMA)
Or are you confusing IBM i with MVS (in which the OS contains databases called "catalogs", in which you lookup a file name or file name prefix to find out which disk volume a file is stored on?)
You could _also_ architect a comparable system as user-space networking on top of a conventional OS, but that's by no means required.
Distributed OSes have been an active area of research since the 1970s at least.
I don't have the resources available to me like this team, so there are still a lot of features on my TODO list that would enable some of the things they are looking for, but it can do many things now. It can manage 200M+ files and find subsets of them in sub-second speed. It can build relational tables with hundreds of millions of rows and thousands of columns and perform queries faster than many conventional DBs.
www.Didgets.com is where you can download the beta software. Demo videos at https://www.youtube.com/channel/UC-L1oTcH0ocMXShifCt4JQQ
The system is also designed for full ACID compliance, but there is still some work to be done in this area.
I never met anyone who used it, though.
I think its database features have been somewhat overhyped – but no doubt an area of strength when compared to other lower-end systems of the same time period.
The fact that the OS, programming language and database were all a single software package, developed together and sold as a unit, attracted people.
Much of its initial success was also due to its marketing strategy – target ISVs who would resell it as the basis of turnkey solutions.
It was based on a virtual machine, which made it easy to port to disparate hardware platforms – everything from PCs, to multiple incompatible minicomputer lines, to IBM mainframes – a key selling point in its day – although not a unique approach (see UCSD Pascal). Other approaches to portability – such as the C programming language – hadn't really taken off yet.
If anyone wants to try out universe which is one of the truly more modern multivalue database, I wrote an installation guide.
I'm sot sure the acronym would stand today, nor indeed Richard Pick's nickname.
Start at the top with sqlite compiled to webassembly as a virtual machine and prove that the tabular paradigm is superior to the scalar, vector, and object paradigms.
It'll be more fun that way.
The way that webassembly and wasi are designed to not fall back on unix tradition creates the opening to escape from the traditional files, streams, and objects universe.
Oh, right: https://en.wikipedia.org/wiki/Pick_operating_system
(No, I never used this.)
Incidentally, the name of its creator would be pretty unfortunate these days: Dick Pick.
Building on top of too many layers increases the overall complexity and reduces overall performance. Periodically chopping out part of the system and creating what you actually need, fresh, is sometimes necessary. Even if it doesn't produce a new product or final system on its own, gives you a direction for moving other systems if the theory pans out in practice.
It seems like a rehash of plan 9/network-is-computer paradigms. I get all the reasons that is interesting now- networking is REALLY fast and lots of cache hierarchy and other assumptions in kernels just don't apply any more- but to place the emphasis on the areas of innovation on the use of tables and transactions as core distributed primitives for applications...is strange.
While maybe beneficial for system programmers, it definitely isn't a more understandable paradigm for application programmers- very few of whom who write code that saves data understand the varieties of transaction semantics.
And in terms of applications, what decades of failed "database under the filesystem with typed object storage" work has shown also that the data types and semantics applications need are always more imaginative than those exposed at lower levels. Someone used to working with graphs, when given tables, is going to walk away.
Where is the ML layer that optimizes under a "save this thing" surface that actually presents a new stable abstraction?
But in true armchair architecture sniper fashion, I'm going to leave my confusion as is and move on. Best wishes to them.
We designed a schema and range of application-defined functions that allow for us to use SQLite as a domain-specific language. In addition to domain data, the schema also stores the authoritative view state as well as any intermediate function arguments.
The really nice thing about this is all of the support around the edges. You can use SQLite’s EXPLAIN keyword to get an output of how the virtual machine would execute your statements, including any custom functions.
You can also trace the result of every command in separate tables for troubleshooting - Each command starts with SELECT so we might as well do something useful with this.
It’s a “reflective” approach since the scripts for handing the various events reside in the same database upon when they execute and can be inspected or altered by script execution.
There’s also the magic of the WAL. If you are doing everything in the database (presumably because it’s your operating system) then things like incremental replication of state to another computer become trivial.
That said, the object-relational database goes down pretty deep in the system. IBM i (as OS/400 is now called) relies on it for storing things like source code and bound programs in addition to, well, data. Aside from IFS, which seems seldom used except for Java, it's basically the way to store things.
If you have a library (IBM i-ese for a directory, kinda, but it's actually more like a schema in something like PostgreSQL), say, called YCBR1 that contains a physical file named QRPGLESRC, you can run `SELECT srcseq, srcdta FROM ycbr1/qrpglesrc` against it even though the members in that physical file are RPG IV source code, and you'll get the usual kind of resultset that you'd expect from a relational database. Likewise, you'll get something similar for binaries.
From what I understand, the DB2/400 code base was forked from SQL/DS – so its closest relative is Db2 for VM/VSE – and Db2 for i is as much Db2 as Db2 for VM/VSE or Db2 for LUW is. (Db2 for z/OS is itself descended from SQL/DS – it started out as a port of SQL/DS from VM/CMS to MVS, although I believe most or all of the SQL/DS code was rewritten early in its development history and there may be little or none left by now.)
> IBM i (as OS/400 is now called) relies on it for storing things like source code and bound programs in addition to, well, data
Not really. You are talking about storing objects (including files) in the classic OS/400 filesystem – which hasn't fundamentally changed from that of S/38 – and S/38 didn't have SQL. During the development of OS/400, they took the higher layers of SQL/DS and ported them on top of the S/38 file system. But if we are talking about how RPG code is stored, that's all about those lower layers which predate SQL support
> YCBR1 that contains a physical file named QRPGLESRC, you can run `SELECT srcseq, srcdta FROM ycbr1/qrpglesrc` against it even though the members in that physical file are RPG IV source code
Nowadays, many other RDBMS systems support querying OS files as if they were DB tables.
I won't deny that IBM i makes it somewhat more seamless than most other systems – but I think that's mainly because it is seen as somewhat of a niche requirement, other systems could easily make it more seamless if it was seen as a priority. No "deep" integration with the OS is necessary to implement it, either
Rather than writing hand rolled code for querying data structures and manipulating them as Linux does, we can define queries that retrieve data structures in in the shape we're looking for.
To put this simply, this is extremely high level, and the idea that data layout, data structure and algorithm can be unaggregated for cache locality and performance and developer experience. We can form materialized views on top of other materialized views and calculate the most efficient retrieval and storage format based on the structure of the data.
I suspect a materialized view, as in the data structures of the Linux kernel is more efficient than materializing a join at runtime.
One of my ideas is "ideas4 9. Query for data structure", https://github.com/samsquire/ideas4#9-query-for-data-structu... which is the idea we should be capable of querying to retrieve data structure in the shape we want. The shape of the data lends itself to solving certain kinds of problems.
An ideas3 is "Query database" https://github.com/samsquire/ideas3#17-query-database, we persist queries as we persist data and use them to optimise data storage format. Rather than using a cost based optimiser to optimise how to retrieve data in the same uniform structure, we optimise how to store data itself. For example, for write heavy loads, we use LSM trees, we persist columnular when a query uses every field of every row and so on.
I also had the idea # 10. in ideas4 to persist data access patterns directly and optimise that. https://github.com/samsquire/ideas4#10-access-pattern-serial...
how are process boundaries on data preserved?
If data can be shared between processes via the db, how do they enforce clean, clear, testable interfaces (like monoliths lack)?
And given all that, how do they manage data schema changes that we'd handle now with API versioning?
What prevents a monolith from having these things?
> While the DBMS engine will need some basic resource management functionality to bootstrap its execution, this could be done over a cluster of servers running current OSs, and eventually bootstrapped over the new DBOS.
> In 2013 Bill Gates cited WinFS as his greatest disappointment at Microsoft and that the idea of WinFS was ahead of its time, which will re-emerge.
WinFS was supposed to be released with the codename Longhorn version of Windows, but Vista was released without it. WinFS was disbanded and parts incorporated into other products and features.
Talking specifically about databases: they often implement their own data organization. Oracle and Sybase famously performed better when working on raw partitions than with files.
"The bottom line is that operating system services in many existing systems are either too slow or inappropriate. Current DBMSs usually provide their own and make little or no use of those offered by the operating system. ..."
Now, 40+ years later, Stonebreaker is a participant in the present DBOS project!
1. http://www.cs.fsu.edu/~awang/courses/cop5611_s2022/os_databa...
However, databases generally subsume most responsibility for the on-disk representation of data as well as I/O patterns. What’s really being compared here is the performance of the database as a storage engine vs. the file system itself as a storage engine - not the raw I/O potential of the filesystem itself.
Some database filesystems can be installed directly on raw block devices if you desire with no OS filesystem in the middle. This usually offers significant performance and efficiency gains since everything above the raw hardware is purpose-built for the requirements of optimal database performance.
> SQLite reads and writes small blobs 35% faster¹ than the same blobs can be read from or written to individual files on disk using fread() or fwrite().
This is likely because of the hierarchical nature of the filesystem. The filesystem path lookup can be slower than DB index lookup (depends on actual implementation). I haven't tried this, but something like getdents(2) would improve the performance of the test C code here, as one can skip full path lookup.
SQLiteOS