Using StorageGRID Webscale to host Static Websites and Content

Introduction

 

NetApp's StorageGRID Webscale is a massively scalable, distributed, multi-site object store. It supports standard object protocols like S3 and OpenStack Swift and is suited to be deployed across many data centers (up to 16). In a multi-site deployment, e.g., across the US, Europe and Asia, StorageGRID provides a single namespace. This means, regardless where a user inserts data, it can be accessed from all locations. In the backend, data is replicated or Erasure Encoded to the different sites. Where data lands is driven by the administrator's policies or directly by meta-data which has been attached to the object.

 

While websites are usually dynamic and hosted on special webservers, many parts of them are actually static. Content like html files, download files, images, videos, and other content is usually static. In this post, we show how this data can be hosted on StorageGRID Webscale. This provides an easy way to serve static content that should be offered for e.g., download or streaming to clients in multiple geographies.

 

Hosting Website Content on StorageGRID Webscale

 

Firstly, we create a new bucket "bucket-website" which will hold our static website and its content (e.g., files, audio, images, videos, etc.). Next, we generate a JSON file to set the bucket policies for allowing public, non-authenticated read-only access to the bucket:

 

> cat website.json
{
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": "*",
      "Action": [
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": [
        "urn:sgws:s3:::website-bucket",
        "urn:sgws:s3:::website-bucket/*"
      ]
    }
  ]
}

With s3cmd, we apply the bucket policy to the bucket:

 

> s3cmd setpolicy website.json s3://website-bucket
s3://website-bucket/: Policy updated

 If we now point a browser to the bucket, we'll notice that we have access:

 

web1.jpg

Next, we'll upload our static website files and content into the bucket. If we refresh our browser, we'll see that the bucket has been populated:

 

web2.jpeg

 

All we now need to do is point the browser to the index.html file and we'll be able to browser the website:

 

web3.jpeg

 

If we point the browser to a file that we want to offer for download, the download would being.

 

Summary

 

StorageGRID Webscale allows you to easily host static websites and website content like large files, images, videos or audio files for download or streaming access. By using StorageGRID's policy engine and global namespace, this data can be easily distributed across many sites or worldwide. This allows users to access data at low latency and with high throughput, regardless of the location they are at.

 

If you have questions, feel free to reach out to me on Twitter: @clemenssiebler