Building Node.js applications for Microsoft Azure cloud

44
Building Node.js applications for Microsoft Azure cloud Catalin Fratila 2014 © Skype September 2014

description

Building Node.js applications for Microsoft Azure cloud . Presentation held on 14 September 2014 in WebExpo, Prague.

Transcript of Building Node.js applications for Microsoft Azure cloud

Page 1: Building Node.js applications for Microsoft Azure cloud

Building Node.js applications for Microsoft Azure cloudCatalin Fratila

2014 © Skype

September 2014

Page 2: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Agenda

• Why should you do it?

• Possibilities

• Where to store data?

• Development, Build and Deployment

• Demo

Slide 2

Page 3: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

What is Azure?

Slide 3

Page 4: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Benefits of Azure – Powerful Capabilities

Slide 4

data

servicesTable

StorageHDInsightBlob

storageSQL

database

app

services

Media

HPCIntegration Analytics

Caching IdentityService

Bus

Web SitesMobile

Services

Cloud Services

infrastructure

servicesCDN

Virtual Machines

Virtual Network VPN

Traffic Manager

Page 5: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

What is Node.js?• Server-side JavaScript

• Core in C++ on top of V8

• Open Source (MIT license)

• Provide an easy way to build scalable network programs

Slide 5

Page 6: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Benefits of Node.js• Server-side JavaScript

• Handles thousand of concurrent connections with minimal overhead on a single process

• Asynchronous I/O Framework

• Swiss army knife for network related work

• NPM

• Community

• Good for: real-time communications, custom network services, JSON web services etc.

Slide 6

Page 7: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

How to build a web service in Azure

• Virtual machines

• Cloud Services

• Web Sites

Slide 7

Page 8: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Virtual machines

• Windows Server and Linux

• Flexible Workload Support

• Built-in Virtual Private Networking, Load Balancing

Slide 8

For current VM Linux pricing: http://azure.microsoft.com/en-us/pricing/details/virtual-machines/#linux For more information about Virtual Machines: http://msdn.microsoft.com/library/azure/dn197896.aspx

For current VM Windows pricing: http://azure.microsoft.com/en-us/pricing/details/virtual-machines

Page 9: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Cloud services

• Build infinitely scalable apps and services

• Support multi-tier architectures

• Automated application management

Slide 9

For current Cloud Services pricing: http://azure.microsoft.com/en-us/pricing/details/cloud-services/

For more information about Cloud Services: http://azure.microsoft.com/en-us/services/cloud-services/

Page 10: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Web Sites

• Build application using ASP.NET, Java, Python, Node.js or PHP

• Built-in AutoScale and Load Balancing

• Continuous Deployment with Git, TFS, GitHub

Slide 10

For current Websites pricing: http://azure.microsoft.com/en-us/pricing/details/web-sites/

For more information about Websites: http://azure.microsoft.com/en-us/services/web-sites

Page 11: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Where to store data?

• Azure Storage

• CDN

• Others

Slide 11

Page 12: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Storage

• Highly scalable

• Durable & highly available

• Designed for developers

• Global Reach

• Cost effective

Slide 12

For Storage pricing: http://azure.microsoft.com/en-us/pricing/details/storage/

For more information about Storage: http://azure.microsoft.com/en-us/services/storage/

Page 13: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Content Delivery Network

• Low latencies

• Massively scalable

• Capacity on demand

• Robust security

Slide 13

For CDN pricing: http://azure.microsoft.com/en-us/pricing/details/cdn/

For more information about CDN: http://msdn.microsoft.com/library/azure/ee795176.aspx

Page 14: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Others

• MongoDB

• Azure DocumentDB

• Azure SQL Database

Slide 14

For more information about MongoDB: http://azure.microsoft.com/en-us/gallery/store/mongodb/mongodb-inc/

For more information about DocumentDB: http://azure.microsoft.com/en-us/documentation/services/documentdb/

For more information about SQL: http://azure.microsoft.com/en-us/documentation/services/sql-database/

Page 15: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Development, Build and Deployment?

• Support in Visual Studio

• Grunt + Git

Slide 15

Page 16: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Node.js in Visual Studio• Node.js Tools for Visual Studio

• IntelliSense• Completions

• Signature help

• Debugging

• npm

• Azure Deployment• Web Site using Web Deploy

• Web Site using Git

• Cloud Service – Web Role and Worker Role

• Testing

Slide 16

Page 17: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Not used with Visual Studio?• Use Git to manage deployments and your own IDE to develop

Slide 17

Web Sites Git

Page 18: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Automate

• Grunt – the JavaScript Task Runner

Slide 18

Page 19: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

DEMO

Slide 19

Page 20: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Azure Web Portal

Slide 20

Page 21: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Create new Web Site

Slide 21

Page 22: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

New Website

Slide 22

Page 23: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Manage the Web Site

Slide 23

Page 24: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Set-up Git local repository

Slide 24

Page 25: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Setup credentials for the Git repository

Slide 25

Page 26: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Git deployment overview page

Slide 26

Page 27: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Write code locally and run it

Slide 27

Page 28: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Deploy application

Slide 28

Page 29: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Deploy application

Slide 29

Page 30: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Deploy application

Slide 30

Page 31: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Deploy application

Slide 31

Page 32: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Publish changes

Slide 32

Page 33: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Publish changes

Slide 33

Page 34: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Grunt

Slide 34

npm install grunt-cli

npm install grunt --save-devnpm install <dep-name> --save-dev

npm init

Page 35: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Grunt

• Package.json

Slide 35

Page 36: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Grunt

• Gruntfile.js

Slide 36

Page 37: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Why not introduce CDN?

Slide 37

Page 38: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Why not introduce CDN?

Slide 38

Page 39: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

What changes?

Slide 39

Page 40: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

What changes?

Slide 40

Page 41: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

What changes?

Slide 41

Page 42: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Conclusions

Slide 42

• Azure, Node.js, Git, Grunt – all working together

• Web Sites - easy to use, not too many configurations

• Storage - cheap

• Development, build and deployment

Page 43: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Resources

Slide 43

• Azure - http://azure.microsoft.com/en-us/

• Node.js Developer Center - http://azure.microsoft.com/en-us/develop/nodejs/

• Grunt - http://gruntjs.com/

• Node.js - http://nodejs.org/

• Node.js Tools for VS - https://nodejstools.codeplex.com/documentation

• Proof of concept demo - https://onedrive.live.com/redir?resid=FE58AA4F21A81AE9%21105

Page 44: Building Node.js applications for Microsoft Azure cloud

2014 © Skype

Questions?

Slide 44