Google Cloud Storage

High Performance that Just Works


Marc Cohen
May 2, 2012
Google Developers Live Hangout
Submit questions here

http://goo.gl/clxea

Google Trivia

http://goo.gl/clxea

About Me

http://goo.gl/clxea

Google Cloud Storage

Fast,
scalable,
secure,
reliable
storage:

not so easy.

Google faces some of the world's most demanding storage challenges:

http://goo.gl/clxea

We've met those challenges by inventing internal storage solutions that are:

http://goo.gl/clxea

Now you can take advantage of the same technology with Google Cloud Storage

http://goo.gl/clxea

Google has data centers all over the world to serve data, providing fast response times.

http://goo.gl/clxea

Controlling access to your data

Google Cloud Storage provides powerful and flexible sharing primitives based on Access Control Lists (ACLs).

http://goo.gl/clxea

Google Cloud Storage != Google Drive

Google DriveGoogle Cloud Storage
TargetConsumersDevelopers
OwnershipEnd user owns dataApplication ownws data
Billing/QuotasEnd UserApplication
User ExperienceConsumer (desktop/synch/drag & drop)Developer (command line tools and RESTful API)
Resource LimitsReasonable per user constraints (e.g. 10GB/file)Massive scalability (5TB/object)
MiscellaneousBuilt-in App Engine support (Files API) and integration with big data services
http://goo.gl/clxea

Usage Scenarios

http://goo.gl/clxea

Google Cloud Storage Manager (Web UI)

http://goo.gl/clxea

gsutil (Command Line Utility)

http://goo.gl/clxea

Continuous Innovation: recently added features...

http://goo.gl/clxea

Google App Engine Integration

# Create an object and write some data.
path = files.gs.create('/gs/my_bucket/my_object')
with files.open(path, 'a') as f:
  f.write('Hello World!\n')
files.finalize(path)

# Read data back out and display to web client.
with files.open(filename, 'r') as f:
  data = f.read()
self.response.out(data)

Challenge: find the OAuth logic. :)

More extensive example here. http://goo.gl/clxea

Detour: XMLHttpRequest (XHR)

function testGet() {
  var callback = function() {
    if ((this.readyState == 4) && (this.status == '200')) {
      alert("received: " + this.responseText);
    }
  };
  xmlHttp = new XMLHttpRequest();
  var url = "/marc-pres/GDL_050212/test.txt";
  xmlHttp.onreadystatechange = callback;
  xmlHttp.open("GET", url, true);
  xmlHttp.send();
}
<a href="#" onclick="testGet();">Get content using XHR</a>
Get content using XHR

Cross-Origin Resource Sharing (CORS) Demo

http://goo.gl/clxea

Accessing GCS items from the GAE images.Image class

class Transform(webapp.RequestHandler):
  _BUCKETNAME = 'your-bucket-name'
  def get(self):
      if self.request.get("itemname"):
        fname = '/gs/%s/%s' % (self._BUCKETNAME, self.request.get("itemname"))
        img = images.Image(filename=fname)
        if img:
          if self.request.get("thumb"):
            img.resize(width=200)
          if self.request.get("rotate"):
            img.rotate(90)
          img.im_feeling_lucky()
          transform = img.execute_transforms(output_encoding=images.JPEG)
          self.response.headers['Content-Type'] = 'image/jpeg'
          self.response.out.write(transform)
          return
      self.error(404)
http://goo.gl/clxea

Pricing

Monthly StoragePrice (per GB)
First 0 - 1TB$0.12
Next 9TB$0.105
Next 90TB$0.095
Next 400TB$0.085
Additional StorageContact Us

Additional charges apply for network/request usage. See our Pricing and Support page for further details. http://goo.gl/clxea

Formulating your storage strategy...

If you remember only one thing from this talk...



Google manages many petabytes of data on a planet-wide scale, securely, with sub-second response times, for hundreds of millions of users every day.



Focus on your customers and what you are good at and take advantage of Google's world class cloud computing services (rather than trying to build your own).

Choose a partner that does these sort of things, routinely, every day:

http://goo.gl/clxea

Image Credits


By the way, you're already using Google Cloud Storage - it's serving these slides. :)

Thanks for your attention!

http://goo.gl/clxea