Register Log in

Infinite Loop / The Apple Ecosystem

Metadata, the Mac, and you


Metadata is simply "data about data." Within the context of the computer industry, the most common domain of metadata is the file system. Files contain data, which has some amount of associated metadata. The most fundamental property of metadata is that it is distinct from the data itself. Again, that is the very definition of metadata: data about data.

It's a simple concept, but it's also a surprisingly fertile topic for debate. The introduction of Mac OS X has brought this topic to the forefront of the larger battle for the future of the Mac platform. To understand why, we'll examine the fundamentals of file metadata (or simply "metadata" henceforth), and explore the past, present, and future of metadata on the Mac, and in the computer industry as a whole.

There is one important assumption to keep in mind. This article will generally confine itself to the contemporary concept of files and file systems. Object-relational storage or other such divergences from the familiar files and directories common today will be touched upon in later sections, but will not be considered in the main body of the article in order to keep the focus manageable.

There are also some assumptions to avoid. The first part of this article will talk about the fundamental concepts of metadata, irrespective of any implementation issues (with the exception of the single, focus-narrowing assumption listed above). While reading about the fundamentals of metadata, technically inclined readers (that's everyone who reads Ars, right? ;-) may find it very difficult to avoid slipping into thoughts of actual implementations they are familiar with. Don't do this. Try to concentrate on the concepts being presented without making judgments or coming to conclusions based on particular implementations or standards you may be familiar with. We'll get to all that later in the article, after the fundamentals have been established.


To illustrate the fundamentals of metadata, let's start with a hypothetical file. Without any metadata, this file is just data: a bunch of bits. What kind of "data about this data" can we come up with? Let's make a list.

    • The file's name. This is an essential piece of metadata, given the assumption listed earlier regarding the concept of a file. A file's name is an essential part of the access mechanism in a traditional file system.
    • The file's location. We need more than just the name to uniquely select a file in a traditional file system. A file's location is some combination of the host, disk, and directory structure where the file is located. A file may be uniquely selected by combining the file's name and the file's location into a single identifier (often called the "path" to the file).

      Most people are not accustomed to thinking about a file's location as a piece of metadata associated with the file itself. This is your first test: are you thinking about "data about data" at the conceptual level, or have you already slipped into an implementation mindset and snorted derisively at the idea of file locations as metadata?

Think about it. A file's location is certainly "data about the data." In fact, it's essential data about the data. (We'll make some distinctions about different types of metadata later.)

  • The nature of the file's data. What does the file's data represent? What is the file? Is it an image? A movie? Text? This concept is also called the file's "content type" or just the file's "type." There are many levels of detail possible, from basic classification (image, audio, video, text, etc.) to specific file "formats" (JPEG, AIFF, MPEG2, Microsoft Word, etc.), or even very specific incarnations of particular formats (GIF89a, Photoshop document with layers, Microsoft Word 6.0/95, etc.)
  • The file's size. The data in a file has a size, even if it's zero. Again, this is not what most people think about when they think of metadata, but it most certainly fits the bill. Like file name and location, it's another essential piece of information about the file. (Imagine the limitations of a file system where a file's size was unknown!)
  • File dates. There are many useful dates one can imagine associating with a file: creation date, date of last data modification, date of last metadata modification, date of last data access, and so on.
  • File permissions. Like file dates, there are many possible variants of this metadata. Who can read this file? Who can write to it? Who can run it, if it's executable? Etc.

I'm going to stop the list now, but not because it's in any way complete. I'm sure you can think of many more pieces of metadata that are applicable to a file, especially if you focus on metadata that may only be applicable to particular types of files. For our purposes, I just wanted to cover a set of basic metadata that spans a conceptual range, which we'll explore next.

Types of Metadata

Take another look at the short list of file metadata we came up with:

  • Name
  • Location
  • Type
  • Size
  • Dates
  • Permissions

If you had to divide this list into groups, how would you do it? Are there certain pieces of metadata that share common traits? Think about it before continuing.

<pause for thought>

Let's start with permissions. This is metadata in the traditional sense familiar to most people. It describes the access rights for the data (in some implementation-specific way that you shouldn't be concerned with right now, remember? :-)

The nature of file permissions as metadata is best illustrated by changing them. Despite the fact that file permissions are indeed data about the file's data (who/what can do XYZ to this data?), they may be changed without regard for the data itself.

What other pieces of metadata from our list share this quality? Name and location seem to fit the bill. Changing a file's location, for example, does not imply a change to the file's data.

Some file dates also exhibit this quality. Creation date and possibly the last access data (assuming read-only access) also may change with complete independence from the data that they are associated with. (Modification date, on the other hand, should not change unless the data itself has been (duh) modified.)

We'll call these pieces of metadata (name, location, permissions, and some kinds of dates) "independent metadata" to signify their ability to be changed independent of any changes to the data itself.

We've already grouped more than half the list ("three and a half" out of the six) into this category. Independent metadata is the most common type of metadata. Almost all metadata can be changed without requiring changes to the data itself. But independednt metadata is not necessarily the most important type of metadata. Let's look at another type, using file size as our first example.

Size is an essential piece of metadata, but like location, it is rarely thought of as metadata. Why is that? Perhaps it's because it's so essential that its presence is taken for granted. After all, if the extent of the file (i.e. its size) cannot be determined, the file is nearly useless! For example, how would the operating system know when to stop reading data from a file without any information about its size?

A file's size is an example of what I'm going to call "immutable metadata" in that in that it is metadata that cannot change for any given set of data. In other words, immutable metadata may not change unless the data itself also changes. Immutable metadata can also be thought of as "data-dependent" metadata, but I have chosen to call it "immutable" to emphasize that it cannot be changed directly. The immutable metadata associated with a given set of bits (i.e. data) is indeed immutable. The only way to get different immutable metadata is to get different data.

Think about the consequences of violating the constraints of immutable metadata. Imagine a scenario in which the "size" metadata for a file was changed without any change to the actual data! Immutable metadata is worse than useless if it is not completely tied to the state of the data itself.

The concept of a file's size as "immutable metadata" may be difficult to get your head around, particularly since we're so used to thinking of a file's size as something that is "derived from" the data itself, rather than simply "associated with" the data like the independent metadata described earlier. But that's the very definition of immutable metadata: it is metadata that is inexorably tied to the data itself.

Modification date was touched on earlier, and is another example of immutable metadata. The modification date is changed in response to an accompanying change to the data itself. Changing a file's modification date without changing the data itself is not as disastrous as doing the same thing to a file's size metadata, but it is certainly not "correct" behavior.

Finally, there's the file's content type. This too is immutable metadata. A file's content type, by definition, cannot change unless the data itself also changes.

Thoughtful readers may have already realized that there is one case where immutable metadata may change without requiring a change to the data itself. Immutable metadata may change to increase (or decrease, of course) its accuracy. For example, a file may have associated file type metadata that identifies it as a GIF image. At some point in the future, it may become known that the file is actually an interlaced GIF89a. The file type metadata may be changed to reflect this increased accuracy without requiring a change to the data itself. Similarly, a file's modification date may be increased to millisecond accuracy, and so on.

This leads to some more general rules for metadata. Like all forms of information, more is generally better. More metadata with greater detail makes more interesting decisions possible. Without permissions metadata, for example, it is much more difficult to make intelligent decisions regarding access to a file's data. And if a file's creation date only includes the year, it becomes impossible to distinguish the relative ages of files created within a given year. Information is power.

One final note on metadata which may seem obvious, but which will become a factor later on. Like all forms of information, metadata is easy to remove or ignore, but it is often difficult (or impossible) to add once it is lost. If you no longer know when a file was last modified, you cannot recover that piece of information (despite the fact that the modification date is immutable metadata completely tied to the data itself). The data itself remains, but the information about when that data was last modified is lost. To use an analogy, think of lossy compression. You can convert a CD track into an MP3 file, but you cannot convert an MP3 file back into the uncompressed audio from the CD. You cannot "add" unknown information. Information is precious.

Expand full story

You must to comment.

Need to register for a new account?

If you don't have an account yet it's free and easy.