Chapter 4 Storage
Another big killer in Longhorn is Winfs - let you manage and query your data like a database.
The hard drive is getting bigger and bigger, thinking about 7 years ago, I bought a 1.5G hard drive when I was on college, and I have been thinking about how I can use it? Think about it now, one or two hundred g hard drives have been easy to buy. Now the hard disk is big, how do you manage this data?
So I remembered the magical thing of Google, almost became the encyclopedia, and I didn't understand directly into the search box. After a few seconds, the answer was placed in front of it, and the speed of the search local hard disk is faster! People are searching the whole world!
Let's first take a look at the current computer data storage, generally use the file system, and there is no more than two kinds of FAT and NTFS on Windows. With a file system, you can only organize data in a hierarchical manner. Search is nothing more than a file name, you can match the text contained in the inside, and other more complex search is almost impossible. For example, in accordance with the content of the image, the music of the singer and the summary of the Word document, etc., it is more difficult. Of course, there are now some applications to help achieve these complex retrieval work, but they are all based on their own technology, there is no unified standard. Therefore, for the user, to achieve different functions, face a variety of very different interfaces. And data exchange between different applications, because it is difficult to do due to the uniform data format.
Ok, now Winfs is born, when the data is saved in the system, it is no longer only saved the file name and content, and some original data is included. The original data is, for example, the size, color value, shooting location, time and event, and MP3 singer, albums, etc. This information is like a field in a database table. You can use these fields to use a statement similar to SQL to perform complicated queries, such as photos taken in a certain location, a certain album MP3, etc.
Winfs can coexist with the original FAT / NTFS, you can choose to save the data in which system. When the file is saved, the system automatically extracts the Medadata it know and automatically synchronizes Medadata when the file changes.
In addition, WinFS defines some so-called public Schema, similar data definitions. For example, the data objects such as Person, Address, Contact are defined so that the system can maintain a copy of data, and different applications can be accessed. Think about it, now how much is the use of your own address book, think about it in the year to read the touch of the contacts inside the Windows, even if it is now Outlook and Outlook Express's address books are also two Set!
If you just access and query the data like a database, it is still nothing surprising. Magic is that in the interface provided by Winfs, the object Object is allowed to be saved directly. Fully abandon the concept of files, abandon the process of serialize / deserialize, which is fully object-oriented. Not only that, you can also use the way to use the SQL statement to perform object queries, but also support the concept of the database - transaction! You fully imagine that the bottom layer of the system must be SQL Server.
At this time, I remembered the concept of a composite document that came into contact with COM. At that time, the object is saved inside the document, you can also know this file. Now, you don't know if there is any file, and you know where these data is stored.
In fact, it is not a new thing to save objects with a database to save objects. There is actually a lot of such framework. Hibernate in the Java world is such an O / R framework, which is very popular in Java's server. However, how the above concepts are perfectly integrated, and it is not allowed to apply in an ordinary client program. We have to admit that Microsoft is not a pioneer, but their ability to integrate system is really amazing, it is a huge imitation ability.
I think, soon, we will forget that fopen () so a weird function, huh, huh.