11-00-Best Practices For CouchDB Developers On Windows Azure

Published on 2 weeks ago | Categories: Documents | Downloads: 0 | Comments: 0 | Views: 14
of x
Download PDF   Embed   Report




Best Practices for CouchDB Developers on Windows Azure Brian Benz, Sr. Technical Evangelist Microsoft Open Technologies, Inc.  [email protected]  [email protected] ft.com


Agenda •

App Demo Windows Azure CouchDB Windows Azure Virtual Machines Windows Azure Web Sites ptions for wor!ing wor !ing with Azure VMs and Web Sites

"nder the hood of the app# $ode%&s  –





Demo Conference Scheduling Conference App

Windows Azure* Virtual Machines* Web Sites*

CouchDB* node%&s* grunt


Demo +in! http#,,a-&amepi-conf-couchdb-twitter%azurewebsites%net,. home,schedule



Conference Scheduler •

Attendees can trac! sessions* vote sessions up and down 0ine Capabilities  –


CouchDB VM for Data Storage Web site hosting the application  –


$ode%&s 'runt


Demo Architecture WAWS Windows Azure Virtual Machine Node.js app: •

• •

Store and 2etrieve Schedule 3ilter b4 criteria Store in CouchDB



Browser app $ode%&s 'runt


Windows Azure in 56 Seconds A brief high-level overview for those who are new to Windows Azure


Cloud Computing Pac!aged Software

1nfrastructu re 8as a Service9

Applicatio ns Data 2untime   e   g   a   n   a

Middlewar e ,S

  m   u   o    7 Virtualizatio

Applicatio ns Data   e   g   a   n   a 2untime   m   u   o    7 Middlewar

n Servers Storage


$etwor!in g

$etwor!in g


8as a Service9

8as a Service9

  e   g   a Applicatio   n   a ns   m Data   u   o    7

Applications Data

2untime Middleware

e ,S Virtualizatio n Servers


,S M  a n  a  g  e  d   b   4 v  e n  d   o r 

Virtualizatio n Servers Storage $etwor!ing

2untime M  a n  a  g  e  d   b   4 v  e n  d   o r 

Middleware ,S Virtualizatio n Servers Storage $etwor!ing

M  a n  a  g  e  d   b   4 v  e n  d   o r 


Azure## What 1t 1s Windows Azure Win·dows·Az·ure :win-dohz-azher; Noun: A comprehensive set of services that enable 4ou to <uic!l4 build* deplo4 and manage applications across a global networ! of Microsoft-managed Microsof t-managed datacenters% ==%=>? Monthl4 Monthl 4 S+A S+ A datacenters% Pa4 onl4 onl4 for  for what 4ou use


Azure## What 1t 1s Windows Azure  





Azure## What 1t 1s Windows Azure

'lobal 3ootprint


Azure## What 1t 1s Windows Azure

Virtual Machines

Cloud Services

Web Sites


Azure## What 1t 1s Windows Azure



Azure## What 1t 1s Windows Azure




Consu me






'etting Started Sign up for a free trial


+earn about the latest features

http#,, http#,,channel=%msdn%com, channel=%msdn%com,vents,Win vents,WindowsAzur dowsAzureConf,6,76 eConf,6,76  


+ CouchDB on Windows Azure provides all the beneEts customers have come to e/pect from cloud computing# elasticit4* on-demand capacit4* faster time to mar!et* and p pa4-for a4-for-what-4ou-use pricing% •

CouchDB oFers built-in support for horizontal scaling Windows Azure oFers built-in support for responsive auto-scaling


Clusters# @igh Availabilit4  7ourr  7ou Application

Cluster Driver Primar4 Secondar 4 Secondar 4 Clustered nodes hosted on Windows Azure wor!er roles or virtual machines


Virtual Ma!ines Deplo4ing CouchDB on Windows Windo ws Azure virtual machines


Windows Azure Virtual Machines "buntu %6H CentS 5% penS"S % S"S +inu/ nterprise Server SP Windows Server 66G 2 Windows Server 6


Virtual Machine Sizes VM Size

CP" Cores

/tra Small

Shared J5G MB


%J> 'B 66


K%> 'B



+arge /tra +arge


J 'B




H 'B




Bandwidth . Data 8Mbps9 Dis!s >

ach Persistent Persistent Data Dis! Can be up to  IB


Deplo4ing to Virtual Machines  –







Compared to wor!er role 8PaaS9* VM-based clusters oFer more control* control* as well as more responsibility  Create new Virtual Machine L Windows 6 Start or install a Browser Download CouchDB 2un the 1nstaller and +aunch Start 3uton to verif4 install Also available# 1nstall Scripts Windows Azure 66G 1mages# •

http #,,ossonazure%interoperabi #,,ossonazur e%interoperabilit4bridges%com,a lit4bridges%com,articles,couchdb rticles,couchdb


VM Depot http#,,vmdepot%msopentech%com Call to ation: Developers can use VM Depot to reach new audiences



Windows Azure Developer Center •

pen-source SDs for popular programming languages* to get 4ou up and running <uic!l4

CouchDB drivers#

%$I driver $ode%&s driver  Nava  Na va dr drive iverr [email protected] driver

Choice of popular 1Ds such as Visual Studio

P4thon driver

and clipse


Driver download

Consistent 2SI protocols and AP1s across Windows Azure services




Command +ine S4nta/ verview prompt>




account account location account affinity-

download import list

group vm vm disk vm endpoint vm image service service cert site config

show delete start restart shutdown capture create attach detach browse set


username  password  dns-prefix vm-name lb-port target-imagename source-path disk-image-name size-in-gb thumbprint value -v -vv


/ample# Provisioning a Cluster azure vm create couchsd "OpenLogic__OpenLogic-CentOS-!"OpenLogic__OpenLogic-CentOS-!!#!$%#-en-us-%&'(vhd" username password   -l ")est *S" -e  -l azure vm create couchsd "OpenLogic__OpenLogic-CentOS-!"OpenLogic__OpenLogic-CentOS-!!#!$%#-en-us-%&'(vhd" username password   -l ")est *S" -e  -l !% -c "OpenLogic__OpenLogic-CentOS-!azure vm create couchsd "OpenLogic__OpenLogic-CentOS-!!#!$%#-en-us-%&'(vhd" username password   -l ")est *S" -e  -l !+ -c a,ure vm endpoint create couchsd !# !# a,ure vm endpoint create couchsd-! !#. !#. a,ure vm endpoint create couchsd-% !#/ !#/


VM Mana"e#ent and Auto#ation Active Director4 'roup Polic4 Windows 2emote Management 8Win2M9 SCM 6 Support for Managing Virtual Machines 3ull 2SI AP1 for Programmatic Automation and Management Windows Azure PowerShell Cmdlets Cross Platform Scripting 8+inu/* Mac and Windows9 Windows Azure Monitoring Service 8n 2oadmap9


Sriptin" Capa$ilities Automation Support • •

Windows Azure PowerShell Cmdlets Cross Platform Scripting Built on node%&s

Capabilities • • • • • •

Provisioning* 2emoval 2eboot* Start 1mport VMand settings for /port Windows +inu/ VMs Supportand Provision sion for Windows Domain Noin at Provi 3ull4 Customize VM with Data Dis!s and ndpoint ConEguration

Automate Virtual $etwor! Settings


%aaS and SaaS Deplo4ing CouchDB as Cloud Services and Software-As-A-Service


Deplo4ing CouchDB as a Cloud Service  –






Windows Azure cloud services run on a full4 automated* highl4 scalable cloud platform ngoing management of the S and infrastructure is handled b4 Windows Azure 1nEnitel4 scalable* on demand App and CouchDB in same cloud service provides securit4 PaaS approach is the easiest way to deploy CouchDB on Windows Azure 3or <uic! and simple deplo4ment* use the CouchDB on Azure Wor!er 2ole 1nstall# http#,,ossonazure%interoperabilit4bridges%com, http#,,ossonazure%interope rabilit4bridges%com,ar ar



3ounded Ma4 66G Database-as-a-service 8DBaaS9  –



Managed* hosted for! of CouchDB 1ncremental Map2educe engine @orizontal scaling ) built-in +ucene search

G Cloudants are committers to Apache CouchDB K*666O users



Cloudants Commitment to Apache CouchDB •

>? of Apache CouchDB pro&ect committers wor! at Cloudant Apache CouchDB roadmap  –

&i"Cou!# @orizontal scaling &i"Cou!# framewor! based on Amazon D4namo paper folding into the ne/t Apache release 'au(ton## 3uton replacement 'au(ton modular CouchDB Web dashboard live NS$ editor with •


 NavaScript hinting



@4brid Approaches Combining hosted services* cloud applications* and onpremises applications


 7our our App  7

 7our our Data  7

)aaS Virtual Machines

)aaS Virtual Machines

%aaS Cloud Services

%aaS Cloud Services

%aaS Web Sites

SaaS 'it Deplo4ments

ther sites* local apps* etc%



Which approach is best for Deplo4m ent Comple/i t4

 youQ  you Q perational 2esponsibili 3le/ibilit t4 4


Securit 4





+inu/ or Windo ws

%aa S Saa S




Windo Built-in ws onl4








We$ Sites Deplo4ing Web Sites on Windows


Windows Azure  7  7our our Datacenter

Virtual Machines

Cloud Services

Web Sites










3irewall 2ules

3irewall 2ules


Virtual $etwor!

Virtual $etwor!



Virtualization @ardware

3ocus on the Application


Windows Azure Web  Sites powerful web sites in seconds

start simple

code smart

go live

start free* scale up and out as 4ou go* friction-free and without the headaches

with classic asp* asp%net* php or node%&s* develop on Windows* SR or +inu/

deplo4 live in seconds* easil4 monitor performance* performance* rapidl4 diagnose and E/ issues


shared web sites


shared S*ARE )NS,ANCES



web sitesshared

shared S*ARE )NS,ANCES

#-9 #-9



web sitesshared

 6

reserve d S*ARE )NS,ANCES


#-9 #-9




shared web sites





web sitesshared


reserve d











Supported Web 3ramewor!s

Bring 4our own runtime


Supported Publishing Methods



WE&E% O/ 


  s   r   e   n    t   r   a   p


Windows Azure Web Sites

start simple

code smart

go live


Start Simple 'et started with 01 2ree web sites Create new sites in seconds asil4 manage and scale 4our sites Automatic load balancing and shared storage across instances Scale out or up to reservedand instances for improved performance scale


Code Smart "se ASP%$I* ASP* [email protected]* $ode%&s or Custom S(+ Azure or M4S(+ databases Start with open source apps Develop with VS and WebMatri/ Supports an4 Web development tool on an4 platform 8Windows* SR* +inu/9


'o +ive 2apid deplo4ment for <uic! iteration 1ntegrated source control with Ieam 3oundation Server 8I3S9 and 'it Built-in monitoring of perf and usage data (uic! access to re<uest logs* failed re<uests diagnostics and diagnostics


Node.js and 3runt Deplo4ing Web Sites on Windows Azure Web Sites


What is $ode%&sQ •

A NavaScript runtime environment Server-side NavaScript Server-side Compiled for speed Command line  NavaScript AP1 for networ! and Ele s4stem access acc ess





Designed for high concurr concurrenc4 enc4  –

vents* not threads or processes

$ever bloc!s* not even for 1, "ses CommonNS framewor! s4nta/  –

Close to real 


W!4 5se Node.js 6 •

 NavaScript on server-side server-side and client-side vent loop with a stac!  –


$ode%NS serves re<uests re<uests in an event loop +arge number of simultaneous re<uests%

Avoids Conte/t Switching  –

Waiting for 1, or S4nchronization operation to complete%

$ode attaches NS callbac!s to 1, re<uests  Ihe Tevent drivenU drivenU part When the original 1 is completed* a callbac!



to the server completes the re<ues re<uest% t%


Speed4 1, With vents Threads


Threads lock apps / threads

One thread

Listens fo for in incoming rre equests

Process from q qu ueue

Multiple threads dependent on multiple processes

State saved for each event

Depends on context switching

ot dependent on !/O or S"nchroni#ation


$ode%&s with 'runt •

$ode%&s - Scalable* vent-Driven @IIP server  NavaScript and simple AP1


'runt on $ode%&s  –

Deplo4mentt and Ias! Managemen Deplo4men Managementt


Application Scenarios We$ Sites

Cloud Ser7ies

Virtual Ma!ines

Modern web apps

Multi-tier applications

nterprise server applications

Perfect 4our app consists ofside client side mar!upifand scripting* server scripting and a database% Powerful capabilit4 to scale out and up as needed%

Cloud-based applications that tiers separate application logic into multiple 8i%e% caching middle tier* as4nchronous bac!ground processes li!e order processing9 using both Web and Wor!er 2oles

2un 4our e/isting applications the cloud* such asenterprise S(+ Server* SharePointin Server or Active Director4% Director4%

Continuous development

Apps that re<uire advanced administration

Porting e/isting line of business apps

Cloud-based applications that re<uire admin access* remote des!top access or elevated permissions

Choose an image from the librar4 or upload 4our own [email protected]%

Apps that re<uire advanced networ!ing

Windows or +inu/ operating s4stem

Cloud-based applications that re<uire networ! isolation for use with Windows Azure Connect or Windows Azure Virtual $etwor!

Support for Windows Server* along with communit4 and commercial versions of +inu/% Connect virtual machines with cloud services to ta!e full advantage of PaaS services%

Deplo4 directl4 from 4our source code repositor4* using 'it or Ieam 3oundation Service%

Popular open source apps +aunch a professional loo!ing site with a few clic!s using apps li!e WordPress*  Noomla  Noo mla* * Dru Drupal pal** Dot$ Dot$et$ et$u! u!e e and and "mbraco


ther 2esources •

Microsoft pen Iechnologies Blog# http#,,blogs%msdn%com,b,interoperabilit4 VM Depot# http#,,vmdepot%msopentech%com Windows Azure development# www%WindowsAzure%com   www%WindowsAzure%com SDs and Command +ine Iools# http#,,www%windowsazure%com,en-us,downloads, Windows Azure Iraining it# http#,,windowsazure-training!it%github%com, #,,windowsazure-training!it%github%com,   http Microsoft Web Platform 1nstaller# http#,,www%microsoft%com,web,downloads,platform%asp/ Web Matri/ http#,,www%microsoft%com,web,webmatri/, Pro&ect udu https#,,github%com,pro&ect https#,,github%com,pro&ect!udu, !udu,!udu !udu  Ihe application 1 showed toda4 https#,,github%com,a https#,,github%com,a/em /emclion,confere clion,conference nce


89 A

Sponsor Documents

Or use your account on DocShare.tips


Forgot your password?

Or register your new account on DocShare.tips


Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in