22
Building a chat app with Windows Azure Mobile Services 1 march 2014, Timisoara

Building a chat app with windows azure mobile services

Embed Size (px)

DESCRIPTION

A breaf introduction in Windows Azure Mobile Services. This presentation shows you how you can build a full cross-platform chat application ( social media providers auth, push notification). The server side code is written in node.js

Citation preview

Building a chat app with Windows Azure Mobile Services

1 march 2014, Timisoara

Flavius Radu DemianSoftware developer, Avaelgo

I really like programming, like really love itI love web and mobile

I won Excite 2 year ago

Please feel free to ask questions any time and don’t be shy because

Knowledge is power

[email protected] | [email protected] | @slowarad

This is for the ladies

Have a nice spring !

Let’s begin…But before…

Agenda

OverviewStorage

Custom APIAuthentication & Authorisation

SchedulerDiagnostics & Logging

ScaleCool Third Party Add-Ons

Event TimelineReview

A visual representation

Overview

Clients for: Windows StoreWindows Phone 8 iOS, Android, Javascript

You can add a cloud backend to your app in minutes without the need for server codeAll the SDK’s are open source click meIt’s integrated with GITYou can use filters on you clients to manipulate easily data click me

Create Service, Download Free App and GIT ( add package) Demo click me

Storage

Windows Azure SQL DatabaseDynamic schema on/off

REST API generated per tableData centric platform

Access your data through :Portal

Sql Management StudioRest API

Storage

JSON to SQL data types conversions

Demo with portal and sql server

Server side logic

Node.js :is a software platform for scalable server-side and

networking applications. applications are written in JavaScript can be run within

the Node.js runtime on Windows, Mac OS X and Linux with no changes.

It is written in

“Data Centric” Server Logic

Backend runs Node js on small azure VM’s“Interceptors” exposed for all CRUD requests to all tablesYou only get access to a predefined set of node modules :

request, console, push.*, tables, statusCodes, azure, mssql click me

Demo with interceptors and packages

Custom API

You can make your own api very quickly

Let’s see how: click me and after let’s look at the demo

Push notifications

The notification provider server mentains a "persistent IP connection" with your Device in order to deliver notifications when the app needs to 'say' something to you. Payload limited, specific to platform The global push object is used to send push notifications Success and Error callbacks are provided

Push notifications overview

Demo

1) The app requests a channel from the Notifications Provider

2) The app send the channel uri to Azure Mobile Services which stores it

3) When a notification is sent Azure Mobile Services executes something like this:

push.mpns.send(channelUri….)

Windows Phone case study

4. The notifications goes through the Notifications Provider which forwards it to the device

Authorisation

Table level authorisation for CRUD operation

Everyone: any request by anyone is acceptedAnyone with Application Key: app key is sent on the request distributed ( default) Authenticated Users: users authenticated with one of the mentioned identity providers Scripts and Admins: registers scripts or requests via the master key

The application key is not secure and should not be used to authenticate users of your app

Demo

Scheduler

Run jobs on simple or complex recurring schedules such as:

Send broadcast push notificationsArchiving old or duplicate data recordsProcessing or resizing stored images

Invoking a Web Service over HTTP/sPost a message to a Windows Azure Storage Queue

Demo

Diagnostics and Logging

View diagnostics directly in the portal including API calls, CPU time and Data Out

LoggingConsole.* operations like console.log and console.error provide an easy means to debug

your server side scripts.

Demo

Scale

Compute - scale between shared and reserved mode, Increase/decrease your instance count

Storage ability to scale out your mobile service tenant(s) to a dedicated SQL DB

Ability to scale up your SQL DB from web through business to 150GB

Event Timeline

Review of Azure Mobile Services

Create a scalable and secure backend for your Windows, Android, and iOS appsStore data in the cloud

Easily authenticate usersSend push notifications

Consume your favorite servicesMonitor, alert, and auto scale

Cheap and FREE in some cases -> click herePreview: No availability Service Level Agreement

Paid: General Availability: 99.9%

Thanks

Good luck at Excite

I hope you will win and after that hold a presentation like I do now

Let’s look more at the code, don’t worry the questions will come inevitably