by October 1, 2005 0 comments



Saving or storing files in computer requires a file system. This is a platform used by the OS on the computer to let users store their data in terms of files. Different OSs use different file systems like Windows use FAT and NTFS file systems and Ext2/Ext3, ReiserFS and XFS on Linux. However, although each one of these file systems is implemented differently there are some very common things that they share. All these systems have a concept of files and folders (directories). Files are organized within folders that can contain more folders and files. There has been a lot of discussion of moving away from this model and having a different approach in file system technology. Having a relational database as a platform has been among the foremost of these, and a couple of test implementations have also taken place but failed miserably. This was partly due to the fact that existing applications find it impossible to use this new file system without major changes as well as the problem of performance since there is a RDMBS running as the file system. Therefore at this stage, there is no widely used implementation of a different type of file system that exists. WinFS is a new offering coming up from Microsoft for Windows that will provide the capabilities of the relational-database based file system. Currently available in Beta 1, WinFS was supposed to be released as part of the next version of Windows, named Vista, but was pulled out recently. It will now be available for Win XP, Win 2003 and Win Vista.

Direct Hit!
Applies to: Technology enthusiasts
USP: Relational model for the file system
Primary Link: msdn.microsoft.com
Google keywords: WinFS

WinFS, unlike what the name seemingly suggests, is not a new file system. WinFS actually stands for Windows Future Storage. Most likely it will be renamed to Windows Storage Foundation at RTM to be consistent with the other technology stacks in the Vista timeframe. WinFS is a relational storage model that sits atop NTFS-the default and recommended file system in Windows. So what does WinFS do and provide? It works as a service working in conjunction with NTFS that provides additional features. For instance, instead of using directory search APIs in the applications you write, you can use SQL-like queries to retrieve file or folder information. For instance, to find all Word files in a folder we created, we can do something like:

Select File.Name from [Folder Namespace] where File.Type=”DOC” and
File.Author=”Vinod”

The above is a pseudocode and not the real code that you’d write. But it does showcase the power of the query. There are many desktop search tools that have become available recently-Google Desktop Search, MSN Search Toolbar and more.

The new WinFS stores items that appear in My Computer. On opening it, you will see a Default Store

All of them share a similar technology-that of indexing the content of files in the file system and providing quick search results when a query is made. However, these do have shortcomings. For instance, if you want to search for files that contain some text about you having gone for a swim.You will enter the word ‘swim’ and quickly get the results-from files and e-mail-that contain this word. What you will miss out are files that don’t contain this word, but are inflectional. Like, you won’t get files that contain the words ‘swam’, ‘swum’ or even ‘swimming’. Since the relational database engine of WinFS in reality is SQL Server 2005, it follows that even more power is available for indexing and searching within data. SQL Server has always had a full-text search index that does a ‘FREETEXT’ search. This search combines results for the word in a search as well as inflectional forms. You can also get results back from a relational ‘dictionary’ -that is, words that are similar in meaning to the one that you entered (like ‘dip’ and ‘bathe’ for ‘swim’) or from similar-sounding words (like ‘hear’ for a search on ‘here’). These relations between words allow a user to perform much more powerful searches than what is currently possible.

When you create a new store, you are prompted for the target volume, a name and an optional comment

There are many other uses to having a relational service on your file system. As an example, you can link files with other files based on a particular relation and assign events that can occur on the link-say, making sure that when a particular file is copied or moved, the related files are also copied. This sort of behavior is already available in a tiny part when you save a Web page locally as an HTML file. This creates a linked folder with the additional files like images and style sheets. Currently, there is no way you can create your own links or manipulate existing ones. With WinFS, you get the power to do this too. The current beta of WinFS is very basic in what it can do. To install it, you need WinXPSP2 (no, it does not work on Vista yet) and the Beta 2 of the .NET Framework 2.0 (version 2.0.50215). 

Once installed, you need to reboot and when you go to ‘My Computer’, you will see a new item called ‘WinFS Stores’ that looks like a folder. On opening it you will see a DefaultStore as well. You can right click on the blank area and select ‘Create a New Store’. This prompts you for a location to keep the store as well as assign it a name. You can also give a comment if you wish. Now you can start copying or creating files within it. These data stores are also usable from all applications on Windows almost seamlessly. Simply use the normal file Open and Save dialogs to directly open or save files in the store. The only quirk that we noticed- albeit a very minor one-was that all stores appear in ‘My Network Places’ instead of ‘My Computer’ when going through the Open or Save dialogs. 

Standard Windows file dialogs, like ‘Save’, lets you store the file within a WinFS store

Also, the beta currently does not have any interface to perform the query or searches we talked about. To do this, you need to use the WinFS API, which is part of the install, and create you own applications on the .NET 2.0 platform. A comprehensive set of documentation, code and samples are provided within the beta itself to do so. 

As you can see, desktop search is only the beginning of the way you organize and locate data. In the future with WinFS, the whole paradigm of data organization and collation will tend to shift to a relational model where performing a search will probably be the last thing you do instead of the first that you do today.

Vinod Unny, Enterprise Infotech

WinFS: Not just a file store

Although sitting atop the NTFS file system, WinFS is much more than just another way to organize your files. You can also organize elements like contacts, mail and media. The unit of WinFS is, therefore, a new element called ‘item’. You can have file-type items and contact-type items. Each type also has some other information associated with it. For instance, a media-type item can have a ‘Ratings’ data associated with it. There are other elements also called ‘Associations’. These provide the relationships between different item groups. Since this is part of the data structure itself, it becomes quite easy to do searches between associated data. 

One suitalble example is the articles we write for PCQ. We store them in a particular folder and images in another folder. While submitting the article, we create an archive of the DOC and the associated images by searching for them in the correct folders and e-mailing them. However, with WinFS associations, we’d simply link the article and the images to each other and be able to create an archive of all of them in one go. We could do it with: SELECT a.Filename, b.Filename FROM
Documents a, Images b WHERE a.Association=b.Association. You can create new schemas as well as extend existing ones quite easily using XML syntax. By extending the schema, you can add features to the WinFS storage model that don’t exist out of the box. For instance, you can create a new property for document items that allow you to tag them as Personal or Professional leading to even better organization of your documents-without needing to resort to folders.

No Comments so far

Jump into a conversation

No Comments Yet!

You can be the one to start a conversation.

Your data will be safe!Your e-mail address will not be published. Also other data will not be shared with third person.