MongoDB and Windows Azure

Doug Mahugh                         Sridhar Nanjundeswaran
Senior Technical Evangelist         Software Engineer
Microsoft Open Technologies, Inc.   10gen
Agenda
Windows Azure
Application
building blocks
Open Source on Windows Azure




Learn more: http://www.windowsazure.com/en-us/community/open-source-software/
Microsoft Open Technologies, Inc.
Windows Azure Developer Center

                                    .NET driver

                                    Node.js driver

                                    Java driver

                                    PHP driver

                                    Python driver

                                    Driver download page




 http://www.windowsazure.com/en-us/develop/overview/
Windows Azure Cloud Service
Windows Azure
Virtual Machines
Virtual Machine Sizes
          CPU                Bandwidth   # Data
VM Size            Memory
          Cores              (Mbps)      Disks
Extra
          Shared   768 MB    5           1
Small

Small     1        1.75 GB   100         2

Medium    2        3.5 GB    200         4

Large     4        7 GB      400         8

Extra
          8        14 GB     800         16
Large
Windows Azure Management
Portal
http://manage.windowsazure.com



                                 https://windows.azure.com
Getting Started




 http://www.windowsazure.com/en-us/pricing/free-trial/
MongoDB + Windows Azure
Replica Sets: high availability

        Your        Driver       Replica Set
      Application




                             Replica set hosted
                             on Windows Azure
                               worker roles or
                              virtual machines
Sharding: high scalability and
throughput        Mongos      Your
                                       (router)             Application




 Key range A-B      Key range B-C       Key range C-D         Key range D-E




             Shards and mongos (router) hosted on Windows
                  Azure worker roles or virtual machines
MongoDB + Windows Azure
benefits
                         • PaaS or IaaS deployment
                         • Java, PHP, Node.JS, .NET, or Python
            Flexible
                         • Many OS options including Windows
                           Server, CentOS, Ubuntu, SUSE

                         • MongoDB’s built-in support for
                           horizontal scaling and sharding
           Scalable
                         • Windows Azure’s built-in support for
                           responsive auto-scaling


MongoDB on Windows Azure provides all the benefits customers have
come to expect from cloud computing: elasticity, on-demand capacity,
faster time to market, and pay-for-what-you-use pricing
Deploying MongoDB as a Cloud Service




  http://www.mongodb.org/display/DOCS/MongoDB+on+Azure+Worker+Roles
Deploying to Virtual Machines




   http://www.mongodb.org/display/DOCS/MongoDB+on+Azure+VM
   +-+Windows+Installer




 http://www.windowsazure.com/en-us/manage/linux/common-
 tasks/mongodb-on-a-linux-vm/
Command Line Syntax
prompt> azure Overview
               topic verb options
account                  download      username
account location         import        password
account affinity-group   list          dns-prefix
vm                       show          vm-name
vm disk                  delete        lb-port
vm endpoint              start         target-image-name
vm image                 restart       source-path
service                  shutdown      disk-image-name
service cert             capture       size-in-gb
site                     create        thumbprint
config                   create-from   value
                         attach        -v
                         attach-new    -vv
                         detach
                         browse
                         set
Example: Provisioning a Replica
Set




To set up MongoDB, SSH into each instance and:
DEMO-PaaS


App deployed with the MongoDB Replica Set wrapper for Windows Azure
http://beefb1a5abb743f086e57c5f7bf5d3cf.cloudapp.net:8080/




Monitoring service:
http://beefb1a5abb743f086e57c5f7bf5d3cf.cloudapp.net/
DEMO-IaaS

mongo-demo.php?host=localhost

Local MongoDB
instance


mongo-demo.php?host=linux

Replica set on
Linux VMs

mongo-demo.php?host=windows

 Replica set on
 Windows VMs
Resources

 http://www.mongodb.org/display/DOCS/MongoDB+on+Azure+-+Overview

 http://blogs.msdn.com/b/interoperability/archive/2012/06/01/mongodb-
 experts-video-series.aspx

 www.WindowsAzure.com

 http://windowsazure-trainingkit.github.com/

 http://ossonazure.interoperabilitybridges.com/tutorials

 http://www.windowsazure.com/en-us/manage/linux/common-tasks/mongodb-
 on-a-linux-vm/

 http://waweb.windowsazure.com/en-us/develop/nodejs/tutorials/website-with-
 mongodb-(mac)/
Q&A

MongoDB and Windows Azure