Data and Computer Systems
Understanding how data flows on a computer system can help you in many ways from safeguarding your data to choosing the best computer system to purchase.
Volatile vs. Non-volatile
Volatile means that data in a computer system is lost when power is interrupted. Non-volatile means that the data is protected when power is off.
Memory refers to volatile data keeping, and usually refers to RAM memory, but also applies to data caches in the CPU.
Storage refers to non-volatile data keeping, and includes anything considered a volume on a computer: HDD, SSD, Flash, CD, DVD, Blu-Ray, and others.
A common way to know the difference between the two is whether or not data is saved on a computer. If the data has not been "saved," it's in memory; if it has been saved, then it's in storage.
Parts of the System
Important elements of the path data takes in a computer include:
- Storage, where a large amount of data is kept "permanently"
- RAM Memory, where a medium amount of data is kept temporarily
- CPU Cache, where a small amount of data is kept for immediate use
- CPU Core, where the data is processed.
The Path the Data Takes
The exact shape of the diagram can be confusing, so let me arrange it in a much more simplified way:
In the order which data moves, from beginning to end:
Storage is very large, allowing for up to terabytes of data to be kept for long periods of time. It is non-volatile, so data remains when the power is turned off. Storage is also cheap; it costs less than any other part of this system. However, storage is also slow, as it takes a long time for data to move from storage to the inner system. In this diagram, storage is the only part not on the motherboard.
RAM Memory is of medium size, allowing for gigabytes of data to be kept for a short period of time. It is volatile, losing all data on it when power it turned off. RAM is somewhat expensive, but not too much. It is fairly fast, but not as fast as how things move on the CPU. RAM is on the motherboard, close to the CPU; it is much "closer" than the storage.
The CPU is a single chip. Once you get on the chip, things move much more quickly. The CPU has many parts, but the two parts we will focus on are the cache and the core. The cache is a small amount of memory on the chip; the core is where the data is processed and the program is executed. Despite being one of the smallest parts of the computer, the CPU is usually the most expensive part of the computer, costing from about ¥13,000 to ¥60,000 and upwards.
CPU Cache is a small amount of memory, holding only a few megabytes of data for very short periods of time. It is volatile, losing all data on it when power it turned off. The CPU is expensive and tiny, so any memory space is very expensive, but also extremely fast, being able to reach the CPU core faster than any other data.
The CPU Core is an area of the CPU where the program instructions and data are processed to produce the desired result.
After data is processed, it can move back to the cache, waiting to be processed some more, mor it could be moved back to RAM memory in case it is not needed for a while. It might return to the CPU at a later time. When data is saved, it is sent back to the hard drive.
All along, the path taken by the data is called the bus. The bus is usually the slowest part of the path.
Let's take another look at that data path:
Notice the sizes involved.
Terabytes of data are on the hard drive. A terabyte is a huge amount of data. This can hold everything a computer might need.
Gigabytes of data is much smaller, 1000 times smaller than a terabyte. Large programs can be gigabytes in size, but many are just megabytes. Operating systems take up gigabytes.
Megabytes are smaller still, 1000 times smaller than a gigabyte. A megabyte could hold only part of a program (unless the program is tiny).
Why are these sizes important? Because you have to consider how much data is needed in what place, and at what time.
Turning on a Computer
When you turn on a computer, the CPU (cache and core) and RAM memory are blank. All the data is only in storage, usually on a hard drive (more and more, on an SSD).
When you turn on the computer, after some checks and starting processes, the computer calls for most of the operating system to be moved from the storage onto the RAM. The RAM is big enough to hold the operating system, although not every last part of the operating system is called forth.
Nothing happens with the operating system on RAM; RAM is just a place where most of the data is kept, because the operating system is much too big to go to the CPU. Remember, the CPU only has a few megabytes of space; the OS is just too huge to fit. So most of it stays in RAM.
The parts of the operating system that are needed, small bits of it, are sent to the CPU. Much of that data is kept in the CPU cache, waiting its turn while other data gets processed in the core.
Why CPU Cache?
You might ask, why use CPU cache memory at all? Why not just keep everything in RAM?
The answer is, getting data from RAM to the CPU is not fast enough. The data must use a pathway from the RAM chips to the CPU. This pathway is a bottleneck, like an expressway which narrows down to one lane because of an accident; traffic slows down at the bottleneck.
If the CPU depended entirely on RAM, there would be much wasted time where the CPU was running and ready, but had no data to process. It would be waiting, waiting, and waiting for the data to come.
To avoid this slowdown, a cache is included in the CPU so that there is always (hopefully) data ready to be used, very close by.
The Cooking Analogy
Your kitchen is empty. You want to cook dinner. What do you do?
If you are like most people, you will go to the supermarket. You buy the food and supplies that you need, and carry them home. You try to do it in one trip, because it takes a long time to go to the supermarket and return home.
When you get home, you put your groceries away, placing them in cupboards, drawers, the refrigerator, and perhaps a pantry (if you have one).
When you are ready to cook, you take out some of your ingredients; not all of them, but only the ones you need right away. Only as many as can comfortably fit on the countertop. If you have a small countertop, then you only take out a few; if you have a large countertop, then you can take out more—but even then, you don't take out everything possible. Just what you are comfortable working with.
Finally, you have your mixing bowl. (In fact, you probably use a cutting board, pots, pans, cooking trays, and more, but to keep it simple, let's just limit it to the mixing bowl.) You take your ingredients one by one and begin adding them according to the instructions.
When you finish with an ingredient, you put it back where you got it. When you need a new ingredient, you get it out and put it on the counter to use.
In this analogy:
- the supermarket is your storage (hard drive or SSD);
- the groceries are your data;
- the kitchen is your RAM and CPU;
- your cupboards and refrigerator are your RAM memory;
- your countertop is your CPU cache; and
- your mixing bowl is your CPU
When you start your computer, it is empty, and so goes to the storage (supermarket) to get the data it needs for its process (meal). It brings everything to the motherboard (home), but does not just dump everything in the CPU (mixing bowl). There is not even enough space in the CPU cache (countertop). Instead, it puts the data (groceries) in RAM memory (cupboards and the refrigerator), which is very close by and quick to access. When it needs data (ingredients) to work on, it brings the data to the CPU cache (the countertop). Then, as each bit of data is needed, it is brought to the core (mixing bowl) to be processed.
Speed and Space
The cooking analogy only goes so far, and the actual process is far more complex than what I have just explained. However, you should now hopefully have a better general idea of what is going on in your computer.
Remember, storage is the slowest part of the computer, and it has to send gigabytes of data to the RAM memory, which then has to be processed by the CPU. This is why your computer takes so long to start up when you turn it on.
This also helps explain the difference between an HDD and an SSD in terms of how much they affect your computer's speed.
An HDD is partly mechanical—it has to spin the disk, then move an arm so the read-write head can jump to the physical part of the disk to get data.
An SSD is electronic, a computer chip; the data is immediately available. An SSD is much faster than an HDD.
Therefore, when you turn on a computer with an SSD, the computer loads and is ready to use much faster than with an HDD. The increased speed of the SSD means the data loads from storage to memory much faster.
However, the SSD does not speed up the computer processing very much at all. While a computer with an SSD starts up faster, and reads data faster, this speed stops making a difference once the data is loaded into the RAM memory. The SSD does not speed up the CPU, which runs the actual software. It might help a little when data needs to be exchanged with the storage, but not much.
Here's another common effect that can be explained by what we have learned: the RAM gets overloaded.
Let's say your computer has 4GB of RAM.
You open your computer, and the operating system is loaded into RAM. The RAM is now about half utilized. There is still free space. The computer is working nice and fast.
Next, you open up another porgram. That program is loaded into RAM. It takes up more space. The RAM is filling up quickly now, much or most of it engaged in the tasks at hand. However, there is still free space. Things are still happening fast.
You open up another program, which is loaded into RAM—but now, the RAM is more or less "filled up." There's virtually no free space. Things might be slowing down a bit.
So, what happens if you try to open yet another program, or is suddenly one of the programs needs extra memory?
Well, things slow down. If there's not enugh space in RAM memory, that means that data has to be exhanged a lot more with the storage device. That is like having to go to the supermarket every time you need a new ingredient. You need to use some salt on your food? Go to the supermarket, get the salt, bring it back. You finished your drink, and you want another? Go to the supermarket, get a drink, bring it back. You want some butter for your bread? Guess what! That's right... Go to the supermarket.... You get the idea.
You may have had this experience: a computer starts fine, runs fine for a while, but then suddenly slows to a crawl. One reason this happens is that the RAM was over-used, and now the CPU is ""going to the supermarket" all the time.
In recent years, computer designs have improved a lot, including how data is stored in memory. Computers use many tricks and techniques to juggle data better. Computers don't slow down nearly as much as they used to because RAM space is cleared in a dynamic manner to always keep some space clear... but there are still limits.
Perhaps now you can better understand the benefit of certain parts of your computer.
Having an SSD helps speed up parts of the process; even though it is more expensive than an HDD, it is quite beneficial.
Having more RAM is always a good idea. Too little RAM can really slow down your computer if you run too many programs, or the programs need more and more space. Which they do.
A common solution regarding RAM is called future-proofing. You have heard of waterproof material, or fireproof materials—materials protected against the damage done by water or fire. We even say that some things are idiot-proof, designed so that even idiots cannot do any damage.
Future-proofing is similar: it is a technique to protect against damage the future can do.
What damage can the future do? It can demand more and more space in memory.
As computers get better and faster, software designers create programs that use every bit of these new abilities. Programs require more RAM meory space, and a faster CPU.
That's why your computer seems to "slow down" and "get old" after a few years. It's not, really. If you run the original operating system and the origina software, the computer should run just as fast as it did when you bought it. However, software which demands more power makes your computer less able to handle the load; in addition, newer computers make your old computer seem slow just by comparison.
To protect against these effects, you should buy a computer which has more memory and more speed than you need today. Sure, that cheap computer runs fast enough now. But in a few years, it will seem incredibly slow. Buying a computer with a faster CPU and more RAM will be more than you need today, but it will add a few years of extra life to your computer later on.
On the other hand, if you know that your needs are simple, and will stay simple, then just get that cheap computer, and don't upgrade. If you have an old computer running Windows 7 and Microsoft Office 2007, it could work just fine—even though the machine is 6 or 8 years old now.