40
Azure App Service: Mobile Apps Андрей Чебукин

Андрей Чебукин: App service

  • Upload
    dataart

  • View
    53

  • Download
    0

Embed Size (px)

Citation preview

Azure App Service: Mobile AppsАндрей Чебукин

XperiAndri © 2015

Azure App Service

API AppsEasily build and

consume APIs in the cloud

Web AppsWeb apps that scale with your business

Mobile AppsBuild Mobile apps

for any device

LOGIC AppsAutomate business

process across SaaS and on-premises

App Service Application Composition

Web Apps Mobile AppsLOGIC Apps

API Apps

Платформа App Service

API Apps

Web Apps

Mobile Apps

LOGIC Apps

XperiAndri © 2015

ДемоСоздаём Azure Mobile App

XperiAndri © 2015

Ключевые возможности• Авто-масштабирование под нагрузкой

• Географическое масштабирование

• Непрерывное развёртывание

• WebJob

• Быстрая интеграция со сторонними сервисами

• Интегрированная аналитика

Группы ресурсовResource groups

XperiAndri © 2015

Resource Group контейнер для ресурсов

один ресурс в одной группе

охватывает разные регионы

охватывает разные типы ресурсов

RESOURCE GROUP

XperiAndri © 2015

Azure Resource Manager

Развёртывание Организация Управление

XperiAndri © 2015

императивно

или

декларативно

Выбирай сам

New-AzureVM –VM $myVMNew-AzureStorageAccount –StorageAccountName $acctSet-AzureVNetConfig –ConfigurationPath -Path

{ "$schema": "https://../deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": {}, "variables": {}, "resources": [], "outputs": {}}

XperiAndri © 2015

App-centric Resource Groups and Templates

Resource Group

SQL DBAppService

VirtualMachine

My3 Tier

Template

reference()

XperiAndri © 2015

App-centric Resource Groups and Tier-centric Templates

Resource Group

SQL DBAppService

VirtualMachine

MyDB Tier

Template

MyWeb TierTemplate

MyVM Tier

Template

reference()

XperiAndri © 2015

App-centric Resource Groups and Nested Templates

reference()

Resource Group

SQL DBAppService

VirtualMachine

My NestedDB Tier

Template

My NestedWeb TierTemplate

My NestedVM Tier

TemplatePa

rent

Tem

pla

te

reference()

XperiAndri © 2015

Tier-centric Resource Groups and Templates

Resource Group Resource GroupResource Group

SQL DBAppService

VirtualMachine

MyDB Tier

Template

MyWeb TierTemplate

MyVM Tier

Template

Linked Resource

XperiAndri © 2015

ДемоПроект групы ресурсов

XperiAndri © 2015

Управление доступом используя роли

XperiAndri © 2015

Теги ресурсов

• Пары ключ-значение назначенные ресурсу или группе ресурсов

• Видны по всей подкиске

• До 15 тегов на ресурс

XperiAndri © 2015

Варианты использования тегов

• По окружению: dev/test/prod

• По роли ресурса: web/cache/db

• По отделу в компании: finance/retail/legal

• По ответственному лицу: Вася Пупкин

Новые возможности App Service

XperiAndri © 2015

Staging

XperiAndri © 2015

Staging

XperiAndri © 2015

Staging

XperiAndri © 2015

Staging

XperiAndri © 2015

Testing in Prod.

100%

80%

20%

XperiAndri © 2015

ДемоСлоты Развёртывания

Azure Mobile Apps vs. Azure Mobile Services

XperiAndri © 2015

RES

T A

PI

Offline sync

Push Notifications

Data connections

User Authentication

Facebook

Twitter Microsoft Google Azure Active

Directory

Azure Mobile Apps

Windows

iOS

Android

HTML 5/JS

Xamarin

PhoneGap

Sencha

WindowsAndroidChrome

iOS OSX

In-AppKindle

Mobile SDKs

Backend code

SQL MongoTables O365 API Apps

Offline Sync

Azure MobileOffline data sync

Наилучшие мобильные приложения умеют хорошо обрабатывать обрывы связи.

Реализовать синхронизацию с режимом работы без интернета (offline) довольно сложно.

Но с Azure Mobile App – это просто!

XperiAndri © 2015

Как это работает

• Таблицы Mobile доступные offline

• Сохраняется локальная очередь Create, Update, Delete операций

• Разрешаются конфликты

• Мягкое удаление на сервере

• Можно отправлять принудительные оповещения чтобы запустить синхронизацию

XperiAndri © 2015

▲, 1■, 2

▲, 1

▲, 1

●, 2

■, 2

Разрешение конфликтов в режиме оптимистического пралеллизма

Device 1Server

Device 2

▲, 1 ▲, 1

▲, 1 ▲, 1

▲, 1

■, 2

▲, 1

Create

Fetch

Update

Update

■, 2 ✘

XperiAndri © 2015

Принудительные оповещения 101

Register device handle at app launch1. Client app retrieves handle from Platform Notification Service (PNS)2. Client app sends handle to your custom backend

Send Notification3. Your backend connects to PNS and requests push

Your code has to manage scaleYour code has to map between logical users and device handles

4. PNS pushes notification to device

Maintain backend device handles5. Your code must delete expired handles when PNS rejects them6. Your code must map between logical users and device handles

PlatformNotification

Service

App back-end

Client app

1

23

4

5

6

Azure Notification Hubs

Register device handle at app launch1. Client app retrieves handle from Platform Notification Service2. Client sends handle to your backend

Backend registers with Notification Hub using tags to represent logical users and groups

Send Notification3. Backend sends request to Notification Hub using a tag

Notification Hub manages scaleNotification Hub maps logical users/groups to device handles

4. Notification Hub delivers notifications to matching devices via PNS

Maintain backend device handles5. Notification Hub deletes expired handles when PNS rejects

them6. Notification Hub maintains mapping between logical

users/groups and device handles

PNS

App back-end

Client app

1

2

2

4

5

6

NotificationHub

3

4

XperiAndri © 2015

Вывод: Azure Mobile offline sync• Легко и удобно

Не нужно самому реализовывать database-to-database синхронизацию

• Работает с разными хранилищамиSQL, Azure Tables, Mongo, Dynamics CRM, Salesforce, etc.

• Cross-platform client SDKsWindows Universal, Xamarin, iOS, Android

XperiAndri © 2015

Вывод: Azure Mobile offline sync• Поддерживает и режим “постоянно на связи”, и

“периодически подключённый”Явная отправка и получение данных оставляют управление разработчику

• Гибкие и функциональныеПоддерживают свои способы хранения данных локальноРазрешение конфликтов на севере или клиенте

XperiAndri © 2015

Вывод: Azure Mobile Apps• Azure Mobile Apps = Mobile Services + App Service

• Используйте всю мощь Azure Web Apps для вашего мобильного backend

• Подключайте API Apps, SaaS connectors

XperiAndri © 2015

Azure Mobile Apps

• Быстро создать прототип мобильного сервиса

• Быстро масштабировать под нагрузку

• Быстрое развёртывание из удобного расположения

• Быстрое подключения сторонних глобальных сервисов

• Интегрированная аналитика

XperiAndri © 2015

Спасибо за внимание

XperiAndri © 2015

Андрей Чебукин

XperiAndri

• Блогhttp://xperiandri.azurewebsites.net/

• GitHubhttps://github.com/xperiandri/

• Профили в соц. сетяхwww.fb.com/xperiandri www.vk.com/xperiandri

• Youtubehttps://www.youtube.com/user/andriicsharp/videos