Chapter 2. Understanding Swift

Swift is the oldest and probably the mature project within OpenStack. It is the underlying technology that powers Rackspace’s Cloud Files™ service. While it only interacts tangentially with Nova (as shown in Chapter 3), it is still important in the overall scheme of understanding OpenStack.

Swift aims to provide a massively scalable and redundant object store conceptually similar to Amazon’s S3 service. To provide this scalability and redundancy, it writes multiple copies of each object to multiple storage servers within separate “zones.” Zones are a logical grouping of storage servers that have been isolated from each other to guard against failures. The level of isolation is up to the cloud operator; they can be isolated on differing servers (ability to lose individual servers), different racks (ability to lose entire rack), different sections of the data center, or even different data centers. Each choice provides a different level of isolation and cost.

Caution

Many beginners assume that Swift will take the place of their file server and that they will be able to easily mount volumes on their desktops to access their files. This is not the case. Swift is an object store, not a file server. While these sound similar, there are important differences. Object stores simply save files in logical groupings (called “containers” in Swift parlance) via a RESTful protocol. They do not provide a true filesystem, nor are they accessible through standard file sharing protocols like NFS (Network File System, the standard for UNIX), CIFS (Common Internet File System, the standard for Windows), or AFS (Appleshare Files System, the standard for Mac OS X). To access your files, you will need to use a the Swift API client. These are described later in this chapter.

Swift is configurable in terms of how many copies (called “replicas”) are written, as well as how many zones are configured. Current best practices call for three replicas written across five zones. As the number of replicas is less than or equal to the number of zones, Swift tries to balance the writing of objects to storage servers so that the write and read load is distributed. This is illustrated in Figure 2-1.

The logical view of Swift can be divided into two logical parts: presentation and resource. The major components, data stores, and interactions are illustrated in Figure 2-2.



[1] Memcached is a free and open-source in-memory key-value store for caching small pieces of data.