ITCamp 2011 - Mihai Nadas - Windows Azure interop
-
Upload
itcamp -
Category
Technology
-
view
1.219 -
download
1
Transcript of ITCamp 2011 - Mihai Nadas - Windows Azure interop
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Windows Azure – Plug and Play Interoperability and The Freedom of Choice
Mihai Nadăș
Yonder / www.tss-yonder.com
[email protected] / www.mihainadas.com
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
IT Camp 2011
• Thanks for coming!
• ITCamp is made possible by our sponsors:
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Session agenda
1. The state of the cloud and why should you care
2. Windows Azure - a short refreshment – DEMO / PhooStock (Photo Sharing in Azure)
3. Interoperability? As-in JAVA and stuff? – DEMO / Tomcat on Windows Azure
4. What about PHP? MySQL? – DEMO / PHP and MySQL on Windows Azure
5. Q&A
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
AND WHY SHOULD YOU CARE
The state of the Cloud
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
The cloud evolves
• It becomes more crisp Cloud computing is a model for enabling convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction. (Peter Mell and Tim Grance, NIST)
• It grows as they told us it will
– ~$37.8B in 2010, expected $121.B by 2015 (26% CAGR) (MarketsAndMarkets Report)
– By 2014, ~65% of new products will be SaaS services (IDC Report)
– SaaS-derived revenue will account for 26% of net new growth in 2014 (IDC Report)
• New players confirm it by joining in
– Oracle and HP, just to name a few
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Why should you care?
• You will have to taste it, sooner or later
• Your job will require it
• Your startup will need it
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
First, a short poll
Windows Azure Microsoft .NET(non-cloud)
JAVA, PHP, MySQL,LOLCODE
Which of the following technologies you’re most experienced with?
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Processing results, please wait...
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
And... the results!
0%
10%
20%
30%
40%
50%
60%
Windows Azure Microsoft .NET(non-cloud)
JAVA, PHP, MySQL
Which of the following technologies you’re most experienced with?
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
OPENENESS TOOLKIT
Windows Azure
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Windows Azure Refresher
• Scalable computation in the cloud
• Durable cloud storage
• Write code, test, debug locally
• Automated management in the cloud
• Utility business model
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Web Applications
massive scale infrastructure
burst & overflow capacity
temporary, ad-hoc sites
Service Applications
composite applications
mobile/client connected services
Web API’s
Hybrid Applications
component services
distributed processing
distributed data
external storage
Media Applications
CGI rendering
content transcoding
media streaming
Information Sharing
reference data
common data repositories
knowledge discovery & management
Collaborative Processes
multi-enterprise integration
B2B & e-commerce
supply chain management
health & life sciences
domain-specific services
What’s it good for?
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Guest VM
Guest VM
Guest VM
Host VM
Maintenance OS,
Hardware-optimized hypervisor
The Fabric Controller communicates with every server
within the Fabric. It manages Windows Azure, monitors
every application, decides where new applications
should run – optimizing hardware utilization.
Storage – distributed storage systems that
are highly consistent, reliable, and scalable.
Compute – instance types: Web Role &
Worker Role. Windows Azure applications
are built with web role instances, worker
role instances, or a combination of both.
Each instance runs on its
own VM (virtual machine)
and local transient storage;
replicated as needed
HTTP/HTTPS
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
DEMO
PhotoStock – Photo Sharing on Windows Azure
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
What we’ve seen so far?
• Two roles – web and worker role
• They’re actually full fledged Windows Server machines
• We can open up ports to the world
• We’re free to program it as we like (Full Trust)
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
• Not managing and interacting with server OS – less work for you
– don’t have to care it is “Windows Server”
– but have to live with some limits and constraints
• Some level of control – process isolation (runs inside your own VM/guest OS)
– service and data geo-location
– allocated capacity, scale on-demand
– full spectrum of application architectures and programming models
• You can run Java! – plus PHP, Python, Ruby, MySQL, memcached, etc.
– and eventually anything that runs on Windows
How this may be interesting to you?
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
WINDOWS AZURE + JAVA
Introducing
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Mental Model
• Windows
• Non-admin user
• USB drive with “runme.bat”
• Can your app run that way?
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Deployment Options
• Worker Role – fabric sandbox native
deployment
– automated, need additional code
– available now
• VM Role – host your own pre-configured
VM image
– automated, full control
– In beta
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Worker Role Programming Model
• Basically DLL with main()
• In .NET – OnStart() – initialization
– Run() – main
– OnStop() – graceful shutdown
• Expected to run forever
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
How It Works
• Platform features: – Native code execution (run the JVM)
– Local storage (Tomcat logs, etc.)
– Worker roles with endpoints (listen on port 80)
– Initialization (copy and launch Tomcat)
• Java-specific artifacts: – Java storage client library
– Apache Tomcat solution accelerator
– (Eclipse tooling)
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Creating a Java Worker Role
1. Include JRE in worker role 2. Launch java.exe with our class
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
A Better Java Worker
• Reading configuration settings
• Discovering endpoints
• Handling changes
• Monitoring
• Diagnostics
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Running Tomcat in Windows Azure
• Use the solution accelerator; it’s easier
• Built by Infosys
• To do it yourself: – Copy Tomcat to local storage
– Configure correct listening port
– Start Tomcat service
– Monitor and report health
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
DEMO
Running Tomcat on Windows Azure
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
What we’ve seen so far?
• Tomcat Solution Accelerator – http://archive.msdn.microsoft.com/winazuretomcat
• Windows Azure can run anything that could basically run on a Windows machine (just add care)
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Anatomy of a Java Worker Role
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Service Instance
Service Instance
Worker Role
RoleEntry
Point
Sub-Process
JVM
Tomcat
server.xml Catalina
Fabric
Controller
Load
Balancer
Table
Storage
Blob
Storage Queue
Service
Bus
Access
Control
SQL
Database
new Process()
bind port(x)
htt
p:/
/inst
ance
:x
htt
p:/
/inst
ance
:y
listen port(x)
http://app:80
get
runtime
info
index.jsp
Architectural Perspective
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
• Runtime – Multiple Java app servers
– Any Windows-based JRE
• Supports – Windows Azure Storage
– Windows Azure Drive
– Windows Azure AppFabric
– SQL Azure
• One-click cloud deployment
• Integrated diagnostics, monitoring, and logging
Windows Azure Tools for Eclipse/Java
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
• Windows Azure SDK for Java – Enables Java developers to develop against
Windows Azure Storage & Service Management infrastructure using familiar & consistent programming model
• Features – Set of Java classes for Windows Azure Blobs,
Tables & Queues (for CRUD operations) & Service Management
– Helper Classes for HTTP transport, AuhN/AuthZ, REST & Error Management
– Manageability, Instrumentation & Logging(log4j)
• Open Source Project site: – Developed by Soyatec
– www.windowsazure4j.org
Windows Azure SDK for Java
Blobs, Tables, Queues
Manageability, Instrumentation,
logging
Helper for Http, Auth, REST, Error
Your Java application
REST
Accessing Windows Azure Storage from Java
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
• SQL Azure Database – Full relational Database as a Service
• Supports TDS & OData
• Direct connectivity to SQL Azure – Connect with JDBC/ODBC using the latest driver
– Eclipse tooling support
• Interoperability using REST – Easily wrap SQL Azure with WCF Data Services
– Restlet extension for OData (Java)
• Committed to OSS support and app compatibility
Accessing SQL Azure from Java
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Platform – Dynamic networking
• <your app>.cloudapp.net
• no naked domain
• CNAME re-direct from custom domain
• sending traffic to loopback addresses not allowed and cannot open arbitrary ports
– No OS-level access
– Non-persistent local file system
• allocate local storage directory
• read-only: Windows directory, machine configuration files, service configuration files
– Available registry resources
• read-only: HKEY_CLASSES_ROOT, HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CURRENT_CONFIG
• full access: HKEY_CURRENT_USER
Java – Sandboxed networking
• NIO (java.nio) not supported
• engine and host-level clustering
• JNDI, JMS, JMX, RMI, etc.
• need to configure networking
– Non-persistent local file system
• logging, configuration, etc.
– REST-based APIs to services
• Table Storage – schema-less (noSQL)
• Blob Storage – large files (<200GB block blobs; <1TB page blobs)
• Queues
• Service Bus
• Access Control
Some Constraints
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
WINDOWS AZURE + PHP/MYSQL
Is this limited to Java?
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Running PHP in Windows Azure • How to Do It
– Host in Web role (like .NET) – Supply PHP runtime – Point to runtime via FastCGI
configuration in • Web.config • Web.roleConfig
• Eclipse Tooling @ http://windowsazure4e.org does the above for you
PHP Web Role Instance 2
VIP
Load
Bal
ance
r
PHP Web Role Instance 1
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
MySQL: Simple Configuration
Web
Ro
le
VIP
Load Balancer
Wo
rker
Ro
le MySQL
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
MySQL in a Windows Azure Application
• Running MySQL in a worker role – Copy MySQL to the worker role sub-directory
– Copy to read-write local storage
– Configure MySQL to listen on the right port
– Monitor MySQL health
• Consuming MySQL – Discover IP address and port
– Normal access from then on
– Handle topology changes
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Replication
VIP
Load Balancer
MySQL MySQL MySQL
M S S
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Windows Azure Drive with Hot Spare
VIP
Load Balancer
MySQL MySQL
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Windows Azure Drive with Hot Spare
VIP
Load Balancer
MySQL MySQL
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Windows Azure Drive with Hot Spare
VIP
Load Balancer
MySQL MySQL
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
MySQL Solution Accelerator
• Built by Infosys
• Master/slave configurations in a worker role – Leverage Windows Azure Drive – Master election and replication on startup – Failover and recovery – Scale up/down slaves – Periodic backups - full and incremental
• Available with source code
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
DEMO
Running PHP/MySQL on Windows Azure
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
PHP with Windows Azure Storage
• Windows Azure SDK for PHP @ http://phpazure.codeplex.com
• PHP programming model for Windows Azure Storage
• Features – PHP classes for Blobs, Tables & Queues
– Store PHP sessions in Table Storage
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
PHP with SQL Azure
• SQL Server Driver for PHP @ http://sqlsrvphp.codeplex.com/
• Supports PHP access to SQL Azure
• Features – Choose between SQL Server and SQL Azure by
changing connection string
– Use from on-premises or in Windows Azure
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Benefits of Database as a Service
SQL Azure Database as a Service
• Lower TCO
• Automatic High Availability
– Multiple servers with live copies of your data --- instant failover
• Automatic Fault-Tolerance
• Automatic maintenance
– No downtime
• Instantly expand/contract databases to meet application needs
• Metered by database
• Mission-critical SQL Server foundation
MySQL Solution Accelerator
• Compatibility w/ MySQL apps • Pre-configured clustering across
multiple compute instances • Database maintenance required • Metered by compute hour
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Does this stop here?
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Does this stop here?
• No! You can run LOLCode too.
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Anatomy of a LOLCode Worker Role
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Key Takeaways
1. Powerful platform primitives
2. Worker role with endpoint is a flexible model
3. Windows Azure can run anything that adheres to the „mental model”
• JAVA
• PHP, MySQL
• Python, Ruby
• [enter your platform of choice here]
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
To Remember
• Tomcat Solution Accelerator
• MySQL PHP Solution Accelerator
• Windows Azure SDK for Java
• Windows Azure SDK for PHP
• Windows Azure Tools for Eclipse
• Windows Azure Interoperability
• LOLCode .NET Compiler
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
More, online
• AzureWorks.ro / www.azureworks.ro – Windows Azure User Group – LinkedIn Community – News – This presentation, the references and the source
files – Comming soon – LOLCode on Windows Azure
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Q&A
@itcampro / #itcampro Premium conference on Microsoft’s Dev and ITPro technologies
Don’t forget!
Get your free Azure pass!
• 30+15 days, no CC req’d
– http://bit.ly/ITCAMP11
– Promo code: ITCAMP11
We want your feedback!
• Win a WP7 smartphone
– Fill in your feedback forms
– Raffle: end of the day