42
No fiddle, efficient development on the Google Cloud Platform Dmitry Nefedkin Google Cloud Platform Solutions Engineer, Google Bogdan Botea Lead Developer, Appsbroker Consulting

Bogdan botea, dmitry nefedkin no fiddle, efficient development on the google cloud

Embed Size (px)

DESCRIPTION

CodeCampIasi25Oct2014

Citation preview

Page 1: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

No fiddle, efficient development on the Google Cloud Platform

Dmitry NefedkinGoogle Cloud Platform Solutions Engineer, Google

Bogdan BoteaLead Developer, Appsbroker Consulting

Page 2: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

● Founded 7 Years ago, UK based● Google Reseller, Consultancy, Managed Services & Products● Google EMEA Partner of the year 2012● Worked on some of Google’s most prestigious projects● UK Premier Apps Reseller, Cloud Platform Service Provider,

We are also a Premier Search Reseller● GEO, GSA, Platform & Apps Certified

Who are Appsbroker?

Page 3: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Please note that some of the slides have been removed.

Please come to our next event to get updated on the latest information about Google for Work and Appsbroker.

Page 4: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Agenda■ Google awesome infrastructure - Dmitry■ Before the clouds■ Appsflow on App Engine■ Live coding■ Q&A

Page 5: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud
Page 6: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Google confidential | Do not distribute

Enrich your work environment.

Enable your information workers.

Drive innovation.

Live in a modern workplace.

Why Cloud Computing?

Page 7: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Google confidential | Do not distribute

Enterprise Cloud Platform market will exceed $22B globally by 2015.2013

Page 8: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

IT Trends

The decreasing cost of storage enables virtually limitless storage in the cloud. $600 can buy enough storage for the world’s music.

(Source: McKinsey Global Institute May 2011)

Computing as a utility is now available for easy purchase, provided from massively efficient data centers.

(Source: Nicholas Carr, The Big Switch, 2008)

The internet allows for a model of real-time access to new innovation, information and applications from a wide range of devices.

AffordableCapacity

On-demandcomputing

Instantaccess

Page 9: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

For the past 16 years, Google has been building out the world’s fastest, most powerful, highest quality cloud infrastructure on the planet.

Page 10: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Cloud Platform is built on the same infrastructure that powers Google.

Page 11: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Google's Network Spans the Globe

Page 12: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Google's Global OpenFlow Network

Page 13: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

2002 2004 2006 2008 2010 2012

Google Innovations in Software

ColossusDremelMapReduce

SpannerGFS Big Table

Page 14: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Images by Connie Zhou

Wired, 'Google Throws Open Doors To Its Top Secret Data Center', October 2012

Google's Platform"[Google's] ability to build, organize, and operate a huge network of servers and fiber-optic cables with an efficiency and speed that rocks physics on its heels.

This is what makes Google Google: its physical network, its thousands of fiber miles, and those many thousands of servers that, in aggregate, add up to the mother of all clouds."

- Wired

Page 15: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

IaaS PaaS SaaSInfrastructure-as-a-Service Platform-as-a-Service Software-as-a-Service

Google Cloud Platform

Cloud Computing

Page 16: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

IaaS PaaS SaaSInfrastructure-as-a-Service Platform-as-a-Service Software-as-a-Service

Google

ApplicationsDataRuntimeMiddlewareO/SVirtualizationServersStorageNetworking

ApplicationsDataRuntimeMiddlewareO/SVirtualizationServersStorageNetworking

ApplicationsDataRuntimeMiddlewareO/SVirtualizationServersStorageNetworking

PackagedSoftware

ApplicationsDataRuntimeMiddlewareO/SVirtualizationServersStorageNetworking

Cloud ComputingYou Manage Vendor Managed

Page 17: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Storage App ServicesCompute

Cloud Storage

Cloud SQL

Cloud Datastore

Compute Engine

App Engine

BigQuery

Cloud Endpoints

Google Cloud Platform

Page 18: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Mobile Gaming

Big Data

Storage

High Performance Computing Digital Marketing

Page 19: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

4 Million active applications in our cloud

Page 20: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

And your applicationcan be the next!

Dmitry NefedkinGoogle Cloud Solutions [email protected]

Page 21: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

No fiddle, efficient development on the Google Cloud Platform

Bogdan BoteaLead Developer, Appsbroker Consulting

Vasile IrimiaGoogle Cloud Platform Developer, Appsbroker Consulting

Page 22: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Appsbroker team

Page 23: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Agenda■ Google awesome infrastructure - Dmitry■ Before the clouds■ Appsflow on App Engine■ Live coding ■ Q&A

Page 24: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Today’s developers

Page 25: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Flip the focus

Page 26: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Copyright 2014 Google Inc

GAE Architecture And Optmization

Use Case - Real Time Earthquake Monitor

NIED

App Engine

Metrics collected at

NIED

NIED pushes the image file to GAE every second

Clients pulls the image every two seconds

● GAE Web App By NIED Japan + Googleo National research Institute for

Earth science and Disaster prev.o The blinking dots represents real

time Peak Ground Acceleration ● YouTube video How it worked at the

March 11, 2011 earthquake● 20,000 concurrent users

10,000 reqs/sec at peak

Page 27: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Web Application challenges● Scalability

● Reliability

● Cost efficiency

Designing for Scale and Reliability

How do I design a web service that is scalable and reliable like this?

Page 28: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Copyright 2014 Google Inc

GAE Architecture And Optmization

To Build in Traditional Way...

➢ Hardware Failures

➢ Traffic Spike

➢ Growing Big Data

➢ Complex Design

➢ Complex Dev.

➢ Complex Admin

➢ Cost

What About

Page 29: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Copyright 2014 Google Inc

GAE Architecture And Optmization

To Build with Google App Engine

✓ Hardware Failures

✓ Traffic Spike

✓ Growing Big Data

✓ Simpler Design

✓ Simpler Dev

✓ No Admin

✓ No Initial Funding

How About

Page 30: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Agenda (to redesign)■ Google awesome infrastructure - Dmitry■ Before the clouds■ Appsflow on App Engine■ Live code ■ Q&A

Page 31: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Appsflow

Page 32: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Appsflow - Data model

● HRD Datastore

● Sharding

● Denormalization

Page 33: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Appsflow - HRD DatastoreDatastore RDBMS

Query language flexibility

SQL-like query language● Limited to simple filter and sort

Full support of SQL● Table JOIN● Flexible filtering● Subquery

Reliability and Scalability

Highly scalable and reliable Hard to scale

Page 34: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Appsflow - Service layer

● Business logic & transaction management

● DI

● Task Queue API

● Cron jobs

Page 35: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Appsflow - Task QueueUse Task Queue API to execute background work

Queue queue = QueueFactory.getQueue("workflow-queue");

queue.add(TaskOptions.Builder.withUrl("/backend/taskqueue").

param("nodeId", node.getKeyAsString()));

Page 36: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Appsflow - Cron jobsUse Cron jobs to execute periodic tasks

<?xml version="1.0" encoding="UTF-8"?>

<cronentries>

<cron>

<url>/checkworkflows</url>

<description>Periodically check for blocked workflows</description>

<schedule>every day 00:00</schedule>

</cron>

</cronentries>

Page 37: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Appsflow - Cloud Endpoints

● Expose standards based REST interfaces with built in Authorization

● Use auto-generated, strongly typed, mobile optimized client

libraries for Android, iOS and web.

Page 38: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Appsflow - Memcache

MemchacheService cache = MemcacheServiceFactory.getMemcacheService();

User user = cache.get(“accessToken”) ;

if (user != null) {

return user;

} else {

// retrieve user details and update the datastore

cache.put(“accessToken”, user, Expiration.byDeltaSeconds(DURATION_IN_SECONDS));

return user;

}

Page 39: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Snapchat

Delivers 400 million photos a day

Page 40: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Agenda■ Google awesome infrastructure - Dmitry■ Before the clouds■ Appsflow on App Engine■ Live coding■ Q&A

Page 41: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

$500 in Cloud Platform credit to launch your idea!

Build. Store. Analyze.On the same infrastructure

that powers GoogleA voucher will be sent to your email

Click ‘Apply Now’ and complete the application with

promo code: codecamp-con

1

2

3

Go to cloud.google.com/starterpack

Start using Cloud Platform now!

4 Create a new Project in Cloud Console,

activate the billing and apply voucher -

http://console.developers.google.

com/billing/redeem

Page 42: Bogdan botea, dmitry nefedkin   no fiddle, efficient development on the google cloud

Q&A

Bogdan [email protected]