Google’s Go Language for 
Cloud Computing 
Presented By: 
Suby Gopalan 
Yashashwini Adiga 
Hem Singh Chouhan 
Niranjan Singh 
Piyush Mishra
Agenda of the Session 
All about ‘GO’ 
Google App Engine 
App Engine Modules 
Storing data in Go 
Go Service APIs 
A fully functional Go App covered via 
Demo
Subjective Analysis 
Flaws in the existing languages like C++, Java
All about ‘GO’ 
Why one more programming language ? 
Is ‘GO’ an object-oriented language? 
Why do garbage collection? Won't it be too 
expensive? 
Why is the syntax so different from C? 
Why is there no pointer arithmetic?
Features of ‘GO’ at a glance 
Concurreny and Garbage collection 
Has pointers but no pointer arithmatic 
Support for networked and multicore 
programming 
Very fast 
Semicolons are not used
Google App Engine 
Platform as a Service 
Tools you know and Love 
Used by millions 
Build and Deploy 
Scale
Overview of App Engine Features 
General Availability 
Preview 
Experimental 
Third Party
Google App Engine for Go 
Introduction 
Selecting the Go runtime 
Organizing Go apps 
The sandbox 
The Go SDK and tools
App Engine Modules in Go
.yaml files
Instance scaling and class 
Manual, Basic, Automatic 
Uploading modules 
cd simple-sample 
goapp deploy default/app.yaml 
goapp deploy mobile-frontend/mobile-frontend. 
yaml 
goapp deploy static-backend/my-module. 
yaml 
Monitoring resource usage 
Logging
Storing data in GO
Storing data in GO 
Highly reliable and covered by the App 
Engine SLA. 
ACID transactions. 
Advanced querying features. 
High availability of reads and writes. 
Strong consistency for reads and ancestor 
queries. 
Eventual consistency for all other queries
Google Cloud SQL 
Is a web service that allows you to create, 
configure, and use relational databases that 
live in Google's cloud. 
 It is a fully-managed service offering the 
capabilities of a MySQL database, allowing 
you to focus on application development. 
Alternative Storage Solutions.. 
BLOBSTORE API Google Cloud Storage is 
recommended over using the Blobstore API.
Go Service APIs
Go Service APIs and Capabilities 
import "appengine/capability“
Important Players 
CHANNEL 
Javascript client 
The server 
Tokens
Life of a typical channel message 
Interaction with Server
Interaction between clients
Tracking Client Connections 
import "appengine/channel" 
POSTs to /_ah/channel/connected/ 
POSTs to /_ah/channel/disconnected/
Examples of API 
 Channel Go API - (channel.Create) 
The Channel API creates a persistent connection 
between your application and Google servers, 
allowing your application to send messages to 
JavaScript clients in real time without the use of 
polling 
 Images Go API 
The Images Go API provides the ability to serve 
images directly from Blobstore, and to optionally 
resize or crop those images on the fly. 
Image formats 
Serving and re-sizing images from the Blobstore
Examples of API 
 Logs Go API 
Request Log, Application Log 
 Mail Go API - import"appengine/mail“ 
App Engine applications can send email messages on 
behalf of the app's administrators, and on behalf of 
users with Google Accounts. 
Apps can receive email at various addresses. 
 Apps send messages using the Mail service and 
receive messages in the form of HTTP requests 
initiated by App Engine and posted to the app.
Examples of API 
 Memcache Go API 
– import appengine/memcache“ 
 NameSpace API 
- The Namespaces API in Google App Engine makes it 
easy to compartmentalize your Google App Engine 
data. This API is implemented via the , 
appengine.Namespacefunction and is incorporated 
in certain namespace-enabled APIs.
OAuth for GO 
 OAuth is a protocol that allows a user to grant a third party limited 
permission to access a web application on her behalf, without sharing 
her credentials (username and password) with the third party. 
 To initiate the authorization process on behalf of a user, a consumer 
calls an OAuth endpoint to get a request token(Valid for 10 mins) 
 Once the consumer has a request token, it must direct the user to sign 
in using Google Accounts and authorize the consumer to access the 
service provider on her behalf. 
 Once authorized, the consumer calls the service provider to get 
an access token 
 The consumer includes this token with all requests to the application's 
web service endpoints.
Users GO API 
import"appengine/user" 
package user provides a client for app 
engine's user authentication service. 
user represents a user of the application. 
func (*User) String 
String returns a displayable name for the user
XMPP GO API 
 An App Engine application can send and receive chat messages to and 
from any XMPP-compatible chat messaging service, such as Google Talk. 
 An app can send and receive chat messages, send chat invites, request a 
user's chat presence and status, and provide a chat status. Incoming XMPP 
messages are handled by request handlers, similar to web requests. 
 Sending chat messages 
 /_AH/XMPP/MESSAGE/CHAT/ 
 Receiving chat messages 
 app engine makes an http post request to the following url path when 
your app receives a chat 
 -MESSAGE:/_AH/XMPP/MESSAGE/CHAT/ 
 -to handle incoming messages, you simply create a request handler that 
accepts post requests at this url path.
Handling User Presence 
Enabling the xmpp_presence inbound service allows your 
application to detect changes to a user's chat presence. When you 
enable xmpp_presence, your application receives posts to the 
following URL paths: 
-Posts to /_ah/xmpp/presence/available/ signal that the user is 
available and provide the user's chat status. 
-Posts to /_ah/xmpp/presence/unavailable/ signal that the user is 
unavailable. 
-Posts to /_ah/xmpp/presence/probe/ request a user's current 
presence.
Other Important Parts of Go 
Configuration 
Tools
DEMO

Varaprasad-Go

  • 1.
    Google’s Go Languagefor Cloud Computing Presented By: Suby Gopalan Yashashwini Adiga Hem Singh Chouhan Niranjan Singh Piyush Mishra
  • 2.
    Agenda of theSession All about ‘GO’ Google App Engine App Engine Modules Storing data in Go Go Service APIs A fully functional Go App covered via Demo
  • 3.
    Subjective Analysis Flawsin the existing languages like C++, Java
  • 4.
    All about ‘GO’ Why one more programming language ? Is ‘GO’ an object-oriented language? Why do garbage collection? Won't it be too expensive? Why is the syntax so different from C? Why is there no pointer arithmetic?
  • 5.
    Features of ‘GO’at a glance Concurreny and Garbage collection Has pointers but no pointer arithmatic Support for networked and multicore programming Very fast Semicolons are not used
  • 6.
    Google App Engine Platform as a Service Tools you know and Love Used by millions Build and Deploy Scale
  • 7.
    Overview of AppEngine Features General Availability Preview Experimental Third Party
  • 8.
    Google App Enginefor Go Introduction Selecting the Go runtime Organizing Go apps The sandbox The Go SDK and tools
  • 9.
  • 10.
  • 11.
    Instance scaling andclass Manual, Basic, Automatic Uploading modules cd simple-sample goapp deploy default/app.yaml goapp deploy mobile-frontend/mobile-frontend. yaml goapp deploy static-backend/my-module. yaml Monitoring resource usage Logging
  • 13.
  • 15.
    Storing data inGO Highly reliable and covered by the App Engine SLA. ACID transactions. Advanced querying features. High availability of reads and writes. Strong consistency for reads and ancestor queries. Eventual consistency for all other queries
  • 16.
    Google Cloud SQL Is a web service that allows you to create, configure, and use relational databases that live in Google's cloud.  It is a fully-managed service offering the capabilities of a MySQL database, allowing you to focus on application development. Alternative Storage Solutions.. BLOBSTORE API Google Cloud Storage is recommended over using the Blobstore API.
  • 17.
  • 18.
    Go Service APIsand Capabilities import "appengine/capability“
  • 19.
    Important Players CHANNEL Javascript client The server Tokens
  • 20.
    Life of atypical channel message Interaction with Server
  • 21.
  • 22.
    Tracking Client Connections import "appengine/channel" POSTs to /_ah/channel/connected/ POSTs to /_ah/channel/disconnected/
  • 23.
    Examples of API  Channel Go API - (channel.Create) The Channel API creates a persistent connection between your application and Google servers, allowing your application to send messages to JavaScript clients in real time without the use of polling  Images Go API The Images Go API provides the ability to serve images directly from Blobstore, and to optionally resize or crop those images on the fly. Image formats Serving and re-sizing images from the Blobstore
  • 24.
    Examples of API  Logs Go API Request Log, Application Log  Mail Go API - import"appengine/mail“ App Engine applications can send email messages on behalf of the app's administrators, and on behalf of users with Google Accounts. Apps can receive email at various addresses.  Apps send messages using the Mail service and receive messages in the form of HTTP requests initiated by App Engine and posted to the app.
  • 25.
    Examples of API  Memcache Go API – import appengine/memcache“  NameSpace API - The Namespaces API in Google App Engine makes it easy to compartmentalize your Google App Engine data. This API is implemented via the , appengine.Namespacefunction and is incorporated in certain namespace-enabled APIs.
  • 26.
    OAuth for GO  OAuth is a protocol that allows a user to grant a third party limited permission to access a web application on her behalf, without sharing her credentials (username and password) with the third party.  To initiate the authorization process on behalf of a user, a consumer calls an OAuth endpoint to get a request token(Valid for 10 mins)  Once the consumer has a request token, it must direct the user to sign in using Google Accounts and authorize the consumer to access the service provider on her behalf.  Once authorized, the consumer calls the service provider to get an access token  The consumer includes this token with all requests to the application's web service endpoints.
  • 27.
    Users GO API import"appengine/user" package user provides a client for app engine's user authentication service. user represents a user of the application. func (*User) String String returns a displayable name for the user
  • 28.
    XMPP GO API  An App Engine application can send and receive chat messages to and from any XMPP-compatible chat messaging service, such as Google Talk.  An app can send and receive chat messages, send chat invites, request a user's chat presence and status, and provide a chat status. Incoming XMPP messages are handled by request handlers, similar to web requests.  Sending chat messages  /_AH/XMPP/MESSAGE/CHAT/  Receiving chat messages  app engine makes an http post request to the following url path when your app receives a chat  -MESSAGE:/_AH/XMPP/MESSAGE/CHAT/  -to handle incoming messages, you simply create a request handler that accepts post requests at this url path.
  • 29.
    Handling User Presence Enabling the xmpp_presence inbound service allows your application to detect changes to a user's chat presence. When you enable xmpp_presence, your application receives posts to the following URL paths: -Posts to /_ah/xmpp/presence/available/ signal that the user is available and provide the user's chat status. -Posts to /_ah/xmpp/presence/unavailable/ signal that the user is unavailable. -Posts to /_ah/xmpp/presence/probe/ request a user's current presence.
  • 30.
    Other Important Partsof Go Configuration Tools
  • 31.