Showing posts with label cloud platform. Show all posts
Showing posts with label cloud platform. Show all posts

Wednesday, August 7, 2013

Google Cloud Platform enhances Compute Engine, App Engine and Cloud Datastore

Author PictureBy Greg DeMichillie, Google Cloud Platform team

Cross-posted from the Google Cloud Platform blog

Today’s updates to Google Cloud Platform bring lots of new enhancements complementing features we first shared at I/O. Check out the latest additions: Load balancing now available on Google Compute Engine
We’ve now added layer 3 load balancing to Compute Engine, which delivers Google-scale throughput and fault tolerance to manage Internet applications. Load balancing is critical in any highly scalable system, allowing you to automatically and intelligently route traffic across a collection of servers.

With the load balancing service, you can:
  • Load-balance ingress network TCP/UDP traffic over a specific set of Compute Engine virtual machines (VMs) within the same region
  • Ensure that only healthy VMs are used to serve Internet requests through the use of HTTP-based health checks
  • Easily handle spikes in load without pre-warming
  • Configure the load balancer via command line interface (CLI) and a programmatic RESTful API
This initial release provides Layer 3 support and we’ll continue to expand its capabilities on a regular basis. We’re pleased to offer the load balancing feature at no cost through the end of 2013, after which we’ll charge the rates outlined on our pricing page.

Improved developer experience for Google Cloud Datastore
Cloud development tools should enhance developer productivity, and that’s what we focused on with the latest update to Cloud Datastore.

Google Query Language (GQL) Support
Being able to search for data lies at the heart of all data-driven applications, and we’ve made that easier by adding GQL support — a SQL-like language for retrieving entities or keys from Cloud Datastore.

Metadata queries
You can now access Metadata Queries that allow you to retrieve statistics on their underlying data. This is useful when building your internal administration consoles, performing custom analysis or simply debugging an application.

Local SDK improvements
Part of providing great developer experiences is allowing developers to make changes in a fast, efficient and cost-effective way. That’s why we’ve made numerous enhancements to the command line tool. Separately, we’ve also included support for those of you who use Microsoft Windows.

Getting started with Ruby
If there is one thing that developers are passionate about (us included) it’s languages. The initial release of Cloud Datastore included code snippets and samples for getting up and running with Java, Python and Node. With the latest release, we’ve included the same Cloud Datastore support for Ruby developers — allowing you to easily spin up Ruby applications that rely on a managed NoSQL datastore.

Updates to the PHP runtime in Google App Engine 1.8.3
We’ve been listening to feedback from early developers using the PHP runtime, so our latest App Engine release is dedicated to PHP. But there are still a few new goodies for those of you not using PHP, which you can find in the release notes.

Our integration with Google Cloud Storage for reading and writing files has proven to be popular, so we expanded this in 1.8.3. Our latest update includes:
  • improved support for working with directories in Google Cloud Storage — allowing you to call functions such as opendir() or writedir() directly on Cloud Storage buckets
  • support for functions related to stat()-ing files, such as is_readable() and is_file()
  • the ability to write metadata to Cloud Storage files
  • substantial performance improvements through memcache-backed optimistic read caching — this improves the performance of applications that need to read frequently from the same Cloud Storage file
  • numerous bug fixes
We’ve also improved support for task queues, including the ability to set headers on push tasks and to add tasks to queues efficiently in bulk using the new PushTask:addTasks() method.

We hope you enjoy the new Cloud Platform features!

Greg DeMichillie has spent his entire career working on developer platforms for web, mobile, and the cloud. He started as a software engineer before making the jump to Product Management. When not coding, he's an avid photographer and gadget geek.

Posted by Ashleigh Rentz, Editor Emerita

Monday, August 5, 2013

Getting started with Twilio on Google App Engine for PHP

Author Photo
This guest post was written by Keith Casey, Sr. Developer Evangelist for Twilio

Cross-posted from the Google Cloud Platform Blog


I’ve wanted to explore Google App Engine for years. Between its SLA, automatic scaling, and queuing system, it has always been compelling. Unfortunately, since my Python skills are somewhere between “Hello World” and “OMG What did I just do!?” I decided to save myself the embarrassment. When Google announced PHP support for App Engine, I was both ecstatic and intrigued about what might be possible. To get something running in just a few minutes, I decided to use our Twilio PHP helper.

When experimenting with a new Platform as a Service, there are nuances of which you should be aware like dealing with a virtualized file system and needing a separate service for email. However, the remaining nuances are usually pretty minimal and required only the “tweaking of my module” rather than a heavy “rebuilding of my app”.

Knowing that up front, let’s dig in.

Set up the PHP on App Engine environment

First, check out and follow Google’s Getting started with PHP on Google App Engine to set up your local environment. Their instructions will cover setting up the SDK, connecting to your account, and some details on debugging. It should set up your environment under http://localhost:8080/ which serves as the root of your application.

Upgrade your Twilio Helper library

Next, with respect to Twilio’s PHP Helper library, we’ve taken care of the nuances for you, the most important one of which involved falling back to PHP’s Streams when cUrl isn’t available. In your case, simply upgrade the library to v3.11+ or install it for the first time. You can use the library to send text messages and make phone calls exactly as you would in any other PHP environment:

<?php
// Include the Twilio PHP library
require "Services/Twilio.php";

// Set your AccountSid and AuthToken from www.twilio.com/user/account
$AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$AuthToken = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY";

// Instantiate a new Twilio Rest Client
$client = new Services_Twilio($AccountSid, $AuthToken);

// Make an array of people we know, to send them a message:
$people = array(
"+14158675309" => "Curious George",
"+14158675310" => "Boots",
"+14158675311" => "Virgil",
);

// Loop over all our friends:
foreach ($people as $number => $name) {

$sms = $client->account->sms_messages->create(
"YYY-YYY-YYYY", // Change the 'From' number to a Twilio number you've purchased
$number, // the number we are sending to - Any phone number
"Hey $name, Monkey Party at 6PM. Bring Bananas!" // the sms body
);

echo "Sent message to $name"; // Display a confirmation message
}

If you’re interested in the the specific changes for our library, you can explore the relevant pull requests here and here. I also have an article called “Preparing your PHP for App Engine” in next month’s php|architect magazine.

URL Routing in PHP

Within App Engine, the entire routing system is powered by the app.yaml file. If you’re familiar with development using frameworks like Zend or Symfony, defining your routes will come naturally and may be marginally more difficult than copy/paste. If you’re only familiar with doing non-framework development in PHP, you’ll have to define a route for each and every PHP file the user accesses. In Google’s example “hello world” app, your app.yaml file should should begin with something like this:

application: examplehelloworld
version: 1
runtime: php
api_version: 1
threadsafe: true

handlers:
- url: .*
script: main.php

The request handlers are the important part. If you’re using an MVC framework or OpenVBX, you’ll most likely have one primary element mapping your index.php file and a set of elements for static assets like JavaScript, CSS, and images.

Alternatively, if you’re not using a using a framework, app.yaml will map different URL patterns to individual PHP scripts, like this:
application: examplehelloworld
version: 1
runtime: php
api_version: 1
threadsafe: true

handlers:
- url: /images
static_dir: images

- url: /send-sms
script: send-sms.php

- url: /make-call
script: make-call.php

- url: .*
script: index.php

Within those individual PHP scripts, no changes are necessary, so our make-call.php is straightforward and identical to our quickstart:
<?php

require 'Services/Twilio.php';
include 'credentials.php';

$client = new Services_Twilio($AccountSid, $AuthToken);

$call = $client->account->calls->create(
'1512-555-1212', // From this number
'17035551212', // Send to this number
'http://twimlets.com/echo?Twiml=%3CResponse%3E%3CSay%3EHello%20Monkey!%3C%2FSay%3E%3C%2FResponse%3E&'
);
print $call->sid;

Also, the send-sms.php can be the same as our normal quickstart:
<?php

require 'Services/Twilio.php';
include 'credentials.php';

$client = new Services_Twilio($AccountSid, $AuthToken);

$call = $client->account->sms_messages->create(
'1512-555-1212', // From this number
'17035551212', // Send to this number
'Hello monkey!!'
);
print $call->sid;

Now you can access your scripts via http://localhost:8080/make-call.php and http://localhost:8080/send-sms.php respectively. If the file is one that doesn’t need to be accessible publicly, such as your credentials.php file, it shouldn’t have a listing.

Voila. You now have your first PHP application on Google App Engine!

I hope this is helpful as you test and deploy your PHP applications on Google App Engine. If you have any tips, feedback, suggestions, or just a good joke please let me know via email or Twitter: @CaseySoftware.


Keith Casey currently serves as a Developer Evangelist for Twilio to get good tools to good developers so they can change how businesses communicate. In his spare time, he is a core contributor to web2project, works to build and support the Austin technology community, blogs occasionally at CaseySoftware.com and is completely fascinated by monkeys.

Posted by Ashleigh Rentz, Editor Emerita

Wednesday, July 31, 2013

How Safari Books Online uses Google BigQuery for business intelligence

This guest post was written by Daniel Peter, Senior Programmer Analyst at Safari Books Online.

Cross-posted from the Google Cloud Platform Blog

Safari Books Online is a subscription service for individuals and organizations to access a growing library of over 30,000 technology and business books and videos. Our customers browse and search the library from web browsers and mobile devices, generating powerful usage data which we can use to improve our service and increase profitability. We wanted to quickly and easily build dashboards, improve the effectiveness of our sales teams and enable ad-hoc queries to answer specific business questions. With billions of records, we found it challenging to get the answers to our questions fast enough with our existing MySQL databases.

Looking for alternative solutions to build our dashboards and enable interactive ad-hoc querying, we played with several technologies, including Hadoop. In the end, we decided to use Google BigQuery.

Here’s how we pipe data into BigQuery:



Our data starts in our CDN and server logs, gets packaged up into compressed files, and runs through our ETL server before finishing in BigQuery.

Here’s one of the dashboards we built using the data:



You can see that with the help of BigQuery, we can easily categorize our books. This dashboard shows popular books by desktop and mobile, and with BigQuery, we are able to run quick queries to dive into other usage patterns as well.

BigQuery has been very valuable for our company, and we’re just scratching the surface of what is possible.

Check out the article for more details on how we manage our import jobs, transform our data, build our dashboards, detect abuse and improve our sales team's effectiveness.


Posted by Scott Knaster, Editor

Monday, June 24, 2013

Get coding faster thanks to little green buttons

Author Photo
By Fred Sauer, Developer Advocate

Cross-posted from the Google Cloud Platform Blog

On the Google Cloud Platform team we're always looking for ways to make developers' lives easier, so you can focus on building interesting applications instead of worrying about managing infrastructure.

We also want you to be as productive as possible when you're busy writing code. We provide an SDK which offers access to production APIs, in a way that's compatible with a local development environment.


But sometimes you just want to dip your toes in the water, and the prospect of setting up a local development environment seems daunting. What if you just want to try out some sample code? What if you want to see how the actual production APIs will behave? What if you could share a code snippet with a colleague and your entire environment came along for the ride? What if there was a playground where you could try out APIs, all from within your web browser?

We asked ourselves these same questions and decided to try an experiment: we created a Cloud Playground, a place for you to quickly test production APIs you're interested in using. Note: the Cloud Playground is currently limited to Python 2.7 App Engine apps.

To get you started, we added little green buttons to our getting started documentation, which take you straight to the Cloud Playground where you can edit and run the guestbook sample code as it appears in the documentation.


In addition, the main Cloud Playground page offers easy access to many more samples. There's even an option to clone other open source App Engine Python 2.7 template projects from Github.


How does it work? The Cloud Playground is itself an open source project and consists of two modules:
  • mimic is a regular Python App Engine app, which serves as a development server (similar to the App Engine SDK "dev_appserver"), but which runs in the production App Engine environment, providing you access to the production APIs and environment while still offering a quick and easy way to test out bits of code.
  • bliss is a trivial browser-based code editor which lets you edit code in the mimic virtual file system (backed by the App Engine datastore), providing you with a user interface so you can see what the mimic app can do for you.
We previously blogged about DevTable which also uses mimic to speed up refresh cycles for their App Engine developers.

We look forward to seeing what you're able to build.


Fred Sauer is a Developer Advocate for the Google Cloud Platform and long-standing member of the Google App Engine team. Fred hacks in a number of open source projects for fun and maintains a particular interest in game and web development.

Posted by Scott Knaster, Editor

Wednesday, June 19, 2013

Google Developers Live: our first year

Author Photo
By Louis Gray, Program Manager, Google Developers Live

One year ago, we took the magic of Google I/O and brought it home with Google Developers Live (+GDL)  - engaging with our developer community all year round, live, from our offices around the world. Nearly 1,000 videos and several million views later, we’ve seen you connect with Googlers and industry experts every day, gaining knowledge, sharing insights, and getting feedback on how to create incredible apps and leverage Google’s tools.

Thanks to the combination of Google+ Hangouts and YouTube Live, you can now see our engineers face to face and gain up to the minute insights on +Android+Google Chrome+Google Cloud Platform, and many more.

But Google Developers Live is not just all Google products, all the time. It’s an interactive platform for innovative applications, design wizards and entrepreneurs. We’ve hosted initiatives like Women Techmakers, Google Top Geek from Mexico City, Android Design In Action and Root Access, and we hear directly from the minds behind applications many of us use every day.



It was on GDL where we saw Google Fellow +Sebastian Thrun introduce a new HTML5 course on Udacity. GDL debuted the Mirror API for +Project Glass. And it was on GDL where we first demonstrated YouTube API v3, went behind the scenes with Santa Tracker, and answered questions on the Blink rendering engine.

And when we returned to I/O last month, it was Google Developers Live with wall-to-wall broadcasts, featuring exceptional guests like Megan Smith of Google[x], Bradley Horowitz of Google+ and Hiroshi Lockheimer and Hugo Barra of Android.

While we love the live interaction, Google Developers Live is more than just live. Our archives make it easy for you to watch on your own schedule - in any order, on any product.

Although GDL is only a year old, we’re now broadcasting from Mountain View, New York, Sydney, Tokyo, Milan, Moscow, Buenos Aires, and many places around the world, to bring you the latest Google tools for developers in your time zone, in your language. And we’ve got a lot more planned. So make sure you don’t miss a show, by subscribing to Google Developers on YouTube and staying tuned to https://developers.google.com/live/.


+Louis Gray is a Program Manager on Google's Developer Relations Team, running Google Developers Live. He believes life is but a (live) stream.

Posted by +Scott Knaster, Editor

Tuesday, June 11, 2013

Google BigQuery new features: bigger, faster, smarter

Author PictureBy Felipe Hoffa, Cloud Platform team

Google BigQuery is designed to make it easy to analyze large amounts of data quickly. Today we announced several updates that give BigQuery the ability to handle arbitrarily large result sets, use window functions for advanced analytics, and cache query results. You are also getting new UI features, larger interactive quotas, and a new convenient tiered pricing scheme. In this post we'll dig further into the technical details of these new features.

Large results

BigQuery is able to process terabytes of data, but until today BigQuery could only output up to 128 MB of compressed data per query. Many of you asked for more and from now on BigQuery will be able to output results as large as the largest tables our customers have ever had.

To get this benefit, you should enable the new "--allow_large_results" flag when issuing a query job, and specify a destination table. All results will be saved to the new specified table (or appended, if the table exists). In the updated web UI these options can be found under the new "Enable Options" menu.

With this feature, you can run big transformations on your tables, plus get big subsets of data to further analyze from the new table.

Analytic functions

BigQuery's power is in the ability to interactively run aggregate queries over terabytes of data, but sometimes counts and averages are not enough. That's why BigQuery also lets you calculate quantiles, variance and standard deviation, as well as other advanced functions.

To make BigQuery even more powerful, today we are adding support for window functions (also known as "analytical functions") for ranking, percentiles, and relative row navigation. These new functions give you different ways to rank results, explore distributions and percentiles, and traverse results without the need for a self join.

To introduce these functions with an advanced example, let's use the dataset we collected from the Data Sensing Lab at Google I/O. With the percentile_cont() function it's easy to get the median temperature over each room:


SELECT percentile_cont(0.5) OVER (PARTITION BY room ORDER BY data) AS median, room
FROM [io_sensor_data.moscone_io13]
WHERE sensortype='temperature'

In this example, each original data row shows the median temperature for each room. To visualize it better, it's a good idea to group all results by room with an outer query:


SELECT MAX(median) AS median, room FROM (
SELECT percentile_cont(0.5) OVER (PARTITION BY room ORDER BY data) AS median, room
FROM [io_sensor_data.moscone_io13]
WHERE sensortype='temperature'
)
GROUP BY room

We can add an additional outer query, to rank the rooms according to which one had the coldest median temperature. We'll use one of the new ranking window functions, dense_rank():


SELECT DENSE_RANK() OVER (ORDER BY median) rank, median, room FROM (
SELECT MAX(median) AS median, room FROM (
SELECT percentile_cont(0.5) OVER (PARTITION BY room ORDER BY data) AS median, room
FROM [io_sensor_data.moscone_io13]
WHERE sensortype='temperature'
)
GROUP BY room
)

We've updated the documentation with descriptions and examples for each of the new window functions. Note that they require the OVER() clause, with an optional PARTITION BY and sometimes required ORDER BY arguments. ORDER BY tells the window function what criteria to use to rank items, while PARTITION BY allows you to define multiple groups to be analyzed independently of each other.

The window functions don't work with the big GROUP EACH BY and JOIN EACH BY operators, but they do work with the traditional GROUP BY and JOIN BY. As a reminder, we announced GROUP EACH BY and JOIN EACH BY last March, to allow large join and group operations.

Query caching

BigQuery now remembers values that you've previously computed, saving you time and the cost of recalculating the query. To maintain privacy, queries are cached on a per-user basis. Cached results are only returned for tables that haven't changed since the last query, or for queries that are not dependent on non-deterministic parameters (such as the current time). Reading cached results is free, but each query still counts against the max number of queries per day quota. Query results are kept cached for 24 hours, on a best effort basis. You can disable query caching with the new flag --use_cache in bq, or "useQueryCache" in the API. This feature is also accessible with the new query options on the BigQuery Web UI.

BigQuery Web UI: Query validator, cost estimator, and abandonment

The BigQuery UI gets even better: You'll get instant information while writing a query if its syntax is valid. If the syntax is not valid, you'll know where the error is. If the syntax is valid, the UI will inform you how much the query would cost to run. This feature is also available with the bq tool and API, using the --dry_run flag.

An additional improvement: When running queries on the UI, previously you had to wait until its completion before starting another one. Now you have the option to abandon it, to start working on the next iteration of the query without waiting for the abandoned one.

Pricing updates

Starting in July, BigQuery pricing becomes more affordable for everyone: Data storage costs are going from $0.12/GB/month to $0.08/GB/month. And if you are a high-volume user, you'll soon be able to opt-in for tiered query pricing, for even better value.

Bigger quota

To support larger workloads we're doubling interactive query quotas for all users, from 200GB + 1 concurrent query, to 400 GB of concurrent queries + 2 additional queries of unlimited size.

These updates make BigQuery a faster, smarter, and even more affordable solution for ad hoc analysis of extremely large datasets. We expect they'll help to scale your projects, and we hope you'll share your use cases with us on Google+.


The BigQuery UI features a collection of public datasets for you to use when trying out these new features. To get started, visit our sign-up page and Quick Start guide. You should take a look at our API docs, and ask questions about BigQuery development on Stack Overflow. Finally, don't forget to give us feedback and join the discussion on our Cloud Platform Developers Google+ page.



Felipe Hoffa has recently joined the Cloud Platform team. He'd love to see the world's data accessible for everyone in BigQuery.

Posted by Ashleigh Rentz, Editor Emerita

Thursday, May 16, 2013

Get started with App Engine for PHP: scalable, secure and reliable

Author PhotoBy Andrew Jessup, Product Manager

Cross-posted from the Google Cloud Platform Blog

At Google I/O, we announced PHP as the latest supported runtime for Google App Engine in Limited Preview. PHP is one of the world's most popular programming languages, used by developers to power everything from simple web forms to complex enterprise applications.

Now PHP developers can take advantage of the scale, reliability and security features of App Engine. In addition, PHP runs well with other parts of Google Cloud Platform. Let's look at how this works.

Connecting to Google Cloud SQL from App Engine for PHP

Many PHP developers start with MySQL when choosing a database to store critical information, and a wide variety of products and frameworks such as WordPress make extensive use of MySQL’s rich feature set. Google Cloud SQL provides a reliable, managed database service that is MySQL 5.5 compatible and works well with App Engine.

To set up a Cloud SQL database, sign into Google Cloud Console - create a new project, choose Cloud SQL and create a new instance.



After you create the instance, it's automatically associated with your App Engine app.


You will notice Cloud SQL instances don’t need an IP address. Instead they can be accessed via a compound identifier made up of their project name and instance name, such as hello-php-gae:my-cloudsql-instance.

From within PHP, you can access Cloud SQL directly using the standard PHP MySQL libraries - mysql, mysqli or PDO_MySQL. Just specify your Cloud SQL database with its identifier, such as:
<?php

$db = new PDO(
'mysql:unix_socket=/cloudsql/hello-php-gae:my-cloudsql-instance;dbname=demo_db;charset=utf8',
'demo_user',
'demo_password'
);

foreach($db->query('SELECT * FROM users') as $row) {
echo $row['username'].' '.$row['first_name']; //etc...
}
Methods such as query() work just as you’d expect with any MySQL database. This example uses the popular PDO library, although other libraries such as mysql and mysqli work just as well.

Storing files with PHP and Google Cloud Storage

Reading and writing files is a common task in many PHP projects, whether you are reading stored application state, or generating formatted output (e.g., writing PDF files). The challenge is to find a storage system that is as scalable and secure as Google App Engine itself. Fortunately, we have exactly this in Google Cloud Storage (GCS).

The first step in setting up Google Cloud Storage is to create a bucket:


With the PHP runtime, we’ve implemented native support for GCS. In particular, we’ve made it possible for PHP’s native filesystem functions to read and write to a GCS bucket.

This code writes all prime numbers less than 2000 into a file on GCS:

<?php

$handle = fopen('gs://hello-php-gae-files/prime_numbers.txt','w');

fwrite($handle, "2");
for($i = 3; $i <= 2000; $i = $i + 2) {
$j = 2;
while($i % $j != 0) {
if($j > sqrt($i)) {
fwrite($handle, ", ".$i);
break;
}
$j++;
}
}

fclose($handle);
The same fopen() and fwrite() commands are used just as if you were writing to a local file. The difference is we’ve specified a Google Cloud Storage URL instead of a local filepath.

And this code reads the same file back into memory and pulls out the 100th prime number, using file_get_contents():

<?php

$primes = explode(",",
file_get_contents('gs://hello-php-gae-files/prime_numbers.txt')
);

if(isset($primes[100]))
echo "The 100th prime number is ".$primes[100];

And more features supported in PHP

Many of our most popular App Engine APIs are now supported in PHP, including our zero-configuration Memcache, Task Queues for asynchronous processing, Users API, Mail API and more. The standard features you’d expect from App Engine, including SSL support, Page Speed Service, versioning and traffic splitting are all available as well.

Open today in Limited Preview

Today we’re making App Engine for PHP available in Limited Preview. Read more about the runtime in our online documentation, download an early developer SDK, and sign up to deploy applications at https://cloud.google.com/appengine/php.


Andrew Jessup is a Product Manager at Google, working on languages and runtimes for Google App Engine.

Posted by Scott Knaster, Editor

Get started with Google Cloud Datastore - a fast, powerful, NoSQL database

Author Photo
By Chris Ramsdale, Product Manager

Cross-posted from the Google Cloud Platform Blog

At Google I/O, we announced Google Cloud Datastore, a fully managed solution for storing non-relational data. Based on the popular Google App Engine High Replication Datastore (HRD), Cloud Datastore provides a schemaless, non-relational datastore with the same accessibility of Google Cloud Storage and Google Cloud SQL.

Cloud Datastore builds off the strong growth and performance of HRD, which has over 1PB of data stored, 4.5 trillion transactions per month and a 99.95% uptime. It also comes with the following features:
  • Built-in query support: near SQL functionality that allows you to search, sort and filter across multiple indexes that are automatically maintained 
  • ACID transactions: data consistency (both Strong and Eventual) that spans multiple replicas and requests 
  • Automatic scaling: built on top of Google’s BigTable infrastructure, the Cloud Datastore will automatically scale with your data 
  • High availability: by utilizing Google’s underlying Megastore service, the Cloud Datastore ensures that data is replicated across multiple datacenters and is highly available 
  • Local development environment: the Cloud Datastore SDK provides a full-featured local environment that allows you to develop, iterate and manage your Cloud Datastore instances efficiently 
  • Free to get started: 50k read & write operations, 200 indexes, and 1GB of stored data for free per month  

Getting started with Cloud Datastore 

To get started, head over to the Google Cloud Console and create a new project. After supplying a few pieces of information you will have a Cloud Project that has the Cloud Datastore enabled by default. For this post we’ll use the project ID cloud-demo.

With the project created and the Cloud Datastore enabled, we’ll need to download the Cloud Datastore client library. Once installed, it’s time to start writing some code. For the sake of this post, we’ll focus on accessing the Cloud Datastore from a Python application running on a Compute Engine VM (which is also now in Preview). We’ll assume that you’ve already created a new VM instance.'
import googledatastore as datastore

def main()
writeEntity()
readEntity()
Next include writeEntity() and readEntity() functions:
def WriteEntity():
req = datastore.BlindWriteRequest()
entity = req.mutation.upsert.add()
path = entity.key.path_element.add()
path.kind = 'Greeting'
path.name = 'foo'
message = entity.property.add()
message.name = 'message'
value = message.value.add()
value.string_value = 'to the cloud and beyond!'
try:
datastore.blind_write(req)
except datastore.RPCError as e:
# remember to do something useful with the exception pass

def ReadEntity():
req = datastore.LookupRequest()
key = req.key.add()
path = key.path_element.add()
path.kind = 'Greeting0'
path.name = 'foo0'
try:
resp = datastore.lookup(req)
return resp
except datastore.RPCError as e:
# remember to do something useful with the exception pass
First create a new file called “demo.py”. Inside demo.py, we’ll add code to write and then read an entity from the Cloud Datastore.  Finally we can update main() to print out the property values within the fetched entity:
def main()
writeEntity();
resp = readEntity();

entity = resp.found[0].entity
for p in entity.property:
print 'Entity property name: %s', p.name
v = p.value[0]
print 'Entity property value: %s', v.string_value
Before we can run this code we need to tell the SDK which Cloud Datastore instance we would like to use. This is done by exporting the following environment variable:
~$ export DATASTORE_DATASET cloud-datastore-demo
Finally we’re able to run the application by simply issuing the following:
~$ python demo.py
Besides the output that we see in console window, we’re also able to monitor our interactions within the Cloud Console. By navigating back to Cloud Console, selecting our cloud-datastore-demo project, and then selecting the Cloud Datastore we’re taken to our instance’s dashboard page that includes number of entities, properties, and property types, as well as index management, ad-hoc query support and breakdown of stored data.

And that’s really just the beginning. To fully harness the features and functionality that the Cloud Datastore offers, be sure to check out the larger Getting Started Guide and the Cloud Datastore documentation.

Cloud Datastore is the latest addition to the Cloud Platform storage family, joining Cloud Storage for storing blob data, Cloud SQL for storing relational data, and Persistent Disk for storing block data. All fully managed so that you can focus on creating amazing solutions and leave the rest to us.

And while this is a Preview Release, the team is off to a great start. As we move the service towards General Availability we’re looking forward to improving JSON support, more deeply integrating with the Cloud Console, streamlining our billing and driving every bit of performance that we can out of the API and underlying service.

Happy coding!


Chris Ramsdale has worked extensively in the mobile space, starting as a Software Engineer at Motorola in 1997, and then joining local start ups as a Tech Lead and Product Manager. Chris is currently a Product Manager for Google Cloud Platform focused on developer tools and platform services like Google App Engine and Google Cloud Datastore.

Posted by Scott Knaster, Editor

Wednesday, May 15, 2013

Google Compute Engine is now open to all

Author Photo
By Navneet Joneja, Product Manager

Cross-posted from the Google Cloud Platform Blog

Last year we announced Google Compute Engine to enable any business or developer to use Google’s infrastructure for their applications. Now we’re taking the next step: Google Compute Engine is open to everyone in preview, and you can sign up online now.

Over the past year, we’ve launched several features and made significant improvements behind the scenes. We’re now announcing several new capabilities that make it easier and more economical to use Compute Engine for a broader set of applications.

  • Sub-Hour Billing: We heard feedback from our early users who wanted more granular billing increments so they could run short-lived workloads. Now all instances are charged for in one-minute increments with a ten-minute minimum, so you don’t pay for compute minutes that you don’t use.
  • New shared-core instance types: Compute Engine’s new micro and small instance types are designed as a cost-effective option for running small workloads that don’t need a lot of CPU power, like development and test workloads.
  • Larger Persistent Disks: We’re increasing the size of Persistent Disks that can be attached to instances by up to 8,000%. You can now attach up to 10 terabytes of persistent disk to a Compute Engine virtual machine, giving you plenty of persistent storage for a wide variety of applications.
  • Advanced Routing Capabilities: Compute Engine now supports software-defined routing capabilities based on our broad SDN innovation. These capabilities are designed to handle your advanced network routing needs like configuring instances to function as gateways, configuring VPN servers and building applications that span your local network and Google’s cloud.
  • ISO 27001 Certification: We’ve also completed ISO 27001:2005 certification for Compute Engine, App Engine, and Cloud Storage to demonstrate that these products meet the international standard for managing information security.

To get started, go to the Google Cloud Console, select Compute Engine and click the “New Instance” button.

Fill out the required information and click “Create” on the right hand side. Your new virtual machine will be ready to use in about a minute.

To all of our customers who helped us evolve the product over the past months, thank you; your feedback has helped shape Compute Engine. To those of you who have been eager to try Compute Engine, the wait is over and you can sign up for Compute Engine online today.


Navneet Joneja loves being at the forefront of the next generation of simple and reliable software infrastructure, the foundation on which next-generation technology is being built. When not working, he can usually be found dreaming up new ways to entertain his intensely curious three-year-old.

Posted by Scott Knaster, Editor

Ushering in the next generation of computing at Google I/O

Author Photo
By Urs Hölzle, Senior Vice President, Technical Infrastructure, and Google Fellow

Cross-posted from the Google Cloud Platform Blog

Watch the video of the Cloud track kickoff.

Over the last fourteen years we have been developing some of the best infrastructure in the world to power Google’s global-scale services. With Google Cloud Platform, our goal is to open that infrastructure and make it available to any business or developer anywhere. Today, we are introducing improvements to the platform and making Google Compute Engine available for anyone to use.

Google Compute Engine - now available for everyone

Google Compute Engine provides a fast, consistently high-performance environment for running virtual machines. Later today, you’ll be able to go online to cloud.google.com and start using Compute Engine.

In addition, we’re introducing new Compute Engine features:

  • Sub-hour billing charges for instances in one-minute increments with a ten-minute minimum, so you don’t pay for compute minutes that you don’t use
  • Shared-core instances provide smaller instance shapes for low-intensity workloads
  • Advanced Routing features help you create gateways and VPN servers, and enable you to build applications that span your local network and Google’s cloud
  • Large persistent disks support up to 10 terabytes per volume, which translates to 10X the industry standard

We’ve also completed ISO 27001:2005 international security certification for Compute Engine, Google App Engine, and Google Cloud Storage.

Google App Engine adds the PHP runtime

App Engine 1.8.0 is now available and includes a Limited Preview of the PHP runtime - your top requested feature. We’re bringing one of the most popular web programming languages to App Engine so that you can run open source apps like WordPress. It also offers deep integration with other parts of Cloud Platform including Google Cloud SQL and Cloud Storage.

We’ve also heard that we need to make building modularized applications on App Engine easier. We are introducing the ability to partition apps into components with separate scaling, deployments, versioning and performance settings.

Introducing Google Cloud Datastore

Google Cloud Datastore is a fully managed and schemaless solution for storing non-relational data. Based on the popular App Engine High Replication Datastore, Cloud Datastore is a standalone service that features automatic scalability and high availability while still providing powerful capabilities such as ACID transactions, SQL-like queries, indexes and more.

Over the last year we have continued our focus on feature enhancement and developer experience across App Engine, Compute Engine, Google BigQuery, Cloud Storage and Cloud SQL. We also introduced Google Cloud Endpoints and Google Cloud Console.

With these improvements, we have seen increased usage with over 3 million applications and over 300,000 unique developers using Cloud Platform in a given month. Our developers inspire us everyday, and we can’t wait to see what you build next.


Urs Hölzle is Senior Vice President of Technical Infrastructure and Google Fellow. As one of Google's first ten employees and its first VP of Engineering, he has shaped much of Google's development processes and infrastructure.

Posted by Scott Knaster, Editor

Monday, May 13, 2013

Data Sensing Lab at Google I/O 2013: Google Cloud Platform meets the Internet of Things

Author PhotoBy Michael Manoochehri, Developer Programs Engineer, Google Cloud Platform

Cross-posted with the Google Cloud Platform Blog

After last year's Google I/O conference, the Google Cloud Platform Developer Relations team started to think about how attendees experienced the event. We wanted to help attendees gain more insight about the conference space and the environment itself. Which developer Sandboxes were the busiest? Which were the loudest locations, and which were the best places to take a quick nap? We think about data problems all the time, and this looked like an interesting big data challenge that we could try to solve. So this year, we decided to try to answer our questions with a project that's a bit different, kind of futuristic, and maybe a little crazy.

Since we love open source hardware hacking as much as we love to share open source code, we decided to team up with the O'Reilly Data Sensing Lab to deploy hundreds of Arduino-based environmental sensors at Google I/O 2013. Using software built with the Google Cloud Platform, we'll be collecting and visualizing ambient data about the conference, such as temperature, humidity, air quality, in real time! Altogether, the sensors network will provide over 4,000 continuous data streams over a ZigBee mesh network managed by Device Cloud by Etherios.

photo of sensors

In addition, our motes will be able to detect fluctuations in noise level, and some will be attached to footstep counters, to understand collective movement around the conference floor. Of course, since a key goal of Google I/O is to promote innovation in the open, the project's Cloud Platform code, the Arduino hardware designs, and even the data collected, will be open source and available online after the conference.

Google Cloud Platform, which provides the software backend for this project, has a variety of features for building applications that collect and process data from a large number of client devices - without having to spend time managing hardware or infrastructure. Google App Engine Datastore, along with Cloud Endpoints, provides a scalable front end API for collecting data from devices. Google Compute Engine is used to process and analyse data with software tools you may already be familiar with, such as R and Hadoop. Google BigQuery provides fast aggregate analysis of terabyte datasets. Finally, App Engine's web application framework is able to surface interactive visualizations to users.

Networked sensor technology is in the early stages of revolutionizing business logistics, city planning, and consumer products. We are looking forward to sharing the Data Sensing Lab with Google I/O attendees, because we want to show how using open hardware together with the Google Cloud Platform can make this technology accessible to anyone.

With the help of the Google Maps DevRel team, we'll be displaying visualizations of interesting trends on several screens around the conference. Members of the Data Sensing Lab will be on hand in the Google I/O Cloud Sandbox to show off prototypes and talk to attendees about open hardware development. Lead software developer Amy Unruh and Kim Cameron from the Cloud Platform Developer Relations team will talk about how we built the software involved in this project in a talk called "Behind the Data Sensing Lab". In case you aren't able to attend Google I/O 2013, this session will be available online after the conference. Learn more about the Google Cloud Platform on our site, and to dive in to building applications, check out our developer documentation.


Michael Manoochehri is a Developer Programs Engineer supporting the Google Cloud Platform. He is passionate about making cloud computing and data analysis universally accessible and useful.

Posted by Scott Knaster, Editor

Thursday, April 4, 2013

Google Compute Engine: Expanded availability, new features, and lower prices

Author PictureBy Marc Cohen, Google Cloud Platform team

Cross-posted with the Google App Engine blog

Starting today, Google Compute Engine is available to all customers who sign up for our Gold Support package. We’re also happy to announce a 4% reduction on all Compute Engine pricing.

In the nine months since announcing Compute Engine, customers have been using Google’s Infrastructure as a Service product and giving us valuable feedback. Sebastian Stadil of Scalr wrote, in a recent review:

“Google Compute Engine is not just fast. It’s Google fast. In fact, it’s a class of fast that enables new service architectures entirely.”

We’re happy to hear that, because one of our main goals in building Compute Engine is to enable a new generation of applications with direct access to the capabilities of Google’s vast computing infrastructure.

Based on user feedback, we’ve added a number of major features including:

  • The option to boot from persistent disks mounted as the root file system, persistent disk snapshots, the ability to checkpoint and restore the contents of network resident persistent disks on demand, and the ability to attach and detach persistent disks from running instances.
  • An improved administration console, the Google Cloud Console (preview), which allows you to administer all your Google Cloud Platform services via a unified interface. Here’s a screenshot of the new Cloud Console in action:
    Screenshot of Cloud Console
  • Five new instance type families (diskless versions of our standard instance types, plus diskful and diskless versions of high-memory and high-cpu configurations), with 16 new instance types.
  • Two new supported zones in Europe, which provide lower latency and higher performance for our European customers. We’ve also made it easy to migrate virtual machine instances from one zone to another via an enhancement to our gcutil command line tool.
  • An enhanced metadata server, with the ability to support recursive queries, blocking gets and selectable response formats, along with support for updating virtual machine tags and metadata on running instances (which enables dynamic reconfiguration scenarios).

While we've been hard at work developing new features, we've also had the opportunity to play. Check out the amazing World Wide Maze Chrome Experiment, developed by the Chrome team in Japan. This game converts any web site of your choice into an interactive, three dimensional maze, navigated remotely via your smartphone. Compute Engine virtual machines run Node.js to manage the game state and synchronization with the mobile device, while Google App Engine hosts the game’s web UI. This application provides an excellent example of the new kinds of rich, high performance back end services enabled by Google Cloud Platform.

With today’s announcement, we look forward to welcoming many new customers, and bringing exciting new applications to Google Cloud Platform!



Marc Cohen is a Developer Programs Engineer focusing on helping developers get the most out of Google’s advanced cloud computing technologies. He has over 25 years of experience designing and building reliable, distributed systems in the telecommunications industry. A Seattle resident, Marc enjoys programming, indie pop/rock music, blogging and teaching.

Posted by Ashleigh Rentz, Editor Emerita

Tuesday, April 2, 2013

Integrate voice and SMS with Twilio on Google Cloud Platform

Author PictureBy Robert Do, Google Cloud Platform team

Cross-posted from the Google App Engine blog

Have you ever wanted to integrate SMS or voice communications into your app? We’ve been working with our friends over at Twilio to make it easier to do so. Today we’re announcing native Python and Java libraries for working with Twilio APIs onto Google Cloud Platform.

Lots of apps on App Engine have already been built with phone functionality. Check out the sample code for a group messaging app and the sample code for an app that dispatches voicemails and SMS messages to PagerDuty. Learn how to send business cards via sms through this step by step guide.

You can start building voice and SMS features into your App Engine apps today. Together with Twilio, we’ll help you get started with 2,000 free text message or voice minutes.

Ready to get started?

  1. Sign up for App Engine.
  2. Get your Twilio account and 2,000 free text message or voice minutes.
  3. Check out our guide on how to integrate Twilio services into your app.

Here’s a quick peek at how easy it can be to send a text message from App Engine using Python. After installing the Twilio library, it just takes a few lines of code to send an SMS.


import webapp2
from twilio import twiml
from twilio.rest import TwilioRestClient
class SendSMS(webapp2.RequestHandler):
  def get(self):
      # replace with your credentials from: https://www.twilio.com/user/account
      account_sid = "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      auth_token = "xxxxxxxxxxxxxxxxxxxxxxxxxx"
      client = TwilioRestClient(account_sid, auth_token)
      # replace "to" and "from_" with real numbers
      rv = client.sms.messages.create(to="+14155551212",
                                      from_="+14085551212",
                                      body="Hello Monkey!")
      self.response.write(str(rv))
app = webapp2.WSGIApplication([('/send_sms', SendSMS)],
                            debug=True)


Posted by Ashleigh Rentz, Editor Emerita

Thursday, March 14, 2013

BigQuery gets big new features to make data analysis even easier

Author Photo
By Michael Manoochehri, Developer Programs Engineer, Cloud Platform

Google BigQuery is designed to make it easy to analyze large amounts of data quickly. Overwhelmingly, developers have asked us for features to help simplify their work even further. Today we are launching a collection of updates that gives BigQuery a greater range of query and data types, more flexibility with table structure, and better tools for collaborative analysis.

Big JOIN and Big Group Aggregations

Extracting insights from multiple datasets can be challenging and time-consuming. This is especially true when datasets become too large to query with a traditional database system. With traditional databases, SQL functions like joining and grouping are typically used to bring together data for analysis. What happens when your data is too large to fit into a conventional database? Working with multi-terabyte datasets often requires developing complicated MapReduce workflows, investing in expensive infrastructure, and great deal of time. Very often, it's a combination of all three.

In response to developer feedback, we're launching new features that enable analysts and developers to run fast SQL-like join and aggregate queries on datasets without the need for batch-based processing. Our new Big JOIN feature gives users the ability to produce a result set by merging data from two large tables by a common key. Big JOIN simplifies data analysis that would otherwise require a data transformation step, by allowing users to specify JOIN operations using SQL.

Popular web applications produce user activity logs that can grow by billions of rows each week. Dividing users into smaller groups is a key step for analysis. However, each group of users can number in the millions. To handle this for such large volumes, we've enabled Big Group Aggregations, which significantly increases the number of distinct values that can be grouped in a result set.

To use these new features, simply add the EACH modifier to JOIN or GROUP BY clauses.


/* JOIN EACH example
* Selects the top 10 most edited Wikipedia pages
* of words that appear in works of Shakespeare.
*/

SELECT
 TOP(wiki.title, 10), COUNT(*)
FROM
 [publicdata:samples.wikipedia] AS wiki
JOIN EACH
 [publicdata:samples.shakespeare] AS shakespeare
ON
 shakespeare.word = wiki.title;


For more information, including best practices, when using JOIN EACH and GROUP EACH BY, visit the BigQuery query reference.

Native support for TIMESTAMP data type

We are also adding a new TIMESTAMP data type, in response to one of our most frequent requests from developers. This new data type lets you import date and time values in formats familiar to users of databases such as MySQL, while preserving timezone offset information.

Along with the new data type come new functions for converting TIMESTAMP fields into other formats, calculating intervals, and extracting components such as the hour, day of week, and quarter.


/* TIMESTAMP example
* Which hours in the day are the most popular for GitHub actions?
* This query converts github_timeline "created_at" date time   
* strings to BigQuery TIMESTAMP, and extracts the hour from each.
*/

SELECT
 HOUR(TIMESTAMP(created_at)) AS event_create_hour,
 COUNT(*) AS event_count
FROM
 [publicdata:samples.github_timeline]
GROUP BY
 event_create_hour
ORDER BY
 event_count DESC;


Read more about the available TIMESTAMP functions in our query reference guide.

Add columns to existing BigQuery tables

When working with large amounts of fast moving data, it's not uncommon to find out that you need to add additional fields to your tables. In response to developer feedback, we have added the ability to add new columns to existing BigQuery tables.

To take advantage of this feature, simply provide a new schema with additional columns using either the "Tables: update" or "Tables: patch" BigQuery API methods.

For more information on this feature, visit the BigQuery API reference.

BigQuery Web UI: Dataset links and dataset sharing notifications

BigQuery has always provided project owners with very fine-grained control of how their datasets are shared. To make it easier for teams to work on collaborative data analysis, we've added direct links to individual datasets in the BigQuery Web UI. This provides a convenient way for authorized users to quickly access a dataset, and allows for bookmarking and sharing.

In addition, we've also added email notifications to inform users when they've been given dataset access privileges. When a dataset has been shared with another user via the sharing control panel, BigQuery sends a notification email containing a direct link to the dataset.


The BigQuery UI features a collection of public datasets for you to use when trying out these new features. To get started, visit our sign up page and Quick Start guide. You should take a look at our API docs, and ask questions about BigQuery development on Stack Overflow. Finally, don't forget to give us feedback and join the discussion on our Cloud Platform Developers Google+ page.


Michael Manoochehri is a Developer Programs Engineer supporting the Google Cloud Platform. His goal is to help make cloud computing and data analysis universally accessible and useful.

Posted by Scott Knaster, Editor

Thursday, February 21, 2013

Google Cloud Platform introduces new support packages

Author PictureBy Brett McCully, Google Cloud Platform Team

(Cross-posted with the App Engine and Enterprise Blogs)

Support is as important as product features when choosing a platform for your applications. And let’s face it, sometimes we all need a bit of help. No matter which Google Cloud Platform services you are using — App Engine, Compute Engine, Cloud Storage, Cloud SQL, BigQuery, etc. — or what time of day, you should be able to get the answers you need. While you can go to Stack Overflow or Google Groups, we realize some of you may need 24x7 coverage, phone support or direct access to a Technical Account Manager team.

To meet your support requirements, we’re introducing a comprehensive collection of support packages for services on Google Cloud Platform, so you can decide what level best fits your needs:

  • Bronze: All customers get access to online documentation, community forums, and billing support. (Free)
  • Silver: In addition to Bronze, you can email our support team for questions related to product functionality, best practices, and service errors. ($150/month)
  • Gold: In addition to Silver, you'll receive 24x7 phone support and consultation on application development, best practices or architecture for your specific use case. (Starts at $400/month)
  • Platinum: The most comprehensive and personalized support. In addition to Gold, you’ll get direct access to a Technical Account Manager team. (Contact Sales for more information)

Sign up or click here to find out more information about the new Google Cloud Platform support options.


Brett McCully is the Manager of the Google Cloud Platform Support team and is currently based in Seattle.

Posted by Ashleigh Rentz, Editor Emerita

Java 7 Runtime and Cloud Endpoints Preview

Author PictureBy Brad Abrams, Google Cloud Platform Team
(Cross-posted with the Google App Engine Blog)
Today we are announcing two new preview features: App Engine Java 7 runtime support and Google Cloud Endpoints.   Preview features are ‘experimental’ features on a path towards general availability.


Java 7 Runtime Support for App Engine

The App Engine Java 7 runtime allows App Engine developers to keep pace with innovations in the Java language and runtime. It is important that you begin testing your applications with the new Java 7 runtime before the complete rollout in a few months.
Some of the language features you now have access to include:
invokedynamic support, which allows developers, tools providers, and language implementations to take advantage of a new bytecode, invokedynamic, to handle method invocations efficiently even when there is no static type information. For example:

public static void invokeExample() {
String s;
MethodType mt;
MethodHandle mh;

MethodHandles.Lookup lookup = MethodHandles.lookup();
MethodType mt = MethodType.methodType(String.class, char.class,
char.class);
MethodHandle mh = lookup.findVirtual(String.class, "replace", mt);
s = (String) mh.invokeExact("App Engine Java 6 runtime",'6','7');
System.out.println(s);
}
Try-with-resources, which helps avoid memory leaks and related bugs by automatically closing resources that are used in a try-catch statement.

public static void viewTable(Connection con, String query) throws SQLException {

  try (
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query)
) {
     while (rs.next()) {
    // process results
    //
     }
  } catch (SQLException e) {
     // con resource is auto-closed, no need to do anything here!
     //
  }
}
Flexible Type Creation when using generics, enabling you to create parameterized types more succinctly. For example, you can write:

Map<String, List<String>> myMap = new HashMap<>();
instead of:
Map<String, List<String>> myMap = new HashMap<String, List<String>>();
In addition to the language features listed above, the App Engine Java 7 runtime also includes:
  • Use of String class in Switch statements.
  • Expression of binary literals using simple prefixes 0b or 0B.
  • Single catch blocks that can handle multiple exceptions.
  • Simplified varargs method invocation.
Want to get started now? Download the latest App Engine Java SDK and then check out the docs here.


Cloud Endpoints Preview

Have you ever wanted a simple way to get a cloud backend for that Android or iPhone app you are working on?  Wish it was easier to expose RESTful APIs from your web application?  Google Cloud Endpoints simplifies building highly scalable and flexible backends for your web and mobile applications. Use Cloud Endpoints to store application data in the cloud that spans both devices and users. You can now easily expose your own authenticated, reliable, REST-based APIs hosted from an App Engine application and consume them in your Android, iOS, or web clients. Deeply integrated authentication support allows your users to have a transparent yet secure experience accessing your services. You have access to strongly typed client libraries for your custom service optimized for Android and iOS.
To use Cloud Endpoints, you simply write a Java or Python class with methods you want to expose to web or mobile clients. You then annotate the methods with attributes that control exactly how they are represented in REST interfaces on the wire. Finally, use Cloud Endpoints to generate your strongly-typed client libraries for Android, iOS and a lightweight JavaScript library.
For example, you can create a simple class to list some important data:

public class SuperHeroes {

   public List listSuperHeroes() {

List list = new ArrayList();
list.add(new SuperHero ("Champion of the Obvious", "Brad Abrams"));
list.add(new SuperHero ("Mr. Justice", "Chris Ramsdale"));

return list;

}
}
Then, expose it over a standard REST interface with a simple attribute and a versioning pattern.

@Api(name = "superheroes", version = "v1")
public class SuperHeroesV1 {
...
}
Now you have a simple REST interface.

$ curl http://localhost:8888/_ah/api/superheroes/v1/superheroes
{
"items": [
 {
  "knownAs" : "Champion of the Obvious",
  "realName" : "Brad Abrams"
 },
 {
  "knownAs" : "Mr. Justice",
  "realName" : "Chris Ramsdale"
 }
And you can make strongly typed calls from your Android clients:

Real result = superheroes.list().execute();
Or Objective-C iOS client:

GTLQuerySuperHeroesV1 *query = [GTLQuerySuperHeroesV1 queryForSuperHeroesList];
[service executeQuery:query completionHandler:^(GTLServiceTicket *ticket,
GTLSuperHeroes *object, NSError *error) {
 NSArray *items = [object items];
}];
Or the web client in JavaScript:
// ...
var ROOT = 'https://' + window.location.host + '/_ah/api';
gapi.client.load('superheroes', 'v1',
                loadSuperheroesCallback, ROOT);

// Get the list of superheroes
gapi.client.superheroes.superheroes.list().execute(function(resp) {
 displaySuperheroesList(resp);
});
Read the documentation for Java or Python to discover how you can build a simple tic-tac-toe game using Cloud Endpoints.
To get started with Cloud Endpoints, download the App Engine 1.7.5 SDK and the latest Google Plugin for Eclipse. Be sure to look at the docs and follow along in the discussion forums on Stack Overflow.
For more on using Cloud Endpoints with Python, check out +Danny Hermes and +Dan Holevoet on Google Developers Live.


Brad Abrams is a Product Manager on the Google Cloud Platform where he looks after the developer experience. Brad is currently learning to ride the unicycle, so far with no broken bones!
Posted by Ashleigh Rentz, Editor Emerita