Top Banner
20.03.2012 Dipl.-Inf. (FH) Johannes Hoppe Getting started with Node.js and MongoDB on MS Azure ®
34
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Software Tests with MongoDB

20.03.2012 Dipl.-Inf. (FH) Johannes Hoppe

Getting started with Node.js and MongoDB on MS Azure

®

Page 2: Software Tests with MongoDB

Hello

01

Page 3: Software Tests with MongoDB

Johannes Hoppe IT-Consultant & Web Developer

www.johanneshoppe.de

Page 4: Software Tests with MongoDB

JavaScript?

Page 5: Software Tests with MongoDB

As a server side

language?

Page 6: Software Tests with MongoDB

Executed inside

a database?

Page 7: Software Tests with MongoDB

For a hardware-

accelerated

3D game?

Page 8: Software Tests with MongoDB

Hosted on

WINDOWS?

Page 9: Software Tests with MongoDB

Yes! of course

Page 10: Software Tests with MongoDB

Live Demo www.solartournament.org

Page 11: Software Tests with MongoDB
Page 12: Software Tests with MongoDB

SDK for Node.js

02

Page 13: Software Tests with MongoDB

PaaS / IaaS

Visual Studio 2010

Targets .NET, but also and now officially:

Java, PHP, Node.js… MongoDB

platform

Cloud

Page 14: Software Tests with MongoDB

Event-driven Asynchronous I/O

JavaScript Google V8 engine

Server-side MIT License

Page 15: Software Tests with MongoDB

www.windowsazure.com/en-us/develop/nodejs/

Page 16: Software Tests with MongoDB

What you get › Node.exe

› IISNode (native IIS module)

› NPM for Windows (package manager)

› […]

Page 17: Software Tests with MongoDB

Live Demo / Windows PowerShell

› New-AzureService helloworld

› Add-AzureNodeWebRole

› Start-AzureEmulator -launch

Page 18: Software Tests with MongoDB

server.js var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello world!'); }).listen(process.env.PORT);

Page 19: Software Tests with MongoDB

Azure SDK for Node.js

Troubleshooter

Page 20: Software Tests with MongoDB

Tricky Emulator › Webinstaller: Decide for IIS Express

› Start PowerShell with Admin Rights

Page 21: Software Tests with MongoDB

Tricky Emulator › Check the Windows Event log

› Last resort: start node.exe manually

Page 22: Software Tests with MongoDB

Deployment / Windows PowerShell

› Get-AzurePublishSettings

› Import-AzurePublishSettings filename.publishSettings

› Publish-AzureService -name UniqueName -location "North

Europe" -launch

Page 23: Software Tests with MongoDB

Node.js Web Application Tutorial:

http://www.windowsazure.com/en-

us/develop/nodejs/tutorials/getting-started/

Page 24: Software Tests with MongoDB

MongoDB

03

Page 25: Software Tests with MongoDB

“Microsoft has been working with 10gen

to provide MongoDB database

integration for Windows Azure,

including deployment packaging,

documentation, and code samples.” MSDN, December 2011: http://msdn.microsoft.com/en-us/library/gg441573.aspx

Page 26: Software Tests with MongoDB

http://downloads.mongodb.org/azure/

AzureMongoDeploymentCmdlets.msi

Page 27: Software Tests with MongoDB

PowerShell › Only once: Get-AzureMongoDBBinaries

› New-AzureService helloMongo

› Add-AzureMongoWorkerRole

› Join-AzureNodeRoleToMongoRole WebRole1

› npm install mongodb

Page 28: Software Tests with MongoDB

Node.js Web Application

with Storage on MongoDB Tutorial:

https://www.windowsazure.com/en-

us/develop/nodejs/tutorials/web-app-with-mongodb/

Page 29: Software Tests with MongoDB

TODO!

Page 30: Software Tests with MongoDB
Page 31: Software Tests with MongoDB

Questions?

Page 32: Software Tests with MongoDB

Thank you! Johannes Hoppe

Page 33: Software Tests with MongoDB

Next Speaking Engagements › 12.04.2012 – .NET UG Niederrhein: AOP / .NET

› 10.05.2012 – .NET UG Karlsruhe: NoSQL / .NET

› 14.05.2012 – .NET Developer Conference (DDC)

Nürnberg: NoSQL / .NET (2 talks)

Page 34: Software Tests with MongoDB

Picture credits

wave © THesIMPLIFY – Fotolia.com

Stressed businessman © Selecstock – Fotolia.com

Ausgewählter Ordner © Spectral-Design – Fotolia.com

Warnhinweis-Schild © Sascha Tiebel – Fotolia.com

Liste abhaken © Dirk Schumann – Fotolia.com