34
Google confidential Do not distribute Google confidential Do not distribute Building mobile app backend with Google Cloud Platform Dmitry Nefedkin Google Cloud Platform Solutions Engineer Natalia Efimtseva Developer Relations Program Manager

#MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Embed Size (px)

DESCRIPTION

#MBLTdev: Конференция мобильных разработчиков Спикер: Дмитрий Нефедкин Пресейл инженер, Google http://mbltdev.ru/

Citation preview

Page 1: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

Google confidential │ Do not distribute

Building mobile app backendwith Google Cloud PlatformDmitry NefedkinGoogle Cloud Platform Solutions Engineer

Natalia Efimtseva Developer Relations Program Manager

Page 2: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

Agenda

Google Cloud Platform - why should I care?

“API-first” backend development with Google Cloud endpoints

“Frontend-first” approach and how Firebase can help

1

2

3

Page 3: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

Agenda

Google Cloud Platform - why should I care?

“API-first” backend development with Google Cloud endpoints

“Frontend-first” approach and how Firebase can help

1

2

3

Page 4: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Source: http://blogs.telerik.com/platform/posts/14-05-13/introducing-telerik-platform-developer-edition-for-just-$39-monthSource: Developer Economics Q3 2014: State of the Developer Nation

`

2.9Mmobile developers worldwide

Page 5: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

2Mapps alreadydeveloped

Source: http://fraudforthought.com/index.php/its-an-apps-world/Source: Developer Economics Q3 2014: State of the Developer Nation

Page 6: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Developers target

2.3platform on average

Source: http://www.techtimes.com/articles/13106/20140815/android-ios-combined-market-share-swells-leaving-2-5-percent-for-windows-phone.htmSource: Developer Economics Q3 2014: State of the Developer Nation

Page 7: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Source: http://41mag.fr/wp-content/themes/channel/images/menuHtml5.pngSource: Developer Economics Q3 2014: State of the Developer Nation

HTML5 is used by

42%of developers as a technology for app development

Page 8: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

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

Images by Connie Zhou

Page 9: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

A Network that Spans the Globe

Page 10: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

A Network that Spans the Globe

Page 11: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

Continue to Innovate & Improve our Tooling

SpannerDremelMapReduce

Big Table ColossusCompute

Engine

2012 2014+2002 2004 2006 2008 2010

GFS

2013

More!

Page 12: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

Storage

Cloud Storage Cloud SQL Cloud Datastore

Compute

Compute EngineApp Engine

App Services

BigQuery Cloud Endpoints

Google Cloud Platform

Page 13: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

Mobile Gaming Storage

Big Data Highly Scalable Apps Digital Marketing

Yes, We Can Power That

Page 14: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

Agenda

Google Cloud Platform - why should I care?

“API-first” backend development with Google Cloud endpoints

“Frontend-first” approach and how Firebase can help

1

2

3

Page 15: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

API-First development: What & Why

Image from “How API-First Development Boosts Productivity”full story - http://goo.gl/o3WBIq

What:every piece of shared functionality for your organization it should be exposed as a RESTful HTTP API to all of your other developers

Why:● Enforcing separation of

concerns;● Hiding complexity

“API Economy” is coming

Page 16: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google App Engine: easy to build, scale, maintain

● Java, Python, PHP, Go Support

● Rapid application development

● Scale infinitely

● Replicated data storage

● Versioning and Traffic Splitting

● Familiar development tools

Page 17: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google Cloud Endpoints

Extremely simple way to expose server side logic on full power, management free Google App Engine platform

• Uses App Engine’s auto-scaling and high-availability

• Exposes standards based REST interfaces with built-in authorization

• Auto-generates strongly typed, mobile optimized client libraries for Android, iOS and web.

• Makes you more productive!

Page 18: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Taking the plumbing out of API programming

Mobile Backend Running on Google App Engine Instances

Mobile Backend Running on Google App Engine Instances

Mobile Backend Running on Google App Engine Instances

Cloud Endpoints

Clients

Page 19: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Android Studio + Cloud Endpoints

Easiest way for mobile developers to connect to Google Cloud Platform

• Create Google App Engine backends in Android Studio

• Generate Java-specific bindings for use in Android app

• Benefit from as-you-type validations and quick-fixes when defining the backend API

• Use App Engine-specific Gradle tooling that allows for a unified client/backend build

Page 20: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Call Cloud Endpoints API from iOS

● Generate RPC Discovery documents in AndroidStudio using

appengineEndpointsGetDiscoveryDocs Gradle task

● Download and build ServiceGenerator

● Use ServiceGenerator command line utility to generate Objective-C code from

RPC Discovery document

● Include generated Objective-C files to your XCode project

● Add code to call Cloud Endpoints API from the UI of the app

For more info: http://goo.gl/JhdaVW

Page 21: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Call Cloud Endpoints API from Javascript

• Use the Google Javascript Client Library

<script src="https://apis.google.com/js/client.js?onload=init"></script>

• Load the endpoint

var ROOT = 'https://your_app_id.appspot.com/_ah/api';

gapi.client.load('your_api_name', 'v1', function() { doSomethingAfterLoading();}, ROOT);

• Use the endpoint:gapi.client.tictactoe.scores.insert({'outcome':

'WON'}).execute(function(resp) {

console.log(resp);

});

More info: http://goo.gl/5ynKEb

Page 22: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential | Do not distribute

Demo: a case management app for mobile workers

Page 23: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

getTask().execute()

Cloud Datastore

App Engine backend

Clou

d En

dpoi

nts

Cases app

Clie

nt L

ibra

ries

Demo Architecture

pullFromRemote

pushToRemotestoreTask().execute()

query.get() transaction.commit()

Chrome Mgmt Extension

getAllCases().execute()

updateCases().execute()

Java

scri

pt L

ibra

ries

Page 24: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential | Do not distribute

● Delivers > 700 million photos &

videos per day (May, 2014)

● Heavy user of App Engine services

● 3 M DAU

● Started to use Compute Engine for

some services

Snapchat

Page 25: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential | Do not distribute

● Angry Birds for Chrome, FB

● Using the Datastore to store game data

● Memcache API

● Task Queues for Background Operations

● Users API for Authentication

Rovio

Page 26: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential | Do not distribute

● SongPop - “guess a song

application”

● Serves 18TB a day with 80

million users

● Fetching media from Google

Cloud Storage

● Just 3-4 developers per

project

FreshPlanet

Page 27: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

Agenda

Google Cloud Platform - why should I care?

“API-first” backend development with Google Cloud endpoints

“Frontend-first” approach and how Firebase can help

1

2

3

Page 28: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

API-first is cool but...

● we do not have dedicated

backend developers;

● we want to prototype quickly;

● we just need to store the data

and sync them between the

connected clients;

● we need offline support;

Image source: https://beingsakin.files.wordpress.com/2011/11/yesbut.jpg

Page 29: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

Firebase

“Over the past three years, we’ve gone from a crazy idea that ‘just might work’ to a proven product used by 110,000 developers. Today, I couldn’t be happier to announce that we’ve joined Google.”

Page 30: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

Firebase

● Server and NoSQL database to interact with through API calls

● Sync data from multiple applications● Simple Login Service with several

types of built-in authentication● Security: SSL encryption & security

rules● Support offline mode

Page 31: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

Firebase Forge

The Firebase Forge provides a convenient GUI for visualizing and manipulating your data in real-time.

Page 32: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

Firebase demo: image drawing application

Page 33: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

$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: devbyte

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 34: #MBLTdev: Разработка backend для мобильного приложения с использованием Google Cloud (Google)

Google confidential │ Do not distribute

cloud.google.com

Dmitry Nefedkin ([email protected])Google Cloud Platform Solutions Engineer

Natalia Efimtseva ([email protected])Developer Relations Program Manager

Images by Connie Zhou