{"id":205,"date":"2014-09-10T00:22:57","date_gmt":"2014-09-10T00:22:57","guid":{"rendered":"http:\/\/outworx.com\/blog\/?p=205"},"modified":"2017-01-20T07:41:51","modified_gmt":"2017-01-20T07:41:51","slug":"swift-intro","status":"publish","type":"post","link":"https:\/\/www.outworx.com\/blog\/swift-intro\/","title":{"rendered":"Introduction to OpenStack Swift Object Storage"},"content":{"rendered":"<p>This article is a general introduction to Swift, OpenStack&#8217;s Object Storage.\u00a0 We will cover the following topics: what Swift is, what kind of data you can store in Swift, how Swift controls access to your data, how Swift protects that data using replication or erasure codes, where to find development resources for Swift? and much more.<\/p>\n<h3><strong><span style=\"color: #808080;\">What is Swift?<\/span><\/strong><\/h3>\n<p>Conceptually, Swift is similar to Amazon&#8217;s S3 or Microsoft Azure&#8217;s Blob Storage.\u00a0 It allows you to store any kind of unstructured data using a web-based API.<\/p>\n<p>Swift is designed to scale to billions of objects and petabytes of storage.\u00a0 Swift does not require any special hardware.\u00a0 It runs on commodity servers with normal disks.\u00a0 However, plugins allow it to use filers from NetApp, Solidfire, and others if so desired.<\/p>\n<p>The Swift software uses a distributed, shared nothing model.\u00a0 Since there is no central database or node to act as a bottleneck, it has tremendous horizontal scaling.\u00a0 To get more capacity, you simply have to add more nodes.\u00a0 Swift stores the data redundantly. \u00a0 If a server or disk fails, Swift uses the data on the surviving hardware to restore the data to its full level of redundancy.<\/p>\n<p>Physically, Swift is set-up as a set of nodes in a cluster.\u00a0 A proxy node receives incoming requests and directs them to storage nodes where the actual data resides.\u00a0 OpenStack <a title=\"OpenStack recommendation on number of storage nodes\" href=\"http:\/\/docs.openstack.org\/icehouse\/install-guide\/install\/apt\/content\/before-you-begin-swift-install.html\" target=\"_blank\">recommends a minimum of 5 storage nodes<\/a> for production use, so Swift takes some hardware to set-up.<\/p>\n<p>Swift stores its objects in containers.\u00a0 Each user&#8217;s storage account can have as many containers as they want.\u00a0 Each object is associated with a single container.\u00a0 An object is referenced by a URL of the form:<\/p>\n<p>https:\/\/&lt;storage_account_name&gt;\/&lt;container name&gt;\/&lt;object&gt;<\/p>\n<p>One thing to note is that containers cannot be nested.\u00a0 You cannot have a container within a container.\u00a0 But you can <a title=\"Swift documentation on pseudo-hiearchies\" href=\"http:\/\/docs.openstack.org\/api\/openstack-object-storage\/1.0\/content\/pseudo-hierarchical-folders-directories.html\" target=\"_blank\">simulate a pseudo-hierarchy<\/a>, albeit with some extra effort, by adding slashes in the objects name and doing special <em>list<\/em> operations.<\/p>\n<h3>\u00a0<strong><span style=\"color: #808080;\">What Can You Store in Swift?<\/span><\/strong><\/h3>\n<p>Pretty much anything you want.\u00a0 An object can contain a document, photos, music, back-ups, VM images, or any other piece of unstructured data.\u00a0 Swift is set-up to let you access individual objects individually via their URLs.\u00a0 It does not organize the data into tables like HBase or store relationships between data like MySQL.\u00a0 Nor is it a filesystem.\u00a0 A container name is the only organization that it offers to the data.<\/p>\n<p>That said, Swift is very powerful.\u00a0 Since the data is accessible via a URL, it is easy to access it from anywhere on the Internet.\u00a0 It can be easily accessed from cell phones, PCs, or a variety of devices.\u00a0 And the ability to store objects can mesh very nicely with object oriented programming when it needs to persist data.<\/p>\n<h3>\u00a0<span style=\"color: #808080;\"><strong>How Swift Controls Access to Your Data<\/strong><\/span><\/h3>\n<p>Although Swift can be run stand-alone, most commonly it is run as part of OpenStack.\u00a0 In this configuration, authentication is done through Keystone, the OpenStack Authentication Server.\u00a0 Once the user has presented credentials to Keystone, he is given an authentication token which is valid for 24 hours.\u00a0 This token proves that the user is the owner of the Swift storage account.\u00a0 By default, only the owner can access the account.<\/p>\n<p>The owner can define individual Access Control Lists (ACLs) for each container.\u00a0 The owner can grant read and\/or write access to everyone, various groups, referrer hosts, or domains.\u00a0\u00a0 For more details, see the <a title=\"Swift ACLs\" href=\"http:\/\/docs.openstack.org\/developer\/swift\/misc.html#acls\" target=\"_blank\">ACL section<\/a> of the API doc.<\/p>\n<p>Finally, Swift has a temporary URL feature.\u00a0 This allows a third party to access an object using a URL that will expire in within a certain amount of time.\u00a0 This is useful for doing things like mailing temporary download links to people.<\/p>\n<h3><span style=\"color: #808080;\"><strong>\u00a0How Swift Protects Data Using Replication or Erasure Codes<\/strong><\/span><\/h3>\n<p>By default, Swift replicates each object three times.\u00a0 When storing the copies, it tries to spread them out over different servers and disks so the failure of a single component won&#8217;t cause lost data.\u00a0 The number of replicas for each object is configurable by the administrator.<\/p>\n<p>Erasure codes use less storage than replicas.\u00a0 Rather than duplicating the complete object multiple times, parity data is created much like RAID.\u00a0 This can reduce the amount of storage for an object from 3X to 1.2X.\u00a0 For cold data which is simply being archived, this can be a tremendous win.\u00a0 Rackspace has a more detailed description of Swift erasure codes <a href=\"http:\/\/www.rackspace.com\/blog\/object-storage-tomorrow-erasure-coding\/\">here<\/a>.<\/p>\n<p>Erasure coding isn&#8217;t in Swift yet, but the development community will be working on it throughout this year.<\/p>\n<h3><strong><span style=\"color: #808080;\">Where to Find Development Resources for Swift<\/span><\/strong><\/h3>\n<p>The OpenStack foundation has <a title=\"Swift Documentation\" href=\"http:\/\/docs.openstack.org\/developer\/swift\/\" target=\"_blank\">online documentation for Swift<\/a>.\u00a0 The <a title=\"Swift Associated Projects\" href=\"http:\/\/docs.openstack.org\/developer\/swift\/associated_projects.html#associated-projects\" target=\"_blank\">Associated Projects<\/a> page for Swift has API bindings for various languages.\u00a0 The only officially supported binding is for Python, but there are others for PHP, Java, and C#.\u00a0 Finally, if you have questions, you can always ask the <a title=\"OpenStack Community\" href=\"http:\/\/http:\/\/www.openstack.org\/community\" target=\"_blank\">OpenStack community<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is a general introduction to Swift, OpenStack&#8217;s Object Storage.\u00a0 We will cover the following topics: what Swift is, what kind of data you can store in Swift, how Swift controls access to your data, how Swift protects that data using replication or erasure codes, where to find development resources for Swift? and much &hellip; <a href=\"https:\/\/www.outworx.com\/blog\/swift-intro\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Introduction to OpenStack Swift Object Storage&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"xn-wppe-expiration":[],"xn-wppe-expiration-action":[],"xn-wppe-expiration-prefix":[],"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"categories":[16,11,12],"tags":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Introduction to OpenStack Swift Object Storage | OutworX<\/title>\n<meta name=\"description\" content=\"Introduction to OpenStack Swift Object Storage.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.outworx.com\/blog\/swift-intro\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introduction to OpenStack Swift Object Storage | OutworX\" \/>\n<meta property=\"og:description\" content=\"Introduction to OpenStack Swift Object Storage.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.outworx.com\/blog\/swift-intro\/\" \/>\n<meta property=\"og:site_name\" content=\"OutworX\" \/>\n<meta property=\"article:published_time\" content=\"2014-09-10T00:22:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-01-20T07:41:51+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.outworx.com\/blog\/#website\",\"url\":\"https:\/\/www.outworx.com\/blog\/\",\"name\":\"OutworX\",\"description\":\"Blogs, News and Updates of IT Industry | OutworX\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.outworx.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.outworx.com\/blog\/swift-intro\/#webpage\",\"url\":\"https:\/\/www.outworx.com\/blog\/swift-intro\/\",\"name\":\"Introduction to OpenStack Swift Object Storage | OutworX\",\"isPartOf\":{\"@id\":\"https:\/\/www.outworx.com\/blog\/#website\"},\"datePublished\":\"2014-09-10T00:22:57+00:00\",\"dateModified\":\"2017-01-20T07:41:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.outworx.com\/blog\/#\/schema\/person\/4a222258173fdc00e104b30c5fc10632\"},\"description\":\"Introduction to OpenStack Swift Object Storage.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.outworx.com\/blog\/swift-intro\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.outworx.com\/blog\/swift-intro\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.outworx.com\/blog\/swift-intro\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.outworx.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introduction to OpenStack Swift Object Storage\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.outworx.com\/blog\/#\/schema\/person\/4a222258173fdc00e104b30c5fc10632\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.outworx.com\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/91f39a5ea2f90d0d957945f581465a21?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/91f39a5ea2f90d0d957945f581465a21?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"description\":\"Outworx@Admin\",\"url\":\"https:\/\/www.outworx.com\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Introduction to OpenStack Swift Object Storage | OutworX","description":"Introduction to OpenStack Swift Object Storage.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.outworx.com\/blog\/swift-intro\/","og_locale":"en_US","og_type":"article","og_title":"Introduction to OpenStack Swift Object Storage | OutworX","og_description":"Introduction to OpenStack Swift Object Storage.","og_url":"https:\/\/www.outworx.com\/blog\/swift-intro\/","og_site_name":"OutworX","article_published_time":"2014-09-10T00:22:57+00:00","article_modified_time":"2017-01-20T07:41:51+00:00","twitter_misc":{"Written by":"admin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.outworx.com\/blog\/#website","url":"https:\/\/www.outworx.com\/blog\/","name":"OutworX","description":"Blogs, News and Updates of IT Industry | OutworX","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.outworx.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.outworx.com\/blog\/swift-intro\/#webpage","url":"https:\/\/www.outworx.com\/blog\/swift-intro\/","name":"Introduction to OpenStack Swift Object Storage | OutworX","isPartOf":{"@id":"https:\/\/www.outworx.com\/blog\/#website"},"datePublished":"2014-09-10T00:22:57+00:00","dateModified":"2017-01-20T07:41:51+00:00","author":{"@id":"https:\/\/www.outworx.com\/blog\/#\/schema\/person\/4a222258173fdc00e104b30c5fc10632"},"description":"Introduction to OpenStack Swift Object Storage.","breadcrumb":{"@id":"https:\/\/www.outworx.com\/blog\/swift-intro\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.outworx.com\/blog\/swift-intro\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.outworx.com\/blog\/swift-intro\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.outworx.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Introduction to OpenStack Swift Object Storage"}]},{"@type":"Person","@id":"https:\/\/www.outworx.com\/blog\/#\/schema\/person\/4a222258173fdc00e104b30c5fc10632","name":"admin","image":{"@type":"ImageObject","@id":"https:\/\/www.outworx.com\/blog\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/91f39a5ea2f90d0d957945f581465a21?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/91f39a5ea2f90d0d957945f581465a21?s=96&d=mm&r=g","caption":"admin"},"description":"Outworx@Admin","url":"https:\/\/www.outworx.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.outworx.com\/blog\/wp-json\/wp\/v2\/posts\/205"}],"collection":[{"href":"https:\/\/www.outworx.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.outworx.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.outworx.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.outworx.com\/blog\/wp-json\/wp\/v2\/comments?post=205"}],"version-history":[{"count":13,"href":"https:\/\/www.outworx.com\/blog\/wp-json\/wp\/v2\/posts\/205\/revisions"}],"predecessor-version":[{"id":897,"href":"https:\/\/www.outworx.com\/blog\/wp-json\/wp\/v2\/posts\/205\/revisions\/897"}],"wp:attachment":[{"href":"https:\/\/www.outworx.com\/blog\/wp-json\/wp\/v2\/media?parent=205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.outworx.com\/blog\/wp-json\/wp\/v2\/categories?post=205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.outworx.com\/blog\/wp-json\/wp\/v2\/tags?post=205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}