
Mine all mine, I want everything! As little children, we used to go for everything, till we grew up and realized how big the universe really is. The smartest student of a small town high school may not be admitted into MIT, and even if he is, he will soon understand that everyone else is smarter than he. We have lost our courage to explore, to run, to fight and to still want everything.
Only the best of the best continue to dream. Theoretical physicists seek a theory of everything to explain our physical reality, whereas software developers crave a software system of everything for a consistent virtual reality upon all hardware available. I am not here to discourage you, since the world around us is already doing a very good job. I am here to help you find that little child in you who is almost dying, who still may have love for humanity.
It is time to awaken to the voice of our heart!
The nature of nature is harsh, the survival of the fittest, whereby we end up with a deep and steep storage hierarchy all the way from registers down to L1 cache, L2 cache, L3 cache, main memory, solid-state drives, cloud drives, magnetic drives and magnetic tapes, in ascending order of capacity and latency as well as in descending order of IOPS, throughput and unit price, where IOPS stands for Input/Output operations Per Second. The reason why a technology, a product, a service, a hire or whatever can possibly exist is because it is at least fast or cheap.
Below is the list of common data technologies with their latency estimates, which gives an idea of how quickly a technology downgrades on the storage ladder:
Registers, at sub-nanoseconds;
L1 cache, within a couple of nanoseconds;
L2 cache, within a few nanoseconds;
L3 cache, over a few nanoseconds;
Main memory, near a hundred nanoseconds;
Solid-state drives, in microseconds;
Cloud drives, in few milliseconds;
Magnetic drives, in milliseconds;
Magnetic tapes, in tens of seconds.
As you see, registers are at a minimum a hundred billion times faster than magnetic drives, yet that does not mean magnetic drives will disappear in decades to come, for they are dirt cheap! Here is the same list with cost estimates per gigabyte:
Registers, beyond a million US dollars;
L1 cache, beyond half a million US dollars;
L2 cache, in hundreds of thousand US dollars;
L3 cache, near ten thousand US dollars;
Main memory, well within twenty US dollars, but fluctuating violently;
Solid-state drives, in a few US cents;
Cloud drives, in a few US cents, per month though, which is a different economy;
Magnetic drives, in a couple of US cents;
Magnetic tapes, in a small fraction of a US cent.
Everything works altogether for a good purpose so long as their price is right.
Today, we are storing more than two hundred zettabytes of data globally to serve AI and our daily life. We need magnetic tapes badly! Since the cost of cache and memory is generally prohibitive on a larger scale, we try parallelizing reads and writes on solid-state drives in the hope to execute more operations per second, hence a new metric called IOPS in our computing industry. Let us review again the same list with IOPS estimates:
Registers, in tens of billions;
L1 cache, in billions;
L2 cache, within billions;
L3 cache, below a billion;
Main memory, in tens of millions;
Solid-state drives, within a couple of millions;
Cloud drives, in thousands;
Magnetic drives, in hundreds;
Magnetic tapes, in tiny fractions, far below one.
We notice that solid-state drives are closing the gap with main memory, which we can start using as virtual memory without a huge performance penalty, which is not yet the case with cheaper magnetic drives. As a result, we attempt forward-only sequential reads and writes to see if we could integrate all these devices more tightly together, thereby saving money. Following is the same list with read throughput estimates:
Registers, beyond hundreds of gigabytes;
L1 cache, beyond hundreds of gigabytes;
L2 cache, in hundreds of gigabytes;
L3 cache, in hundreds of gigabytes;
Main memory, within a couple of hundred gigabytes;
Solid-state drives, over a dozen of gigabytes;
Cloud drives, near a gigabyte;
Magnetic drives, in a couple of hundred megabytes;
Magnetic tapes, in hundreds of megabytes.
Now, even magnetic tapes can come close to solid-state drives! Unfortunately, forward-only sequential access is not Turing-complete as we all know, and a standard Turing machine that moves both forward and backward is by the same token considered thus inefficient that we eventually devise a Random-access Turing machine that can jump to any position on its Turing tape. Why? We do not want to go through trillions of records just to get that piece of needed information. We want to zip there instantly, which is what we term a seek operation.
The beauty of a seek is that we can directly get wherever necessary, which on the other hand brings us back to the ages-old storage hierarchy whereby both solid-state drives and magnetic drives can no longer act effectively as virtual memory. The financial consequence of a seek is not always affordable, plus true random access not physically existent given the speed of light as a universal barrier. For example, main memory at the capacity of petabytes on a supercomputer can behave a little like a hard drive thanks to its sheer volume.
Pagination comes to the rescue!
By forcing a sequential read or write of a few kilobytes at a time, mostly in powers of two, we balance between the high throughput of sequential access and the algorithmic value of random access, combining the best of both worlds. If data are scattered such as choosing those whose month of birth is July, a smaller page is favored. Likewise, if data are concentrated in a specific range such as viewing those whose year of birth is 2000, a larger page is preferred.
Another strength of pagination is preventing the fragmentation of cache, memory and drives, where one kilobyte freed at the beginning can never be used again unless there is a future request that fits also into one kilobyte, or the data stored will overlap with the subsequent kilobyte. By fixing the page size, we ensure that pages will resemble tiles that cover the floor without leaving any hole open. In fact, pagination is tremendously successful, so much so that processors, operating systems, databases or whatsoever all manage their storage hierarchy by paging, hardware and software alike, save our beloved programming languages that still consume space in arbitrary units of length…
What a shame! Imagine a whole new programming language rooted in pagination where there is no more impedance mismatch at any storage level and where you suddenly have zettabytes of cloud memory at your fingertips, known as the Internet machine for all, which delivers a new generation of cloud operating system, a new model of cloud database system and a new paradigm of cloud programming language, which we have all been missing ever since the dawn of computer science!
Nonetheless, paging is not perfect, or alone does not suffice. We have long discovered the insurmountable memory wall in practice due to the random nature of object orientation. Some programmers returned to C from C++ in abandoning object-oriented programming, whereas most C++ developers experimented with advanced array-based data structures whose internal references point at in-array memory locations, be they lists, trees or graphs semantically.
We need paged arrays, which at a glimpse seem relational yet are not, for the slowness of relational joins has spawned a plethora of specialized non-relational data models, including but not limited to InterSystems IRIS, GridGain, db4o and more, which we call object databases, or MongoDB, Amazon DynamoDB, Google Cloud Firestore and more, which we categorize as document databases, or Neo4j, Amazon Neptune, TigerGraph and more, which we classify as graph databases.
Instead, we must get back to the sound foundation of mathematics whereupon our finance, economy, science, technology, engineering and entire human civilization have all been established, that is, a metalinguistic paradigm that is set-oriented by ZFC for Zermelo-Fraenkel set theory with the Axiom of Choice and class-oriented by NBG for von Neumann-Bernays-Gödel set theory, which to configure into logic, functional, procedural, fuzzy, relational, object-oriented or what not programming based on the specific contexts and aspects with our Internet machine.
The nature of nature fosters exponential hierarchies by the laws of physics and metaphysics, which we want to recognize, leverage and harness to our advantage, the storage hierarchy being only one of them.
Let our journey begin!
Comments
Join the discussionNo comments yet. Be the first to comment.
